适用于: Databricks Runtime 17.1 及更高版本
重要
此功能目前以公共预览版提供。
返回输入 GEOGRAPHY
或 GEOMETRY
值的坐标维度。
语法
st_ndims ( geoExpr )
论据
-
geoExpr
:GEOGRAPHY
或GEOMETRY
值。
退货
类型的 INT
值,表示输入 GEOGRAPHY
或 GEOMETRY
值的坐标维度。
如果输入为 NULL
.,则函数返回 NULL
。
例子
-- Returns the number of dimensions of a 2D point geometry.
> SELECT st_ndims(st_geomfromtext('POINT(10 34)'));
2
-- Returns the number of dimensions of a 3D point geometry.
> SELECT st_ndims(st_geomfromgeojson('{"type":"Point","coordinates":[10,34,55]}'));
3
-- Returns the number of dimensions of a 3D point geography.
> SELECT st_ndims(st_geogfromtext('POINT M (10 34 48)'));
3
-- Returns the number of dimensions of a 4D point geography.
> SELECT st_ndims(st_geogfromtext('POINT ZM (10 34 48 -24)'));
4