适用于:
Databricks SQL
Databricks Runtime 17.1 及更高版本
Important
此功能目前以公共预览版提供。
注释
此功能在 Databricks SQL 经典仓库上不可用。 若要详细了解 Databricks SQL 仓库,请参阅 SQL 仓库类型。
返回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
相关函数
-
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函数