st_geogfromwkt
function
Applies to: Databricks SQL
Databricks Runtime 17.1 and above
Preview
This feature is in Public Preview.
note
This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types
Parses the WKT description of a geography and returns the corresponding GEOGRAPHY
value.
The SRID value of the returned GEOGRAPHY
value is 4326.
Syntax
st_geogfromwkt ( wktExpr )
Arguments
wktExpr
: ASTRING
value, representing a geography in WKT format.
Returns
A value of type GEOGRAPHY(4326)
, corresponding to the input WKT description.
The function returns NULL
if the input is NULL
.
Error conditions
- If the value of
wktExpr
is an invalid WKT description, the function returns WKT_PARSE_ERROR.
Examples
SQL
-- Simple example.
> SELECT st_asgeojson(st_geogfromwkt('POINT Z (1 2 3)'));
{"type":"Point","coordinates":[1,2,3]}
Related functions
st_asbinary
functionst_asewkb
functionst_asewkt
functionst_asgeojson
functionst_astext
functionst_geogfromgeojson
functionst_geogfromtext
functionst_geogfromwkb
functionst_geomfromewkb
functionst_geomfromgeojson
functionst_geomfromtext
functionst_geomfromwkb
functionst_geomfromwkt
functionto_geography
functionto_geometry
functiontry_to_geography
functiontry_to_geometry
function