AnsweredAssumed Answered

Python code to find nearest features.

Question asked by symology_epn on Aug 2, 2012
Latest reply on Aug 6, 2012 by bharold-esristaff
I am looking at replicating some of our c# ArcObjects code into python to create a 10.0 ArcGIS Server geoprocessing tasks and wonder if the following is possible.

Without using the near_analysis tool as it requires ArcInfo/Advanced level licensing and adds fields onto the table being searched.

1)  From a specified point find all the features in a feature class that are within a specified distance of that point. I.e. use the buffer and clip analysis tools. The features being searched for can be point, line or polygon.
2) Iterate through each of the features that fall within the buffer created from the input point and work out the minimum distance of the feature from the point. Not too difficult if the feature class being searched is a point, but more difficult for lines and polygons, unless there is a handy arcpy function I have not come across?
3) I can then easily sort them in python into distance sequence.

The above is not too difficult using ArcObjects but with the move to python I cannot seem to find the same type of functionality in the arcpy module.

Thanks,
Richard

Outcomes