Name

ST_ZmFlag — Returns a code that represents the number of coordinated dimensions of a Geometry.

Synopsis

integer ST_ZmFlag(bytea Geometry);

Alias

ZmFlag

Description

Returns a code that represents the number of coordinated dimensions of a Geometry. Code values are 0=2d, 1=3dm, 2=3dz, 3=4d.

[Note]

Jaspa transforms a XYM geometry to a XYZM geometry with Z=0. Therefore, this fuction will never return 1. With a XYM Geometry, Jaspa would return 3, whereas Postgis would return 1.

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006))SQL-MM Part 3
----

Examples

SELECT ST_ZmFlag(ST_GeomFromText('POINT(4 8)'));
--Result
0

SELECT ST_ZmFlag(ST_GeomFromText('LINESTRINGM (0 0 -5, 10 10 -8, 20 10 -10)'));
--Result
3

SELECT ST_ZmFlag(ST_GeomFromText('POINT(4 8 7)'));
--Result
2

SELECT ST_ZmFlag(ST_GeomFromEWKT('POINT(2 5 0 -8)'));
--Result
3

Related functions

ST_CoordDim, ST_CoordDim