0

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?

4
  • Try setting cellSize to text, i.e. cellSize = "1". Commented Jul 1, 2024 at 13:11
  • Unfortunatly that didn’t change anything and wouldn’t explain why cellsizes 0,5; 1,1 and 2 work but cellsize 1 and 1,0 did not. Commented Jul 1, 2024 at 13:44
  • Maybe this? Commented Jul 1, 2024 at 14:56
  • 1
    Thanks for the help. Adding the file format .tif to the end of the output file path solved the issue Commented Jul 2, 2024 at 9:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.