I'm trying to use the spatial join to append rows to my target feature from my join feature. Here's my code:
#import the module import arcpy from arcpy.sa import * from arcpy import env env.overwriteOutput = True #set the workspace arcpy.env.workspace = r"C:\Users\Windows\Documents\JO_GIS_Analyst" #Adding the municipality to the attribute table for fc in arcpy.ListFeatureClasses("reclassnofptphil_onlyreprojected_2014121_geog*"): print fc #checking of feature classes outputFeature = "withjoin" + fc # specify output feature arcpy.SpatialJoin_analysis(fc, "PHL_adm2_UTM.shp", outputFeature) print "Finish"
I'm getting an error of:
Traceback (most recent call last): File "C:\Users\Windows\Dropbox\Python Scripts\batch_convert_raster_to_polygon.py", line 71, in <module> arcpy.SpatialJoin_analysis(fc, "PHL_adm2_UTM.shp", outputFeature) File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\analysis.py", line 481, in SpatialJoin raise e ExecuteError: ERROR 999999: Error executing function. Item not found in this collection. Failed to execute (SpatialJoin).
Here is the ouput of the print statement:
Actually I'm doing a loop for six files only, since I'm just using my sample files to test my code.