Skip to main content
Solved

How to merge line segments?

  • November 27, 2017
  • 6 replies
  • 342 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.

View original
Did this help you find an answer to your question?

6 replies

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • November 27, 2017

I believe the LineCombiner transformer should be able to help.


danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • November 27, 2017
erik_jan wrote:

I believe the LineCombiner transformer should be able to help.

I agree with you !

 

 


Forum|alt.badge.img
  • Author
  • 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
Influencer
  • 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
Influencer
  • November 28, 2017
takashi wrote:

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
  • November 28, 2017

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings