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 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: ABINARYvalue, 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
- If the value of
wkbExpris an invalid WKB, the function returns WKB_PARSE_ERROR.
Examples
-- 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)
Related functions
st_asbinaryfunctionst_asewkbfunctionst_asewktfunctionst_asgeojsonfunctionst_astextfunctionst_geogfromgeojsonfunctionst_geogfromtextfunctionst_geomfromewkbfunctionst_geomfromgeojsonfunctionst_geomfromtextfunctionst_geomfromwkbfunctionto_geographyfunctionto_geometryfunctiontry_to_geographyfunctiontry_to_geometryfunction