#974 closed defect (invalid)

Union of Polylines results in additional segments

Reported by: jerryfaust Owned by: geos-devel@…
Priority: minor Milestone:
Component: Default Version: 3.4.2
Severity: Unassigned Keywords: UNION UNARYUNION



Hopefully I'm overlooking something simple. I am selecting a group of roads. I want to Union and Buffer them in order to search within the resulting polygon.

However, when I get back the union, there are additional line segments that did not exist in the original set.

I've tried individually Union'ing them, I've tried UnaryUnion? of a multi-part polyline (MultiLineString?). I've also clipper calls. And I always get a similar result.

I've tried reording the lines as I union them so that each union operation always involves line segments that touch eachother.

I'm hoping that there is something that I'm simply overlooking, or not understanding, or not using properly.

I'm attaching a snapshot of the circle used to 'select' the streets. I'm expecting a result something like a '#' sign, or tic-tac-toe. But I get additional diagonal lines in the result set.

Thank you for any feedback.

Regards. Jerry.

Attachments (2)

Circular Container.PNG (9.0 KB) - added by jerryfaust 16 months ago.
Unioned Streets.PNG (22.4 KB) - added by jerryfaust 16 months ago.

Download all attachments as: .zip

Change History (6)

Changed 16 months ago by jerryfaust

Attachment: Circular Container.PNG added

Changed 16 months ago by jerryfaust

Attachment: Unioned Streets.PNG added

comment:1 Changed 16 months ago by komzpa


Can you share a snippet of code how you do it? (Coming from PostGIS land this looks like ST_MakeLine GEOS analogue used instead of ST_Union)

I haven't seen this behavior accessing GEOS via PostGIS.

comment:2 Changed 16 months ago by mdavis

this seems like a straightforward case for unioning lines, so it's very unlikely the problem is in GEOS. It's more likely to be caused by how GEOS is called. This has the appearance of a situation where the client code is providing the lines as a single list of coordinates, rather than a set of individual linestrings.

If possible please post a code snippet or even better a self-contained unit test showing the behaviour.

comment:3 Changed 16 months ago by jerryfaust

Thank you for the feedback.

I walked through the process again and found MY error. During one of the steps in my process, while reprojecting the points of the multi-part line, I lost the 'Parts', so it became an oddly connected single linestring.

Thanks again.

comment:4 Changed 16 months ago by komzpa

Resolution: invalid
Status: newclosed

Thanks for the update. Have a good day.

Note: See TracTickets for help on using tickets.