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