Skip to main content
Solved

Snap line to line

  • May 24, 2017
  • 3 replies
  • 417 views

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.

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.

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • 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
  • 189 replies
  • 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
  • 2252 replies
  • 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.