Name

ST_HasM — Checks if a geometry has an M (measure) dimension.

Synopsis

boolean ST_HasM(geometry geom);

Description

Checks if the input geometry has an M (measure) dimension and returns a boolean value. If the geometry has an M dimension, it returns true; otherwise, it returns false.

Geometry objects with an M dimension typically represent measurements or additional data associated with spatial features.

This function is useful for determining if a geometry includes measure information.

Availability: 3.5.0

This function supports 3d and will not drop the z-index.

This function supports M coordinates.

Examples

SELECT ST_HasM(ST_GeomFromText('POINTM(1 2 3)'));
 --result
 true
SELECT ST_HasM(ST_GeomFromText('LINESTRING(0 0, 1 1)'));
 --result
 false

See Also

ST_Zmflag

ST_HasZ