Name

ST_StartM — Returns the M coordinate of the first point of a LineString, CircularLineString, or NURBSCurve.

Synopsis

float8 ST_StartM(geometry geom);

Description

Returns the M coordinate of the first point of a LINESTRING, CIRCULARLINESTRING, or NURBSCURVE geometry. Returns NULL if the input geometry does not have an M dimension or is not a LINESTRING, CIRCULARLINESTRING, or NURBSCURVE.

This method supports Circular Strings and Curves.

Examples

Start M value of a LineString

Code
SELECT ST_StartM('LINESTRING M(0 0 10,1 1 20,2 0 30)'::geometry);
Output
10
Figure
Geometry figure for visual-st-startm-01

Start M value of a CircularString

Code
SELECT ST_StartM('CIRCULARSTRING M(0 0 5,1 1 10,2 0 15)'::geometry);
Output
5
Figure
Geometry figure for visual-st-startm-02

Start M value of a NURBSCurve

Code
SELECT ST_StartM('NURBSCURVE M(2, (0 0 100, 1 1 200, 2 0 300))'::geometry);
Output
100
Figure
Geometry figure for visual-st-startm-03

Geometry without M dimension returns NULL

Code
SELECT ST_StartM('LINESTRING(0 0,1 1)'::geometry) IS NULL AS is_null;
Output
t
Figure
Geometry figure for visual-st-startm-04