共用方式為

st_ndims 函数

适用于:已勾选“是”的 Databricks Runtime 17.1 及更高版本

重要

此功能目前以公共预览版提供。

返回输入 GEOGRAPHYGEOMETRY 值的坐标维度。

语法

st_ndims ( geoExpr )

论据

  • geoExprGEOGRAPHYGEOMETRY值。

退货

类型的 INT值,表示输入 GEOGRAPHYGEOMETRY 值的坐标维度。

如果输入为 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