Name

ST_SetStartM — Sets the M coordinate of the first point of a LineString, CircularLineString, or NURBSCurve.

Synopsis

geometry ST_SetStartM(geometry geom, float8 m);

Description

Returns a copy of the input LINESTRING, CIRCULARLINESTRING, or NURBSCURVE geometry with the M coordinate of the first point set to the specified value. If the input geometry does not have an M dimension, it will be added. Returns NULL if the input is not a LINESTRING, CIRCULARLINESTRING, or NURBSCURVE.

Cette méthode prend en charge les types Circular String et Curve.

Exemples

Set start M value of a LineString

SELECT ST_AsText(ST_SetStartM('LINESTRING M(0 0 10, 1 1 20, 2 0 30)'::geometry, 100));
        st_astext
------------------------
 LINESTRING M (0 0 100,1 1 20,2 0 30)

Add M dimension and set start M value

SELECT ST_AsText(ST_SetStartM('LINESTRING(0 0, 1 1, 2 0)'::geometry, 50));
        st_astext
------------------------
 LINESTRING M (0 0 50,1 1 0,2 0 0)

Set start M value of a CircularString

SELECT ST_AsText(ST_SetStartM('CIRCULARSTRING M(0 0 5, 1 1 10, 2 0 15)'::geometry, 99));
        st_astext
------------------------
 CIRCULARSTRING M (0 0 99,1 1 10,2 0 15)

Set start M value of a NURBSCurve

SELECT ST_AsText(ST_SetStartM('NURBSCURVE M(2, (0 0 100, 1 1 200, 2 0 300))'::geometry, 500));
        st_astext
------------------------
 NURBSCURVE M (2,(0 0 500,1 1 200,2 0 300))