I'm very new to python, but I'm having trouble finding the answer on my own.
I need to loop through a given file geodatabase, select any features that intersect a project polygon and then search the selection for specific information.
Broadly, how does one create feature layers for all the feature classes in a feature dataset and then pass those layers onto select by location?
My code so far ...
import arcpy import csv arcpy.env.overwriteOutput = True arcpy.env.workspace = "C:\\Users\\Katherine.idea-PC\\Desktop\\FinalProject\\Water.gdb\\WaterDistribution" featureClassList = arcpy.ListFeatureClasses() projectArea = "C:\\Users\\Katherine.idea-PC\\Desktop\\FinalProject\\ProjectArea.shp" outputCSV = "C:\\Users\Katherine.idea-PC\\Desktop\\Final Project\\Output.csv" for featureClass in featureClassList: arcpy.MakeFeatureLayer_management(fc, fc+"_lyr") arcpy.SelectLayerByLocation_management (fc + "_lyr", "WITHIN", projectArea)