AnsweredAssumed Answered

Unable to save 3 dimensional array as stacked raster .img file in arcpy, RuntimeError: ERROR 010240

Question asked by bharanigurminder on Jun 26, 2016
Latest reply on Feb 16, 2018 by Dan_Patterson

Unable to save a 3 dimensional array to stacked raster .img file.

I have this array:

arr.shape (10, 148, 160) 

Now when I try to save this into raster .img format:

out_ras = arcpy.NumPyArrayToRaster(arr)"C:\Users\Gurminder\Documents\study\IWMI\HomeTools\Dump\Converted_arr\stack.img")

I get the following error:

Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> RuntimeError: 
ERROR 010240: Could not save raster dataset to C:\Users\Gurminder\Documents\study\IWMI\HomeTools\Dump\
Converted_arr\stack.img with output format IMAGINE Image.

Although a file named stack.img is created in the given directory but all it contains is garbage values.

I have been facing this issue since I have upgraded from ArcMap 10.3 to 10.4, before upgrade everything was working just fine.