Select to view content in your preferred language

Error 010240 - Could not save raster dataset...

24285
20
02-27-2017 05:47 AM
NeilAyres
MVP Alum

I am trying to do some raster processing in python.

As this will become a geoprocessing service eventually, I am using env.scratchGDB for storage.

There are several links to this error in Geonet & GIS SE, but I am still stumped.

I have also followed advice from Curtis Curtis Price to also set env.workspace = env.scratchGDB to save on copying time.

This bit works :

rasBase = "rasBase" + DateTimeStamp
rasBaseTmp = arcpy.sa.CreateConstantRaster(benchElev, "FLOAT", rasCellSize)
rasBaseTmp.save(rasBase)

But a few lines on I try to do a con on a difference raster...

rasAboveTmp = Con(arcpy.Raster(rasDiff) > 0, 1)
rasAbove = "rasAbove" + DateTimeStamp
rasAboveTmp.save(rasAbove)

Which gets me this mysterious error:

Traceback (most recent call last):
 File "C:\Data\Dev\Sprint4\Scripts\Tool_270217.py", line 222, in <module>
 rasAboveTmp.save(rasAbove)
RuntimeError: ERROR 010240: Could not save raster dataset to C:\Users\nayre\OneDrive\Documents\ArcGIS\scratch.gdb\rasAbove_270217_1524 with output format FGDBR.

Most of the posts refer to trying to save a grid format raster with a filename > 10(?) characters.

But this is a raster going into the scratch fgdb?

Anybody got an idea?

ArcGIS 10.4.1, Win10 64bit

20 Replies
AndreasLorentzen
New Contributor III

I got this problem myself, tried everything except numpy, and it dident work.

What did solve it was to not use the arcpy.Rename_management() function on an input dateset.

So, it seems like the arcpy.Rename_management() function might create some memory/ scratch workspace errors that causes this problem. Not sure why, but this might hep someone later.

I solved it by simply re-allocated the variable instead of renaming it...

0 Kudos