The GeomFromGeoJSON function converts a JSON document that conforms to the GeoJSON standards into an ST_Geometry object.
- The name of the database where the function is located.
- An expression which evaluates to a JSON document conforming to the GeoJSON standards as specified in http://geojson.org/geojson-spec.html. The GeoJSON text string can be represented as a VARCHAR, CLOB, or JSON instance in the LATIN or UNICODE character set.
- This GeoJSON text string must represent a geometry object. The value of the type member must be one of these strings: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", or "GeometryCollection".
- An integer which specifies the Spatial Reference System (SRS) identifier assigned to the returned ST_Geometry object.
An ST_Geometry object which contains the data that was stored in the JSON document.
The GeoJSONFromGeom and GeomFromGeoJSON functions operate on or produce data in the JSON text format. They cannot be used on JSON data that is stored in one of the binary formats. However, JSON data stored in a binary format can be cast to/from its text representation to interact with these functions. The casting can be done implicitly, so little effort is needed to perform this operation.
This function is not compliant with the ANSI SQL:2011 standard.