Returns a smallint indicating the coordinate dimensionality of a geometry object: 2D, 3DM, 3DZ, or 4D.
Syntax
smallint ST_Zmflag(geometry geomA);Parameters
| Parameter | Description |
|---|---|
geomA | The geometry object to inspect. |
Return values
| Value | Coordinate type |
|---|---|
0 | 2D |
1 | 3DM |
2 | 3DZ |
3 | 4D |
Usage notes
Supports 3D objects. Z coordinates are preserved and not dropped.
Supports circular strings and curves.
Examples
The following query returns the ZM flag for four geometry types:
SELECT ST_Zmflag('POINT(0 1)'::geometry) AS _2D,
ST_Zmflag('POINTM(0 1 2)'::geometry) AS _3DM,
ST_Zmflag('POINT(0 1 2)'::geometry) AS _3DZ,
ST_Zmflag('POINT(0 1 2 3)'::geometry) AS _4D;Output:
_2d | _3dm | _3dz | _4d
-----+------+------+-----
0 | 1 | 2 | 3
(1 row)该文章对您有帮助吗?