Skip to content
πŸŽ‰ SedonaDB 0.4.0 is out now! πŸ—ΊοΈ Python DataFrame API, R dplyr, Geography support & GPU-accelerated spatial joins. Read the release blog β†’

ST_NDims

Introduction: Returns the coordinate dimension of the geometry.

ST_NDims

Format: ST_NDims(geom: geometry)

Return type: Integer

SQL example with z coordinate:

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

Output: 3

SQL example with x,y coordinate:

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

Output: 2