Skip to main content
Solved

How to merge line segments?

  • November 27, 2017
  • 6 replies
  • 383 views

Forum|alt.badge.img

I have this topology and would like to merge the red segment with its corresponding blue segments. (Blue segments are on both side of the red segment.) I can group all red and all blue segments but I haven’t an attribute to group the related blue and red segments. Is there a way to do this with FME? Thank you for the help.

Best answer by takashi

Hi @nindalf, if red line and blue line which should be connected are definitely touching each other at their end nodes, this workflow might help you. Assuming that the blue lines have unique ID attribute. If they don't have unique ID, you can add temporary ID to them with the Counter.

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.

6 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • November 27, 2017

I believe the LineCombiner transformer should be able to help.


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • November 27, 2017

I believe the LineCombiner transformer should be able to help.

I agree with you !

 

 


Forum|alt.badge.img
  • Author
  • 23 replies
  • November 28, 2017

Ok, this is a good start but I’ve the problem that this transformer connects also segments within the red and the blue group. But it should connect just a red segment with segments form the blue group. Is there a way to specify this?


takashi
Celebrity
  • 7843 replies
  • Best Answer
  • November 28, 2017

Hi @nindalf, if red line and blue line which should be connected are definitely touching each other at their end nodes, this workflow might help you. Assuming that the blue lines have unique ID attribute. If they don't have unique ID, you can add temporary ID to them with the Counter.


takashi
Celebrity
  • 7843 replies
  • November 28, 2017

Hi @nindalf, if red line and blue line which should be connected are definitely touching each other at their end nodes, this workflow might help you. Assuming that the blue lines have unique ID attribute. If they don't have unique ID, you can add temporary ID to them with the Counter.

Forgot to add an annotation about this parameter the SpatialFilter.

 

  • Spatial Predicates to Test: Filter Touches Candidate

 


Forum|alt.badge.img
  • Author
  • 23 replies
  • November 28, 2017

Thank you for the example. It seems to work like this.