I've been working on a project. A small part of it is to clip point features by ellipse polygons.
I need to loop through a set of IDs, when I call "clip" function via arcpy, a very strange error persists:
"ERROR 000732: Clip Features: Dataset Ellipse/ellipse_6406685702.0 does not exist or is not supported Failed to execute (Clip)"
the clip function worked fine if only a single ID was used, the error only occurs when it loops through the IDs.
I've checked Esri's help, and tried to appy some fixes, but none of them worked. I'm pretty sure the files such as ellipse_6406685702.0 indeed exist as I can use them one by one, but cannot use them in the batch way. This is the very last step of my project so I really need to get out of it.
Here is the code:
import arcpy
arcpy.env.workspace= "C:/Users/Ran/Desktop/TucsonTravelAnalysis/data/TucsonTravel.gdb"
fc = "All_Locations/Tucson_ppl"
pplWH= []
cursor = arcpy.da.SearchCursor(fc,["ID_individ","TripType"])
for row in cursor:
if row[1]== 2:
pplWH.append(row[0])
pplWH= list(set(pplWH))
for ID in pplWH:
infc = "All_Locations/All_ND_points"
clipfc= "Ellipse/ellipse_{0}".format(ID)
outclipfc= "All_Locations/HW_NDpoints_{0}".format(ID)
arcpy.Clip_analysis(infc, clipfc, outclipfc)