Skip to main content
Solved

Combine overlapping/touching lines into one long simple geometric line

  • May 17, 2019
  • 12 replies
  • 475 views

arthy
Contributor
Forum|alt.badge.img+8
  • Contributor
  • 101 replies

Hello,

I would like to combine any overlapping/touching lines into one long simple geometric line.

So far, what I could obtained is an aggregated geometry doing this

  • Intersector
  • NetworkTopologyCalculator
  • Aggregator

AFter this task, I would like to extract the starting and ending vertices of the resulting lines and it fail when I used the VertexRemover because the resulting geometry is a multiple geometry (multicurve).

Any ideas?

Best answer by jdh

Using the Snapper in Segment Mode should help with that.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

12 replies

jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • May 17, 2019

Why not just use a LineCombiner?


david_r
Celebrity
  • 8394 replies
  • May 17, 2019

The problem is that the Aggregator doesn't join the line segments, it only groups them together in an aggregate (multi-part) geometry.

I agree with @jdh concerning the LineCombiner, however it may be a problem when you have several segments that aren't connected in a very simple, single line (e.g. intersections, junctions, etc)


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 101 replies
  • May 17, 2019

Why not just use a LineCombiner?

@jdh, I tried but I can't have the expected results.

As @david_r already pointed out, I have several cases where the lines are not connected.

For instance, if I have the lines AB and CD that overlapping on the CB, how should I proceed to obtain a simple geometric line AD?

 


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • Best Answer
  • May 17, 2019

Using the Snapper in Segment Mode should help with that.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • May 17, 2019

@jdh, I tried but I can't have the expected results.

As @david_r already pointed out, I have several cases where the lines are not connected.

For instance, if I have the lines AB and CD that overlapping on the CB, how should I proceed to obtain a simple geometric line AD?

 

Using the Snapper in Segment Mode should help with that.


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 101 replies
  • May 17, 2019

Using the Snapper in Segment Mode should help with that.

The overlapping distance could be very big or very small and the issue that I have with the snapper is to define the snapping distance so that it could automatically merge the lines AB, CD into AD.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • May 17, 2019

The overlapping distance could be very big or very small and the issue that I have with the snapper is to define the snapping distance so that it could automatically merge the lines AB, CD into AD.

In segment mode, it's not the distance between vertex B and Vertex C, it's the the distance of vertex B to any point along the segment CD and vice versa.

 

 

You would end up with line ACB and line CBD, which would have an overlap of CB.

 

As long as the LineCombiner in in Vertex Noded rather than End node, that is not a problem.

arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 101 replies
  • May 17, 2019

In segment mode, it's not the distance between vertex B and Vertex C, it's the the distance of vertex B to any point along the segment CD and vice versa.

 

 

You would end up with line ACB and line CBD, which would have an overlap of CB.

 

As long as the LineCombiner in in Vertex Noded rather than End node, that is not a problem.

Thanks @jdh.

 

To ensure that the line will be merged, I added a densifier before using the snapper.

arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 101 replies
  • May 17, 2019

Thanks @jdh.

 

To ensure that the line will be merged, I added a densifier before using the snapper.

@jdh

A through analysis of the results shows that there are some cases where overlapping lines were not merged.


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • May 17, 2019

@jdh

A through analysis of the results shows that there are some cases where overlapping lines were not merged.

Without having a sample of the problem geometry, it will be hard to troubleshoot.


david_r
Celebrity
  • 8394 replies
  • May 20, 2019

The overlapping distance could be very big or very small and the issue that I have with the snapper is to define the snapping distance so that it could automatically merge the lines AB, CD into AD.

If you have a common attribute on the lines to join, you should use it as a Group By on the Snapper, that way you should have no false joins.


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 101 replies
  • May 20, 2019

If you have a common attribute on the lines to join, you should use it as a Group By on the Snapper, that way you should have no false joins.

@david_r

Unfortunately, there is not a common attribute on the lines to be joined.

They have to be joined based only when one touches/overlaps another.