Returns the M coordinate of a point geometry.
Syntax
float ST_M(geometry aPoint)Parameters
| Parameter | Description |
|---|---|
aPoint | The input point geometry. Must be a point type. |
Description
ST_M returns the M coordinate of a point geometry.
The M coordinate is a user-defined measure value associated with each vertex of a geometry. It is commonly used to store attributes such as distance along a route or a timestamp. M is distinct from X (longitude), Y (latitude), and Z (altitude).
This function supports 3D geometries and does not drop Z coordinates.
Examples
The following example extracts the M coordinate from a point defined using the POINTM WKT format, where the third value is the M coordinate.
SELECT ST_M('POINTM(0 1 2)'::geometry);
st_m
------
2
(1 row)What's next
该文章对您有帮助吗?