Skip to main content
Solved

Snap line to line


I would like to snap the blue line to the red line. End goal is to merge attributes. I tried using AnchoredSnapper, the problem is that as you can see in some cases especially where the line bends lines can be closer to the 'wrong' red line.

Any advice would be greatly appreciated.

Best answer by redgeographics

You can set a Group By in the AnchoredSnapper so if there's a common attribute in both sets you would be able to use that but other than that I'm afraid you're running into the limitations of automatic snapping.

Thinking out loud, you could use an AzimuthCalculator to grab the direction of the lines and then a AttributeRangeMapper to condense that down to workable values for that AnchoredSnapper's Group By, that would probably work on the straight lines but not on the curves.

Simple fact is that you look at the curves on the lower right the blue one is too close to the wrong red one and I don't think there's anything you can do about that automatically.

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

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+49
  • Celebrity
  • Best Answer
  • May 24, 2017

You can set a Group By in the AnchoredSnapper so if there's a common attribute in both sets you would be able to use that but other than that I'm afraid you're running into the limitations of automatic snapping.

Thinking out loud, you could use an AzimuthCalculator to grab the direction of the lines and then a AttributeRangeMapper to condense that down to workable values for that AnchoredSnapper's Group By, that would probably work on the straight lines but not on the curves.

Simple fact is that you look at the curves on the lower right the blue one is too close to the wrong red one and I don't think there's anything you can do about that automatically.


jneujens
Forum|alt.badge.img
  • May 24, 2017

To elaborate on redgeographics idea, an automatic process will always have its problems, indeed.

 

 

Another way might be to create displacement vectors between many points from the blue to the red line. Then use these vectors in a rubber sheeter transformer. But again, you will always have errors at specific situations...

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • May 24, 2017

you can filter the blue lines to separate the polylines after generalizing them (separate the straight lines).

Then use a arcestimator on the polylines.

Then relate/snap/intersect the estimated arcs grouped by fme_type.

Retrieve (either by featuremerging or previously having extract the geometry) the original lines and then snap using fme_type as group by.


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