st_geogfromwkb
function
Applies to: Databricks SQL
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
: ABINARY
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
- If the value of
wkbExpr
is an invalid WKB, the function returns WKB_PARSE_ERROR.
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)
Related functions
st_asbinary
functionst_asewkb
functionst_asewkt
functionst_asgeojson
functionst_astext
functionst_geogfromgeojson
functionst_geogfromtext
functionst_geomfromewkb
functionst_geomfromgeojson
functionst_geomfromtext
functionst_geomfromwkb
functionto_geography
functionto_geometry
functiontry_to_geography
functiontry_to_geometry
function