ST_LocateBetween

Name

ST_LocateBetween — Return a derived geometry collection value with elements that match the specified range of measures inclusively.

Synopsis

geometry ST_LocateBetween ( geometry geom , float8 measure_start , float8 measure_end , float8 offset ) ;

Description

Return a derived geometry collection with elements that match the specified range of measures inclusively.

Clipping a non-convex POLYGON may produce invalid geometry.

If an offset is provided, the resultant will be offset to the left or right of the input line by the specified number of units. A positive offset will be to the left, and a negative one to the right.

Semantic is specified by: ISO/IEC CD 13249-3:200x(E) - Text for Continuation CD Editing Meeting

Availability: 1.1.0 by old name ST_Locate_Between_Measures.

Changed: 2.0.0 - in prior versions this used to be called ST_Locate_Between_Measures.

Enhanced: 3.0.0 - added support for POLYGON, TIN, TRIANGLE.

This function supports M coordinates.

Examples

SELECT ST_AsText(the_geom)
FROM (
    SELECT ST_LocateBetween(
       'MULTILINESTRING M ((1 2 3, 3 4 2, 9 4 3),(1 2 3, 5 4 5))'),
       1.5,
       3
    ) as the_geom
) As foo;

							 st_asewkt
------------------------------------------------------------------------
 GEOMETRYCOLLECTION M (LINESTRING M (1 2 3,3 4 2,9 4 3),POINT M (1 2 3))

--Geometry collections are difficult animals so dump them
--to make them more digestable
SELECT ST_AsText((ST_Dump(the_geom)).geom)
FROM (
    SELECT ST_LocateBetween(
	'MULTILINESTRING M ((1 2 3, 3 4 2, 9 4 3),(1 2 3, 5 4 5))'),
	1.5,
	3
    ) As the_geom
) As foo;

		   st_asewkt
--------------------------------
 LINESTRING M (1 2 3,3 4 2,9 4 3)
 POINT M (1 2 3)