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 Runtime 18.0 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 an Extended Well-Known Text (EWKT) description of a geometry and returns the corresponding GEOGRAPHY value. Only SRID 4326 is supported.
Syntax
st_geogfromewkt ( ewktExpr )
Arguments
ewktExpr: ASTRINGvalue, representing a geography in Extended WKT (EWKT) format.
Returns
GEOGRAPHY(ANY) value representing the parsed Extended WKT (EWKT) geometry. The SRID of the returned GEOGRAPHY value is 4326.
The function returns NULL if any of the inputs is NULL.
Error conditions
- If the value of
ewktExpris an invalid Extended WKT (EWKT) description, the function returns EWKT_PARSE_ERROR.
Examples
-- Simple example where the input geography is provided in EWKT format.
> SELECT concat_ws(';', st_srid(g)::STRING, st_astext(g)) FROM (SELECT st_geogfromewkt('SRID=4326;POINT Z (1 2 3)') AS g);
4326;POINT Z (1 2 3)
Related functions
st_asbinaryfunctionst_asewkbfunctionst_asewktfunctionst_asgeojsonfunctionst_astextfunctionst_geogfromgeojsonfunctionst_geogfromtextfunctionst_geogfromwkbfunctionst_geogfromwktfunctionst_geomfromewkbfunctionst_geomfromewktfunctionst_geomfromgeojsonfunctionst_geomfromtextfunctionst_geomfromwkbfunctionst_geomfromwktfunctionto_geographyfunctionto_geometryfunctiontry_to_geographyfunctiontry_to_geometryfunction