I am new to building custom ArcObjects, and am looking for a custom python script for arcgis version 10 that will loop through a point shapefile to find the nearest line segment of a line shapefile (or multiple if possible) and add the 'NAME' attribute from the line shapefile to a new 'STREET' attribute in the point shapefile.
2 Answers
You should use the Near command. It will create a Near_FID field which is the FID of the nearest Line Feature. Just join on this and you should be able to Calc your points with the closest Line Name. Should be a short script.
You could use IProximityOperator::QueryNearestPoint and construct a line from the point returned and the point in your feature class.
-
I am no neccesarily interested in the location of the nearest line, as much as the attribute information located in that line segment. If any automation is possible that would be great, as I have about 1000 control points to go through. Thank you! Commented Oct 11, 2011 at 20:59
-
1Ah, then the near tool would work for you, then write a Python script or add a join to line up the data from one feature class to the other. Commented Oct 11, 2011 at 21:27