Was this helpful?
Locate_Along
LOCATE_ALONG(g Geometry, float f1, float f2);
Alias: ST_LOCATE_ALONG
Returns a point collection of all points in argument g that has an M ordinate equal to f1. Argument g must contain M ordinates. If f2 is non-zero, the result is offset by that value.
The first argument g must be of type PointM, PointZM, MultiPointM, MultiPointZM, LinestringM, LinestringZM, MultiLinestringM, or MultiLinestringZM.
The second argument f1 is the measure M that you are trying to match in argument g. If a geometry without M is passed in g, M is calculated for that argument.
The third argument f2 is how much you want to offset the result geometry from its original value.
Result type: MultiPointM or MultiPointZM if g has a Z ordinate.
Example:
SELECT ASTEXT(LOCATE_ALONG(GEOMMFROMTEXT('LINESTRINGM(0 0 0, 5 5 5, 10 10 10)'), 5, 0));
-------------
col1
-------------
MULTIPOINT M(5 5 5)
-------------
SELECT ASTEXT(LOCATE_ALONG(GEOMMFROMTEXT('MULTILINESTRINGM((2 3 4, 1 4 5, 4 6 6), (5 7 8, 4 6 5, 1 4 2))'), 5, 0));
-------------
col1
-------------
MULTIPOINT M(1 4 5, 4 6 5)
Last modified date: 11/28/2023