ST_M

Determine the m (measure) coordinate of a point geometry, or sets the m coordinate to a particular value.

Syntax

ST_M(pgeo);
ST_M(pgeo, m);
pgeo
The input point geometry.

Type: VARCHAR(ANY)

m
The value to which the m coordinate of the input point geometry is to be set. If NULL is specified, the m value is removed from the point.

Type: DOUBLE

Returns

The value that is returned depends on whether an m value is specified:
  • If an m value is not specified, a value of type DOUBLE that indicates the m coordinate of the input point geometry.
  • If an m value is specified, a value of type VARCHAR(100) that contains the input point geometry with the newly set m coordinate.

Examples

SELECT inza..ST_M(inza..ST_Point(0.0, 1.0, 2.0, 3.0));

ST_M
------
3
(1 row)
SELECT inza..ST_M(inza..ST_Point(0.0, 1.0, 2.0, false)); 
ST_M
------
2
(1 row)

SELECT inza..ST_AsText(inza..ST_M(inza..ST_WKTTOSQL('POINT (0.0 1.0)'), 5.0));
 
ST_ASTEXT
---------
POINT M (0 1 5)