ST_CoordDim
Returns the coordinate dimension of a meshgeom or sfmesh object.
Syntax
int2 ST_CoordDim(meshgeom geom);
int2 ST_CoordDim(sfmesh sfmeshObject);
Parameters
| Parameter | Type | Description |
| geom | meshgeom | The meshgeom object. |
| sfmeshObject | sfmesh | The sfmesh object. |
Description
ST_CoordDim returns the number of coordinate dimensions of a meshgeom or sfmesh object as an int2 value. A 3D object with X, Y, and Z coordinates returns 3.
Example
The following example queries the coordinate dimension of a 3D meshgeom object. Each vertex in the geometry has three coordinates (X, Y, Z), so the function returns 3.
SELECT ST_CoordDim('MESHGEOM(PATCH(INDEXSURFACE(VERTEX(0 0 2,0 10 3,10 10 1,10 0 1), INDEX((0,1,2),(1,2,3)))))'::meshgeom);
Output:
-------------
3