Purpose
The GeomFromGeoJSON function converts a JSON document that conforms to the GeoJSON standards into an ST_Geometry object.
Syntax
Syntax Elements
- TD_SYSFNLIB
- The name of the database where the function is located.
- geojson_expr
- 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.
- asrid
- An integer which specifies the Spatial Reference System (SRS) identifier assigned to the returned ST_Geometry object.
Return Value
An ST_Geometry object which contains the data that was stored in the JSON document.
Usage Notes
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.
ANSI Compliance
This function is not compliant with the ANSI SQL:2011 standard.