All Products
Search
Document Center

ApsaraDB RDS:ST_M

Last Updated:Mar 28, 2026

Returns the M coordinate of a point geometry.

Syntax

float ST_M(geometry aPoint)

Parameters

ParameterDescription
aPointThe 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

  • ST_X: Returns the X coordinate of a point geometry.

  • ST_Y: Returns the Y coordinate of a point geometry.

  • ST_Z: Returns the Z coordinate of a point geometry.