1

I'm a new Python student looking for some help regarding a homework problem. I need to analyze wells with each county in a state. So I have the wells shapefile and a counties shapefile for a state. Not sure how to combine the data so I have a list of wells in each county.

I thought I'd use following:

arcpy.MakeFeatureLayer_management("wells", "wells_lyr")
arcpy.SelectLayerByLocation_management("wells_lyr", "INTERSECT", "counties", "", "NEW_SELECTION")

But this does not give me the wells in each county. Hope this is not too vague; not looking for exact code, just the high level process.

4

The "Select Layer by Location" tool will select all wells in the existing layer that intersect any county. You're on the right track with the "intersect" operation: you'll find that you get the results you want by using the actual "Intersect" tool, which will create a new output feature class that contains attributes from both of the overlapping input features.

  • Perfect! I knew I was missing something simple. – BillTheCat Feb 4 '16 at 17:11

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.