跳转至
Apache Sedona 1.9.0 已正式发布,新增 Spark 4.1 支持、proj4sedona 坐标系转换、Bing Tile 函数等众多特性!

ST_CoordDim

Introduction: Returns the coordinate dimensions of the geometry. It is an alias of ST_NDims.

ST_CoordDim

Format: ST_CoordDim(geom: Geometry)

Return type: Integer

Since: v1.5.0

Example with x, y, z coordinate:

SELECT ST_CoordDim(ST_GeomFromText('POINT(1 1 2'))

Output:

3

Example with x, y coordinate:

SELECT ST_CoordDim(ST_GeomFromWKT('POINT(3 7)'))

Output:

2