Skip to main content
Question

snapping line end vertex to nearest point

  • July 17, 2015
  • 6 replies
  • 157 views

Hello

 

 

I have a number of connectors which touch a main line but do not split it.  I want to be able to select the connectors that are not currently attached to a node and snap their vertex to the closest node point as shown by red dashed lines.  I assume I have to form a relationship between the connectors and the main line and then the main line and the node points?  Or can it just be undertaken using X,Y co-ordinates and proximity.

 

 

Any help greatly appreciated.

 

 

 

 

 
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

david_r
Celebrity
  • 8391 replies
  • July 17, 2015
Hi

 

 

A couple of suggestions:

 

 

1) Use the AnchoredSnapper with a high tolerance and the nodes as anchors, with snapping type set to endpoint snapping.

 

 

2) You can use the TopologyBuilder to find lines that aren't connected to a node on both ends, check the attributes _from_node and _to_node. Then use a NeighborFinder to find the closest node. The coordinates of the closes node will be available in _closest_candidate_x and _closest_candidate_y.

 

 

David

cnero101
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 9 replies
  • November 29, 2022
Hi

 

 

A couple of suggestions:

 

 

1) Use the AnchoredSnapper with a high tolerance and the nodes as anchors, with snapping type set to endpoint snapping.

 

 

2) You can use the TopologyBuilder to find lines that aren't connected to a node on both ends, check the attributes _from_node and _to_node. Then use a NeighborFinder to find the closest node. The coordinates of the closes node will be available in _closest_candidate_x and _closest_candidate_y.

 

 

David

Hi David, I am having some issues with this snapping

 


Forum|alt.badge.img+2
  • 1891 replies
  • November 29, 2022

@tt​ if you can include a small sample dataset then community members can experiment with your data.


cnero101
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 9 replies
  • December 1, 2022

@tt​ if you can include a small sample dataset then community members can experiment with your data.

I would like to know when you are online so that we can a real time chat on this

 


cnero101
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 9 replies
  • December 1, 2022
Hi

 

 

A couple of suggestions:

 

 

1) Use the AnchoredSnapper with a high tolerance and the nodes as anchors, with snapping type set to endpoint snapping.

 

 

2) You can use the TopologyBuilder to find lines that aren't connected to a node on both ends, check the attributes _from_node and _to_node. Then use a NeighborFinder to find the closest node. The coordinates of the closes node will be available in _closest_candidate_x and _closest_candidate_y.

 

 

David

I would love to know more about this as I have a similar situation right now and I am having some difficulties


cnero101
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 9 replies
  • December 1, 2022

@tt​ if you can include a small sample dataset then community members can experiment with your data.

In my own case I have points and lines, I want to snap the lines to the points, both edges, ends and sides. I tried using the snapper and also tried using the anchored snapper, but still don't get to snap some. I have used intersector, it does the major part of the snapping but creates new points at any intersection without a point. I really would love to do this snapping based on relationship (attribute)