Skip to main content

st_geogfromwkb function

Applies to: check marked yes Databricks SQL check marked yes 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 WKB, description of a geography and returns the corresponding GEOGRAPHY value. The SRID value of the returned GEOGRAPHY value is 4326.

Syntax

st_geogfromwkb ( wkbExpr )

Arguments

  • wkbExpr: A BINARY value, representing a geography in WKB format.

Returns

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

The function returns NULL if the input is NULL.

Error conditions

Examples

SQL
-- The input WKB is in little-endian format.
> SELECT st_astext(st_geogfromtext(X'01D1070000000000000000244000000000000041400000000000003740'));
POINT M (10 34 23)

-- The input WKB is in big-endian format.
> SELECT st_astext(st_geogfromtext(X'00000007D1402400000000000040410000000000004037000000000000'));
POINT M (10 34 23)