共用方式為


st_ndims函式

適用於:核取標示為是 Databricks SQL 核取標示為是 Databricks Runtime 17.1 和更新版本

Important

這項功能目前處於 公開預覽版

備註

這項功能不適用於 Databricks SQL Classic 倉儲。 若要深入瞭解 Databricks SQL 倉儲,請參閱 SQL 倉儲類型

傳回輸入 GEOGRAPHYGEOMETRY 值的座標維度。

Syntax

st_ndims ( geoExpr )

Arguments

  • geoExpr: GEOGRAPHYGEOMETRY 值。

Returns

類型的 INT值,表示輸入 GEOGRAPHYGEOMETRY 值的座標維度。

如果輸入為 NULL,則函式會傳NULL回 。

Examples

-- 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