My script fails while trying to save the results of a Cut Fill operation. It works when the cellsize of the input raster is 2 but doesn’t work when it is 1. Then I’m getting the error message:
FATAL ERROR (ICLOSE)
Attempting to close channel 1, which isn't open.
It does save the results but under a different name then I have defined in the script (CutFill_DEM1.tif instead of WaterArea.tif). Even with the try loop it will stop the script stops. The cellsize of the DEM ist 1 as well.
Relevant part of the script:
WaterArea = os.path.normpath(os.path.join(path2, "WasserArea"))
cellSize = 1
arcpy.env.cellSize = cellSize
arcpy.env.snapRaster = DEM
arcpy.ddd.TinRaster(TIN, WaterRaster, "FLOAT", "LINEAR", "CELLSIZE " + cellSize, "")
CutFill = CutFill(DEM, WaterRaster, 1)
try:
CutFill.save(WaterArea)
except:
print "Error saving result CutFill"
Anyone know why this error occurs and how to solve/work around it?
cellSizeto text, i.e.cellSize = "1".