st_geomfromgeojson function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 17.1 and above check marked yes Lakehouse//RT

Note

This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types.

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: A STRING 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

Examples

-- Simple example.
> SELECT st_asewkt(st_geomfromgeojson('{"type":"Point","coordinates":[10,34,23]}'));
  SRID=4326;POINT Z (10 34 23)