适用于: Databricks Runtime 17.1 及更高版本
Important
此功能目前以公共预览版提供。
返回GEOGRAPHY
或GEOMETRY
值的WKB格式,使用指定的字节序(如果提供)。
如果未指定字节序,则返回的值是小端编码值。
Syntax
st_asbinary ( geoExpr[, endiannessExpr] )
Arguments
-
geoExpr
:GEOGRAPHY
或GEOMETRY
值。 -
endiannessExpr
:一个可选的STRING
值,表示输出 WKB 的字节序,默认是'NDR'
表示小端序或'XDR'
表示大端序。
Returns
一个 BINARY
类型的值。
返回的值是使用指定的字节序(如果提供)的输入 GEOGRAPHY
或 GEOMETRY
值的 WKB 描述。
如果未指定字节序,则返回的值是小端编码值。
如果任何输入为NULL
,该函数将返回NULL
。
Examples
-- Export a 3DZ Cartesian point in WKB format (default endianness).
> SELECT hex(st_asbinary(st_geomfromtext('POINT Z (1 2 100)')))
01E9030000000000000000F03F00000000000000400000000000005940
-- Export a 3DZ geographic point in big -endianness WKB format.
> SELECT hex(st_asbinary(st_geogfromtext('POINT Z (1 2 100)'), 'XDR'))
00000003E93FF000000000000040000000000000004059000000000000
Related functions
-
st_asewkb
函数 -
st_asgeojson
函数 -
st_asewkt
函数 -
st_astext
函数 -
st_aswkb
函数 -
st_aswkt
函数 -
st_geogfromgeojson
函数 -
st_geogfromtext
函数 -
st_geogfromwkb
函数 -
st_geogfromwkt
函数 -
st_geomfromewkb
函数 -
st_geomfromgeojson
函数 -
st_geomfromtext
函数 -
st_geomfromwkb
函数 -
st_geomfromwkt
函数 -
to_geography
函数 -
to_geometry
函数 -
try_to_geography
函数 -
try_to_geometry
函数