Solved! Go to Solution.
try: import arcpy, os arcpy.env.workspace = "G:/PhD/ERA 40/WorkPython/join" targetFeatures = "G:/PhD/ERA 40/WorkPython/target/Alaska_20111229_geog_glaciers.shp" outDirectory = "G:/PhD/ERA 40/WorkPython/Output" #take all shapefiles from .../join folder which name contains "small" at the end fcList = arcpy.ListFeatureClasses("*small") #for each "small" feature class perform spatial join for featureClass in fcList: outFeatureClass = os.path.join(outDirectory, featureClass) arcpy.SpatialJoin_analysis(targetFeatures, featureClass, outFeatureClass) except: print arcpy.GetMessages()
tags around selected text
try: import arcpy, os arcpy.env.workspace = "G:/PhD/ERA 40/WorkPython/join" targetFeatures = "G:/PhD/ERA 40/WorkPython/target/Alaska_20111229_geog_glaciers.shp" outDirectory = "G:/PhD/ERA 40/WorkPython/Output" #take all shapefiles from .../join folder which name contains "small" at the end fcList = arcpy.ListFeatureClasses("*small") #for each "small" feature class perform spatial join for featureClass in fcList: outFeatureClass = os.path.join(outDirectory, featureClass) arcpy.SpatialJoin_analysis(targetFeatures, featureClass, outFeatureClass) except: print arcpy.GetMessages()
tags around selected text