<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="spatial-geojson-functions">
      </a>
      14.16.11 Spatial GeoJSON Functions
     </h3>
    </div>
   </div>
  </div>
  <p>
   This section describes functions for converting between GeoJSON
      documents and spatial values. GeoJSON is an open standard for
      encoding geometric/geographical features. For more information,
      see
   <a class="ulink" href="http://geojson.org" target="_blank">
    http://geojson.org
   </a>
   . The functions discussed
      here follow GeoJSON specification revision 1.0.
  </p>
  <p>
   GeoJSON supports the same geometric/geographic data types that
      MySQL supports. Feature and FeatureCollection objects are not
      supported, except that geometry objects are extracted from them.
      CRS support is limited to values that identify an SRID.
  </p>
  <p>
   MySQL also supports a native
   <a class="link" href="json.html" title="13.5 The JSON Data Type">
    <code class="literal">
     JSON
    </code>
   </a>
   data type and a set of SQL functions to enable operations on JSON
      values. For more information, see
   <a class="xref" href="json.html" title="13.5 The JSON Data Type">
    Section 13.5, “The JSON Data Type”
   </a>
   , and
   <a class="xref" href="json-functions.html" title="14.17 JSON Functions">
    Section 14.17, “JSON Functions”
   </a>
   .
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <a name="function_st-asgeojson">
     </a>
     <p>
      <a class="link" href="spatial-geojson-functions.html#function_st-asgeojson">
       <code class="literal">
        ST_AsGeoJSON(
        <em class="replaceable">
         <code>
          g
         </code>
        </em>
        [,
        <em class="replaceable">
         <code>
          max_dec_digits
         </code>
        </em>
        [,
        <em class="replaceable">
         <code>
          options
         </code>
        </em>
        ]])
       </code>
      </a>
     </p>
     <a class="indexterm" name="idm46045196155456">
     </a>
     <p>
      Generates a GeoJSON object from the geometry
      <em class="replaceable">
       <code>
        g
       </code>
      </em>
      . The object string has the
          connection character set and collation.
     </p>
     <p>
      If any argument is
      <code class="literal">
       NULL
      </code>
      , the return value
          is
      <code class="literal">
       NULL
      </code>
      . If any non-
      <code class="literal">
       NULL
      </code>
      argument is invalid, an error occurs.
     </p>
     <p>
      <em class="replaceable">
       <code>
        max_dec_digits
       </code>
      </em>
      , if specified,
          limits the number of decimal digits for coordinates and causes
          rounding of output. If not specified, this argument defaults
          to its maximum value of 2
      <sup>
       32
      </sup>
      −
          1. The minimum is 0.
     </p>
     <p>
      <em class="replaceable">
       <code>
        options
       </code>
      </em>
      , if specified, is a
          bitmask. The following table shows the permitted flag values.
          If the geometry argument has an SRID of 0, no CRS object is
          produced even for those flag values that request one.
     </p>
     <div class="informaltable">
      <table summary="Option flags for the ST_AsGeoJSON() function.">
       <colgroup>
        <col style="width: 10%"/>
        <col style="width: 90%"/>
       </colgroup>
       <thead>
        <tr>
         <th>
          Flag Value
         </th>
         <th>
          Meaning
         </th>
        </tr>
       </thead>
       <tbody>
        <tr>
         <td>
          0
         </td>
         <td>
          No options. This is the default if
          <em class="replaceable">
           <code>
            options
           </code>
          </em>
          is
                not specified.
         </td>
        </tr>
        <tr>
         <td>
          1
         </td>
         <td>
          Add a bounding box to the output.
         </td>
        </tr>
        <tr>
         <td>
          2
         </td>
         <td>
          Add a short-format CRS URN to the output. The default format is a short
                format
                (
          <code class="literal">
           EPSG:
           <em class="replaceable">
            <code>
             srid
            </code>
           </em>
          </code>
          ).
         </td>
        </tr>
        <tr>
         <td>
          4
         </td>
         <td>
          Add a long-format CRS URN
                (
          <code class="literal">
           urn:ogc:def:crs:EPSG::
           <em class="replaceable">
            <code>
             srid
            </code>
           </em>
          </code>
          ).
                This flag overrides flag 2. For example, option values
                of 5 and 7 mean the same (add a bounding box and a
                long-format CRS URN).
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa68518300"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token function">ST_AsGeoJSON</span><span class="token punctuation">(</span><span class="token function">ST_GeomFromText</span><span class="token punctuation">(</span><span class="token string">'POINT(11.11111 12.22222)'</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ST_AsGeoJSON(ST_GeomFromText('POINT(11.11111 12.22222)'),2) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> {"type": "Point", "coordinates": [11.11, 12.22]}            <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <a name="function_st-geomfromgeojson">
     </a>
     <p>
      <a class="link" href="spatial-geojson-functions.html#function_st-geomfromgeojson">
       <code class="literal">
        ST_GeomFromGeoJSON(
        <em class="replaceable">
         <code>
          str
         </code>
        </em>
        [,
        <em class="replaceable">
         <code>
          options
         </code>
        </em>
        [,
        <em class="replaceable">
         <code>
          srid
         </code>
        </em>
        ]])
       </code>
      </a>
     </p>
     <a class="indexterm" name="idm46045196122832">
     </a>
     <p>
      Parses a string
      <em class="replaceable">
       <code>
        str
       </code>
      </em>
      representing a
          GeoJSON object and returns a geometry.
     </p>
     <p>
      If any argument is
      <code class="literal">
       NULL
      </code>
      , the return value
          is
      <code class="literal">
       NULL
      </code>
      . If any non-
      <code class="literal">
       NULL
      </code>
      argument is invalid, an error occurs.
     </p>
     <p>
      <em class="replaceable">
       <code>
        options
       </code>
      </em>
      , if given, describes how to
          handle GeoJSON documents that contain geometries with
          coordinate dimensions higher than 2. The following table shows
          the permitted
      <em class="replaceable">
       <code>
        options
       </code>
      </em>
      values.
     </p>
     <div class="informaltable">
      <table summary="Option flags for the ST_GeomFromGeoJSON() function.">
       <colgroup>
        <col style="width: 10%"/>
        <col style="width: 90%"/>
       </colgroup>
       <thead>
        <tr>
         <th>
          Option Value
         </th>
         <th>
          Meaning
         </th>
        </tr>
       </thead>
       <tbody>
        <tr>
         <td>
          1
         </td>
         <td>
          Reject the document and produce an error. This is the default if
          <em class="replaceable">
           <code>
            options
           </code>
          </em>
          is not specified.
         </td>
        </tr>
        <tr>
         <td>
          2, 3, 4
         </td>
         <td>
          Accept the document and strip off the coordinates for higher coordinate
                dimensions.
         </td>
        </tr>
       </tbody>
      </table>
     </div>
     <p>
      <em class="replaceable">
       <code>
        options
       </code>
      </em>
      values of 2, 3, and 4
          currently produce the same effect. If geometries with
          coordinate dimensions higher than 2 are supported in the
          future, you can expect these values to produce different
          effects.
     </p>
     <p>
      The
      <em class="replaceable">
       <code>
        srid
       </code>
      </em>
      argument, if given, must
          be a 32-bit unsigned integer. If not given, the geometry
          return value has an SRID of 4326.
     </p>
     <p>
      If
      <em class="replaceable">
       <code>
        srid
       </code>
      </em>
      refers to an undefined
          spatial reference system (SRS), an
      <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_srs_not_found" target="_top">
       <code class="literal">
        ER_SRS_NOT_FOUND
       </code>
      </a>
      error occurs.
     </p>
     <p>
      For geographic SRS geometry arguments, if any argument has a
          longitude or latitude that is out of range, an error occurs:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         If a longitude value is not in the range (−180,
              180], an
         <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_longitude_out_of_range" target="_top">
          <code class="literal">
           ER_LONGITUDE_OUT_OF_RANGE
          </code>
         </a>
         error occurs.
        </p>
       </li>
       <li class="listitem">
        <p>
         If a latitude value is not in the range [−90, 90],
              an
         <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_latitude_out_of_range" target="_top">
          <code class="literal">
           ER_LATITUDE_OUT_OF_RANGE
          </code>
         </a>
         error occurs.
        </p>
       </li>
      </ul>
     </div>
     <p>
      Ranges shown are in degrees. If an SRS uses another unit, the
          range uses the corresponding values in its unit. The exact
          range limits deviate slightly due to floating-point
          arithmetic.
     </p>
     <p>
      GeoJSON geometry, feature, and feature collection objects may
          have a
      <code class="literal">
       crs
      </code>
      property. The parsing function
          parses named CRS URNs in the
      <code class="literal">
       urn:ogc:def:crs:EPSG::
       <em class="replaceable">
        <code>
         srid
        </code>
       </em>
      </code>
      and
      <code class="literal">
       EPSG:
       <em class="replaceable">
        <code>
         srid
        </code>
       </em>
      </code>
      namespaces, but not CRSs given as link objects. Also,
      <code class="literal">
       urn:ogc:def:crs:OGC:1.3:CRS84
      </code>
      is recognized
          as SRID 4326. If an object has a CRS that is not understood,
          an error occurs, with the exception that if the optional
      <em class="replaceable">
       <code>
        srid
       </code>
      </em>
      argument is given, any CRS is
          ignored even if it is invalid.
     </p>
     <p>
      If a
      <code class="literal">
       crs
      </code>
      member that specifies an SRID
          different from the top-level object SRID is found at a lower
          level of the GeoJSON document, an
      <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_invalid_geojson_crs_not_top_level" target="_top">
       <code class="literal">
        ER_INVALID_GEOJSON_CRS_NOT_TOP_LEVEL
       </code>
      </a>
      error occurs.
     </p>
     <p>
      As specified in the GeoJSON specification, parsing is
          case-sensitive for the
      <code class="literal">
       type
      </code>
      member of the
          GeoJSON input (
      <code class="literal">
       Point
      </code>
      ,
      <code class="literal">
       LineString
      </code>
      , and so forth). The
          specification is silent regarding case sensitivity for other
          parsing, which in MySQL is not case-sensitive.
     </p>
     <p>
      This example shows the parsing result for a simple GeoJSON
          object. Observe that the order of coordinates depends on the
          SRID used.
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa62364940"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> <span class="token variable">@json</span> <span class="token operator">=</span> <span class="token string">'{ "type": "Point", "coordinates": [102.0, 0.0]}'</span><span class="token punctuation">;</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token function">ST_AsText</span><span class="token punctuation">(</span><span class="token function">ST_GeomFromGeoJSON</span><span class="token punctuation">(</span><span class="token variable">@json</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ST_AsText(ST_GeomFromGeoJSON(@json)) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> POINT(0 102)                         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token function">ST_SRID</span><span class="token punctuation">(</span><span class="token function">ST_GeomFromGeoJSON</span><span class="token punctuation">(</span><span class="token variable">@json</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ST_SRID(ST_GeomFromGeoJSON(@json)) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>                               4326 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token function">ST_AsText</span><span class="token punctuation">(</span><span class="token function">ST_SRID</span><span class="token punctuation">(</span><span class="token function">ST_GeomFromGeoJSON</span><span class="token punctuation">(</span><span class="token variable">@json</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ST_AsText(ST_SRID(ST_GeomFromGeoJSON(@json),0)) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> POINT(102 0)                                    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
     </div>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
