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.

| improve this question | | | | |

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.

| improve this answer | | | | |

You could use IProximityOperator::QueryNearestPoint and construct a line from the point returned and the point in your feature class.

| improve this answer | | | | |
  • 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! – Justin Zimmerman Oct 11 '11 at 20:59
  • 1
    Ah, 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. – Jason Scheirer Oct 11 '11 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.