Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

Thank you for any help.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
add comment

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

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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