适用于: Databricks Runtime 17.1 及更高版本
重要
此功能目前以公共预览版提供。
以 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
函数