Example Script to calcuate nearest point distances

312
2
01-28-2021 12:11 PM
PaulMarano
New Contributor II

Hello....I am a newbie to ArcGIS API for Python.  I would like to write a script a that queries a feature layer to find the 8 closets points from a given location and output the results as a json object.  Does anyone have any references or sample scripts they could point my way to start me on my journey?  Your input is much appreciated. 

0 Kudos
2 Replies
BlakeTerhune
MVP Regular Contributor

Check out Generate Near Table. You can specify the closest_count parameter to how many results you want; 8 in your case.

by Anonymous User
Not applicable

For the second part of the process,  you can probably join that table back onto the features and then use Features To Json to create your Json object.

FeaturesToJson