ST_CoordDim

更新时间:
复制 MD 格式

Returns the coordinate dimension of a geometry object as an integer.

Syntax

integer ST_CoordDim(geometry geomA);

Parameters

ParameterDescription
geomAThe geometry object.

Usage notes

  • ST_CoordDim is an alias for ST_NDims.

  • Supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.

Examples

2D object

SELECT ST_CoordDim('POINT(1 0)');
 st_coorddim
-------------
           2
(1 row)

3DZ and 3DM objects

SELECT ST_CoordDim('POINT(1 0 1)');
 st_coorddim
-------------
           3
(1 row)

SELECT ST_CoordDim('POINTM(1 0 1)');
 st_coorddim
-------------
           3
(1 row)

4D object

SELECT ST_CoordDim('POINT(1 0 1 1)');
 st_coorddim
-------------
           4
(1 row)