Skip to main content

st_geomfromgeojson function

Applies to: check marked yes Databricks Runtime 17.1 and above

Preview

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

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