Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Parses the GeoJSON description of a geometry and returns the corresponding GEOMETRY
value.
The SRID value of the returned GEOMETRY
value is 4326.
Syntax
st_geomfromgeojson ( geojsonExpr )
Arguments
geojsonExpr
: ASTRING
value, representing a geography in GeoJSON format.
Returns
A value of type GEOMETRY(4326)
, corresponding to the input GeoJSON description.
The function returns NULL
if the input is NULL
.
Error conditions
- If the value of
geojsonExpr
is an invalid GeoJSON description, the function returns GEOJSON_PARSE_ERROR.
Examples
-- Simple example.
> SELECT st_asewkt(st_geomfromgeojson('{"type":"Point","coordinates":[10,34,23]}'));
SRID=4326;POINT Z (10 34 23)
Related functions
st_asbinary
functionst_asewkb
functionst_asewkt
functionst_asgeojson
functionst_astext
functionst_geogfromgeojson
functionst_geogfromtext
functionst_geogfromwkb
functionst_geomfromewkb
functionst_geomfromtext
functionst_geomfromwkb
functionto_geography
functionto_geometry
functiontry_to_geography
functiontry_to_geometry
function