Using ArcPy, is there any way to update the selected records of a feature class' field based on a Selection by Location of another shapefile?

In other words, update a field in a feature class' point based on which polygon it falls into. Of course, this would draw field information from the shapefile that is being used for selection.

  • 2
    There are many ways to accomplish this. What attributes do you need to transfer from the polygons to the points?
    – Aaron
    Commented Jun 28, 2015 at 20:27
  • 1
    At least 3 ways spring to mind, the question that needs to be addressed is 'within', 'containing' or 'close to' and what about duplicates? When considering an overlay operation how do you equate source to destination? What happens when a destination polygon is encountered by multiple source polygons? After you've decided that you can look at how source fields map to destination fields. I would think a cursor/layer/cursor would be the best for this without knowing much about your data but this might be just as easily solved by spatial join. Commented Jun 28, 2015 at 22:11
  • I'm looking to Spatially join points that fall within polygons. The polygons will have city and zip code information and I need to transfer that information over to the points.
    – TacoB0t
    Commented Jun 29, 2015 at 1:01
  • Please edit your question to address any requests for clarifications sought via comments. I offer some advice on how to structure questions to attract answers at meta.gis.stackexchange.com/a/3353
    – PolyGeo
    Commented Jun 29, 2015 at 2:01

2 Answers 2


I answered a question here that is probably similar to what you want (the second part of the answer). Using Spatial Join works also, but it creates another layer which might not be desirable. If you have specific layers/shapefiles, post them in your question and I'll try to create usable code for your particular issue.


Use Spatial Join tool. You can find more about field mapping functionality along with your join in here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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