All Products
Search
Document Center

ApsaraDB RDS:ST_LocateBetween

Last Updated:Mar 28, 2026

Returns the elements of a geometry whose m coordinates fall within the specified range.

Syntax

geometry ST_LocateBetween(geometry geomA, float8 measureStart, float8 measureEnd, float8 offset);

Parameters

ParameterDescription
geomAThe input geometry.
measureStartThe minimum m coordinate that is allowed.
measureEndThe maximum m coordinate that is allowed.
offsetThe offset that is applied during the computation.

Usage notes

  • Polygon geometries are not supported.

  • When offset is specified, the result is shifted laterally along the input line by that many units. A positive value shifts left; a negative value shifts right.

Examples

Return the points with m coordinates between 3 and 6:

SELECT ST_AsText(ST_LocateBetween(ST_GeomFromText('MultiPointM((1 2 3),(4 5 6),(7 8 9))'),3,6));

Output:

         st_astext
----------------------------
 MULTIPOINT M (1 2 3,4 5 6)
(1 row)