[postgis-users] Break polylines by points

Aitor Gil Martin agmartin at getxo.net
Wed Feb 6 05:07:04 PST 2013


Hi,

 

I've got some problem for achieving what you said.

 

I've got a lot of cases where the linestring is intersected by 2 points. I would need to have 3 linestrings as a result of the split operation and as far as I can understand St_split only cuts a geometry with another geometry.

Maybe I could do it in QGIS or another program?

 

Regards,

Aitor

 

________________________________

De: pcreso at pcreso.com [mailto:pcreso at pcreso.com] 
Enviado el: viernes, 01 de febrero de 2013 21:25
Para: Aitor Gil Martin
Asunto: Re: [postgis-users] Break polylines by points

 


See the example of splitting a Polyline by a point at:
http://postgis.refractions.net/documentation/manual-svn/ST_Split.html

You'll need to decompose the collection (ST_Dump() ) and you can limit the points/lines being split by use a where clause that restricts the result set to lines with points that intersect the line.

Of course, if the point does not lie exactly on the linestring, this will fail, which in many datasets can be quite likely. You can address this, if it is an issue, by generating buffers around the points, selecting the intersection of each linestring with the buffer, then storing the "adjusted" point (valve) location as the midpoint of the linestring intersection. 

If you really wanted a geosynchronous point/line dataset,  assuming the valve point locations are more accurate than the lines, you could then find all those linestring endpoints which are now an adjusted point location, & update each to the original (rather than adjusted) point location. 

Cheers,

  Brent Wood

--- On Sat, 2/2/13, Aitor Gil Martin <agmartin at getxo.net> wrote:


From: Aitor Gil Martin <agmartin at getxo.net>
Subject: [postgis-users] Break polylines by points
To: postgis-users at lists.osgeo.org
Date: Saturday, February 2, 2013, 3:49 AM

Hi all,

I would like to split the polylines (pipes) with the points (valves). If a point intersects a polyline, this polyline should be transformed into two polylines. Both tables have 7000 records aprox.

Regards, 

 

Aitor Gil Martin

Departamento Informática

Getxoko Udala / Ayto Getxo

Tel: 94 466 02 16 Ext.- 3457

www.getxo.net <http://www.getxo.net/> 

agmartin at getxo.net

 


-----Inline Attachment Follows-----

_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130206/2e0855c3/attachment.html>


More information about the postgis-users mailing list