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 SQL
Databricks Runtime 17.1 and above
Important
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_geogfromtext ( wktExpr )
Arguments
wktExpr: ASTRINGvalue, 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
wktExpris an invalid WKT description, the function returns WKT_PARSE_ERROR.
Examples
-- Simple example.
> SELECT st_asgeojson(st_geogfromtext('POINT Z (1 2 3)'));
{"type":"Point","coordinates":[1,2,3]}
Related functions
st_asbinaryfunctionst_asewkbfunctionst_asewktfunctionst_asgeojsonfunctionst_astextfunctionst_geogfromgeojsonfunctionst_geogfromwkbfunctionst_geogfromwktfunctionst_geomfromewkbfunctionst_geomfromgeojsonfunctionst_geomfromtextfunctionst_geomfromwkbfunctionst_geomfromwktfunctionto_geographyfunctionto_geometryfunctiontry_to_geographyfunctiontry_to_geometryfunction