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.
Returns the input GEOMETRY value in Extended WKB (EWKB) format using the specified endianness, if provided.
If the endianness is not specified, the returned value is little-endian encoded.
Syntax
st_asewkb ( geoExpr[, endiannessExpr] )
Arguments
geoExpr: AGEOMETRYvalue.endiannessExpr: An optionalSTRINGvalue, representing the endianness of the output WKB,'NDR'for little-endian (default) or'XDR'for big-endian.
Returns
A value of type BINARY.
The returned value is the Extended WKB (EWKB) description of the input GEOMETRY value using the specified endianness, if provided.
If the endianness is not specified, the returned value is little-endian encoded.
The function returns NULL if any of the inputs is NULL.
Examples
-- Export a 3DZ Cartesian point with SRID 4326 in EWKB format (default endianness).
> SELECT hex(st_asewkt(st_geomfromtext('POINT Z (1 2 100)', 4326)));
01010000A0E6100000000000000000F03F00000000000000400000000000005940
-- Export a 3DZ Cartesian point with SRID 4326 in big-endianness EWKB format.
> SELECT hex(st_asewkt(st_geomfromtext('POINT Z (1 2 100)', 4326), 'XDR'));
00A0000001000010E63FF000000000000040000000000000004059000000000000
Related functions
st_asbinaryfunctionst_asgeojsonfunctionst_asewktfunctionst_aswkbfunctionst_aswktfunctionst_geogfromgeojsonfunctionst_geogfromtextfunctionst_geogfromwkbfunctionst_geogfromwktfunctionst_geomfromewkbfunctionst_geomfromgeojsonfunctionst_geomfromtextfunctionst_geomfromwkbfunctionst_geomfromwktfunctionto_geographyfunctionto_geometryfunctiontry_to_geographyfunctiontry_to_geometryfunction