[postgis-users] breake lines

paul.malm at lfv.se paul.malm at lfv.se
Fri Sep 6 05:39:43 PDT 2019


Thanks Lars, I will have this in mind, but for now I would like to learn SQL and will take a look at Topology later on.
Kind regards,
Paul

Från: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] För Lars Aksel Opsahl
Skickat: den 6 september 2019 14:31
Till: postgis-users at lists.osgeo.org
Ämne: Re: [postgis-users] breake lines

Hi

Another option to handle merging off different simple feature datasets into a single dataset can be Postgis Topology.

What we basically do is that we pipe the datasets into Postgis Topology which solves the problems related to breaking up lines and snap to.

Then we take the data out as simple Feature from Postgis Topology and the users can continue to work on a nice a clean simple feature dataset.

We have done this for datasets containing millions of points and it works quite nice..

Lars

________________________________
From: postgis-users <postgis-users-bounces at lists.osgeo.org> on behalf of paul.malm at lfv.se <paul.malm at lfv.se>
Sent: Wednesday, September 4, 2019 1:53 PM
To: postgis-users at lists.osgeo.org <postgis-users at lists.osgeo.org>
Subject: Re: [postgis-users] breake lines


Hi,

If I understand your question correct, yes I would like to break all lines in the intersections with another layer.

No I have not tried MultiLinestrings comprised of all lines that are intersecting the lines to be broken. Don't know how to do this. :(



This is how far I have come:



CREATE TABLE splittedlayer3

AS SELECT ST_CollectionExtract(ST_Split(o.the_geom, c.the_geom),2) as the_geom

FROM "orgLayer" o, "cutLayer" c WHERE ST_Intersects(o.the_geom, c.the_geom)



But this gives duplicate line segments when intersecting the cutting lines twice.

/Paul



Från: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] För Martin Davis
Skickat: den 3 september 2019 19:18
Till: PostGIS Users Discussion
Ämne: Re: [postgis-users] breake lines



Have you tried using ST_Split passing each input line and for the second argument a MultiLineString comprised of all lines that it might intersect (obtained via BBOX or ST_Intersects query)?  It seems like that should not create any duplicate linework from the input line.



As far as I know there's no other way to do this using current PostGIS functions.   It's an interesting requirement - it sounds like essentially you want to node one layer against another.  There's actually the machinery to do this internally in PostGIS/GEOS, but it's never come up as a requirement before, so has not been exposed as a function.



What is your use case?



On Tue, Sep 3, 2019 at 9:48 AM <paul.malm at lfv.se<mailto:paul.malm at lfv.se>> wrote:

If I split lines with another line layer, I will get a lot of duplicaded line segments since the lines could be intersected several times. It is not possible to use update on the table when splitting one geomety to two.
I think it must be possible, but I'm not that skilled in SQL and I've not found any examples on the net.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190906/8cbf490a/attachment.html>


More information about the postgis-users mailing list