ST_NDims — Retorna a dimensão da coordenada do valor ST_Geometry.
integer ST_NDims(
geometry g1)
;
Retorna a dimensão coordenada da geometria. O PostGIS suporta 2 - (x,y) , 3 - (x,y,z) ou 2D com medida - x,y,m, e 4 - 3D com espaço de medida x,y,z,m
This function supports 3d and will not drop the z-index.
SELECT ST_NDims(ST_GeomFromText('POINT(1 1)')) As d2point, ST_NDims(ST_GeomFromEWKT('POINT(1 1 2)')) As d3point, ST_NDims(ST_GeomFromEWKT('POINTM(1 1 0.5)')) As d2pointm; d2point | d3point | d2pointm ---------+---------+---------- 2 | 3 | 3