This topic describes the ST_CoordDim function. This function returns the coordinate dimension of a geometry object.

Syntax

integer  ST_CoordDim(geometry  geomA);

Parameters

Parameter Description
geomA The geometry object that you want to specify.

Description

  • The ST_CoordDim function is the alias of the ST_NDims function.
  • This function supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.

Examples

  • Execute the following statement to return a 2D object:
    SELECT ST_CoordDim('POINT(1 0)');
     st_coorddim
    -------------
               2
    (1 row)
                        
  • Execute the following statement to return a 3DM or 3DZ object:
    SELECT ST_CoordDim('POINT(1 0 1)');
     st_coorddim
    -------------
               3
    (1 row)
    
    SELECT ST_CoordDim('POINTM(1 0 1)');
     st_coorddim
    -------------
               3
    (1 row)
                        
  • Execute the following statement to return a 4D object:
    SELECT ST_CoordDim('POINT(1 0 1 1)');
     st_coorddim
    -------------
               4
    (1 row)