Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

ST_NDims

Introduction: Returns the coordinate dimension of the geometry.

Format: ST_NDims(geom: Geometry)

Since: v1.3.1

Spark SQL example with z coordinate:

SELECT ST_NDims(ST_GeomFromEWKT('POINT(1 1 2)'))

Output:

3

Spark SQL example with x,y coordinate:

SELECT ST_NDims(ST_GeomFromText('POINT(1 1)'))

Output:

2