适用于:
Databricks SQL
Databricks Runtime 17.1 及更高版本
重要
此功能目前以公共预览版提供。
注释
此功能在 Databricks SQL 经典仓库上不可用。 若要详细了解 Databricks SQL 仓库,请参阅 SQL 仓库类型。
以 GeoJSON 格式返回输入 GEOGRAPHY 或 GEOMETRY 值。
语法
st_asgeojson ( geoExpr )
论据
-
geoExpr:GEOGRAPHY或GEOMETRY值。
退货
一个 STRING 类型的值。
返回的值是输入 GEOGRAPHY 或 GEOMETRY 值的 GeoJSON 说明。
如果输入为 NULL.,则函数返回 NULL 。
例子
-- Export a 3DZ Cartesian point, given in WKT format, in GeoJSON format.
> SELECT st_asgeojson(to_geometry('POINT Z (2.718281828 3.141592653 100)'));
{"type":"Point","coordinates":[2.718281828,3.141592653,100]}
-- Export a 3DZ geographic point, given in WKT format, in GeoJSON format.
> SELECT st_asgeojson(to_geography('POINT Z (2.718281828 3.141592653 100)'));
{"type":"Point","coordinates":[2.718281828,3.141592653,100]}
相关函数
-
st_asbinary函数 -
st_asewkb函数 -
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函数