ST_Zmflag

更新时间:
复制 MD 格式

Returns a smallint indicating the coordinate dimensionality of a geometry object: 2D, 3DM, 3DZ, or 4D.

Syntax

smallint ST_Zmflag(geometry geomA);

Parameters

ParameterDescription
geomAThe geometry object to inspect.

Return values

ValueCoordinate type
02D
13DM
23DZ
34D

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)