That's a good idea - I probably shouldn't have told the script to print a message if it didn't work. After taking out that part of the code, I found and fixed an error, but I have a new error now that I am trying to loop through multiple storms. I made point feature classes for Katrina and Rita (just as examples) in a gdb and am trying to loop through them to create buffers but I can't because I get an error that the output featureclass already exists:
arcpy.env.workspace = "C:\Users\Patrick\OneDrive\Dissertation\Cyclone GDP\Analysis\GIS\Katrina_ModelBuilder\Katrina_Test.gdb"
...
...
... fc = arcpy.ListFeatureClasses()
...
...
... for fc in fc:
... sr = arcpy.Describe(fc).spatialReference
... Storm_buffs = []
... max = 200
... with arcpy.da.SearchCursor(fc,['SHAPE@','NE_34','SE_34','SW_34','NW_34','NE_50','SE_50','SW_50','NW_50','NE_64','SE_64','SW_64','NW_64'], spatial_reference=sr) as cursor:
... for row in cursor:
... cur = row[0].centroid
... up = arcpy.Point(cur.X,cur.Y+max)
... upright = arcpy.Point(cur.X+max,cur.Y+max)
... right = arcpy.Point(cur.X+max,cur.Y)
... downright = arcpy.Point(cur.X+max,cur.Y-max)
... down = arcpy.Point(cur.X,cur.Y-max)
... downleft = arcpy.Point(cur.X-max,cur.Y-max)
... left = arcpy.Point(cur.X-max,cur.Y)
... upleft = arcpy.Point(cur.X-max,cur.Y+max)
... boxes = {'NE':arcpy.Polygon(arcpy.Array([[cur,up,upright,right]]),sr),
... 'SE':arcpy.Polygon(arcpy.Array([[cur,right,downright,down]]),sr),
... 'SW':arcpy.Polygon(arcpy.Array([[cur,down,downleft,left]]),sr),
... 'NW':arcpy.Polygon(arcpy.Array([[cur,left,upleft,up]]),sr)}
... for field in cursor.fields[1:]:
... cur_buff = row[0].buffer(row[cursor.fields.index(field)])
... clip_buff = boxes[field[:2]].intersect(cur_buff,4)
... len(Storm_buffs)
... Storm_buffs.append(clip_buff)
... arcpy.CopyFeatures_management(Storm_buffs,"C:\Users\Patrick\OneDrive\Dissertation\Cyclone GDP\Analysis\GIS\Katrina_ModelBuilder\Katrina_Test.gdb\Storm")
...
Runtime error Traceback (most recent call last): File "<string>", line 31, in <module> File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 2429, in CopyFeatures raise e ExecuteError: ERROR 000725: Output Feature Class: Dataset C:\Users\Patrick\OneDrive\Dissertation\Cyclone GDP\Analysis\GIS\Katrina_ModelBuilder\Katrina_Test.gdb\Storm already exists.
This error makes sense because in line 31 I just save the buffers with a name that wouldn't changed after the script goes to the next storm. Do you know if it is possible to indicate the name of an output be the same or a variant of the input?
Thanks again for your time,
Pat