st_geogfromewkt function

Applies to: check marked yes Databricks Runtime 18.0 and above

Important

This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Azure Databricks previews.

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: A STRING value, 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 ewktExpr is 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)