[postgis-users] Extracting a line from multilinestring

Peck, Brian brian.peck at lmco.com
Wed Aug 15 16:33:25 PDT 2007


Hey all,

 

Does anyone if there is a way to extract a line from a MultiLineString?

 

I am trying to make the call

 

SELECT
line_interpolate_point(the_geom,line_locate_point(the_geom,PointFromText
('POINT(-74.5 40)'))) FROM roads ORDER BY
Distance(the_geom,PointFromText('POINT(-74.5 40)')) LIMIT 1

 

But I get the error

 

ERROR:  line_locate_point: 1st arg isn't a line

 

My 'the_geom' field is filed with MultiLineString data (though only
LineString in each one).

 

Ex: 

 

select AsText(the_geom) from roads limit 1;

 

                                          astext

------------------------------------------------------------------------
------------------

 MULTILINESTRING((-74.4595680236816 40.0301723480225,-74.4591522216797
40.0302429199219))

(1 row)

 

- Brian Peck

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070815/706c92fc/attachment.html>


More information about the postgis-users mailing list