Skip to main content
Solved

Creating a line between two nearest points

  • April 26, 2018
  • 6 replies
  • 471 views

joshuadamron
Contributor
Forum|alt.badge.img+8

I've searched for a solution to this but none of the other posts seem to provide the minor detail I'm missing.

My goal: I need to find the distance "as the crow flies" between street intersection points (point geometry features).

What I have: Street Intersection points feature set with a unique ID field populated for each point.

 

What I've done: [1a] NeighborFinder (Street Intersection points as both the Base & Candidate inputs) [1b] Vertex Creator using the Nearest neighbor output ( Mode= Add Point ; _closest_candidate_x & _closest_candidate_y)

 

 

[2] LineBuilder (inputs are the original Street Intersection points and the Vertex Creators output points) grouping on the unique ID field. However this process does not output any lines. What am I missing?

Best answer by erik_jan

Step 1b should create a line between the point and its nearest neighbor (point a, adding point b creates a line)..

You should not need step 2.

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

bruceharold
Supporter
Forum|alt.badge.img+19
  • Supporter
  • April 26, 2018

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • Best Answer
  • April 26, 2018

Step 1b should create a line between the point and its nearest neighbor (point a, adding point b creates a line)..

You should not need step 2.


erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • April 26, 2018

Step 1b should create a line between the point and its nearest neighbor (point a, adding point b creates a line)..

You should not need step 2.

On second thought, the closest neighbor for a point (if all points are fed as base and candidate) is the point itself. Therefor it will not create a line.

 

You will need to find the closest 2 points and use a list.

 

The connect the _list{1}._closest_candidate_x and _list{1}._closest_candidate_y in the VertexCreator.

 

 


erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • April 26, 2018

Step 1b should create a line between the point and its nearest neighbor (point a, adding point b creates a line)..

You should not need step 2.

See this image

 

 


fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • April 26, 2018
@joshuadamron

 

To get the distance, use a LengthCalculator after the VertexCreator


joshuadamron
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • April 30, 2018

Step 1b should create a line between the point and its nearest neighbor (point a, adding point b creates a line)..

You should not need step 2.

 

Thanks, you nailed it, connecting the right list outputs in the VertexCreator was my glitch. I dropped step 2.