Share via


st_geogfromgeojson function

Applies to: check marked yes Databricks Runtime 17.1 and above

Important

This feature is in Public Preview.

Parses the GeoJSON description of a geography and returns the corresponding GEOGRAPHY value. The SRID value of the returned GEOGRAPHY value is 4326.

Syntax

st_geogfromgeojson ( geojsonExpr )

Arguments

  • geojsonExpr: A STRING value, representing a geography in GeoJSON format.

Returns

A value of type GEOGRAPHY(4326), corresponding to the input GeoJSON description.

The function returns NULL if the input is NULL.

Error conditions

Examples

-- Simple example.
> SELECT st_astext(st_geogfromgeojson('{"type":"Point","coordinates":[1,2,3]}'));
  POINT Z (1 2 3)