How to find the 2 or 3 nearest points

356
4
Jump to solution
04-19-2024 10:59 AM
SanchezNuñez
Occasional Contributor

Good afternoon,

I am looking for a way to find the 2 or the nearest facilities from a point.

Is there a way to get more than one candidate using arcpy.analysis.Near?

Regards

 

0 Kudos
3 Solutions

Accepted Solutions
BlakeTerhune
MVP Regular Contributor

Try Generate Near Table and specify the closest_count parameter as 2

View solution in original post

0 Kudos
Dale_Honeycutt
Occasional Contributor II

Check outGenerate origin destination links 

It may fit your use case - it creates a ‘spider diagram’

View solution in original post

SanchezNuñez
Occasional Contributor

Thank you @BlakeTerhune   and @Dale_Honeycutt  for your answers.

 

 

View solution in original post

0 Kudos
4 Replies
Tom_Laue
New Contributor III

Never tried to do this but thinking in my head...

Using a Loop...

  • Do a near analysis and get the OID of the nearest feature.
  • Then make a feature layer but def query to display all features EXCEPT the OID returned
  • Run Near Analysis again against the queried feature layer to get the 2nd closest feature
0 Kudos
BlakeTerhune
MVP Regular Contributor

Try Generate Near Table and specify the closest_count parameter as 2

0 Kudos
Dale_Honeycutt
Occasional Contributor II

Check outGenerate origin destination links 

It may fit your use case - it creates a ‘spider diagram’

SanchezNuñez
Occasional Contributor

Thank you @BlakeTerhune   and @Dale_Honeycutt  for your answers.

 

 

0 Kudos