I have 31 rasters that represent different watersheds and I would like to use the Fill (Spatial Analysis) tool to fill the sinks of all rasters at once in Python. All the rasters have the same name followed by a number (0-30).
Here is my code so far:
Import arcpy
From arcpy import env
From arcpy.sa import *
Arcpy.env.workspace = (r“Workspace\Path”)
For I in range (31):
outFill = Fill(“raster_name”+str(i)+“.tif”)
outFill.save (“Workspace\Path”)
So far this code only fills sinks of the raster_name0 and does not put it in the folder location I specify. Any ideas on how to modify this code to work on all 31 rasters and save them in a specficed location?
I have ArcGIS 10.1 with an advanced arcinfo license.