[postgis-users] get segment of multiline between two points

Andrea Peri aperi2007 at gmail.com
Sat Sep 11 09:30:43 PDT 2010


>Thanks, I tried this function, but it returns all points and I need only that
>are inside a segment between two points.

>ie:

>MULTILINESTRING((0 0,1 1,1 2,2 3,3 2,5 4))
>POINT(1 1) POINT(3 2)
>
>I want LINESTRING(1 1,1 2,2 3,3 2)

Perhaps something like this is like for you.

ST_Line_Substring(geometry_line,ST_Line_Locate_Point(geometry_line,geometryPoint_start),ST_Line_Locate_Point(geometry_line,geometryPoint_end))

where

geometryPoint_start = ST_GeomFromText('POINT(1,1)');
geometryPoint_end = ST_GeomFromText('POINT(3,2)');


-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100911/c3ceae4d/attachment.html>


More information about the postgis-users mailing list