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.
1 Answer 1
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– BillTheCat2016年02月04日 17:11:10 +00:00Commented Feb 4, 2016 at 17:11