Skip to main content
Solved

How to snap lines to node depending on attribute?

  • February 27, 2018
  • 3 replies
  • 56 views

Forum|alt.badge.img

Hi, I have a geometric topology with nodes and lines. Some lines have not the right end coordinate and are therefore not "connected" with it's node (shown on the left side). I'm looking for a solution to "snap" somehow the lines to the respective node depending on the line-attribute Node_Reference (shown on the right side). Is there a matching transformer available?

For example: the red node has the attribute Name: ID_1. The blue lines has an attribute Node_Ref: ID_1. I would like to replace the end coordinate of the blue lines (nearest end of the line) by the coordinate of the matching node.

Best answer by david_r

Have a look at the AnchoredSnapper. The anchor feature would be the red dot. Use end point snapping.

Since you seem to have a common ID shared by the red dot and the blue lines, you can use that ID as the Group By attribute, thereby improving the results. You'll ned to rename either Name or Node_Ref, however, so that the Group By attribute has the same name between all the features.

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

3 replies

david_r
Celebrity
  • Best Answer
  • February 27, 2018

Have a look at the AnchoredSnapper. The anchor feature would be the red dot. Use end point snapping.

Since you seem to have a common ID shared by the red dot and the blue lines, you can use that ID as the Group By attribute, thereby improving the results. You'll ned to rename either Name or Node_Ref, however, so that the Group By attribute has the same name between all the features.


Forum|alt.badge.img
  • Author
  • February 28, 2018

How can I avoid that the AnchoredSnapper snapp both sides of the line to the the red node if both ends of the line are within the snapping tolerance (gray circle)?


fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • February 28, 2018
nindalf wrote:

How can I avoid that the AnchoredSnapper snapp both sides of the line to the the red node if both ends of the line are within the snapping tolerance (gray circle)?

Hi @nindalf Use a NeighborFinder to get the coordinate of the red node onto the lines and then change the endpoint of the line with a Snipper and VertexCreator.

 


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