raster file error

492 views
Skip to first unread message

Caren Dymond

unread,
Mar 13, 2014, 12:08:56 PM3/13/14
to landis-...@googlegroups.com
Hi
Anyone know why I might be getting this error?

2014-03-13 09:01:19,282 - Internal error occurred within the program:
2014-03-13 09:01:19,283 -   Raster band is not byte, short, int, float, double
2014-03-13 09:01:19,284 -
2014-03-13 09:01:19,284 - Stack trace:
2014-03-13 09:01:19,329 -    at Landis.RasterIO.Gdal.GdalInputRaster`1.NewInputBand(Band gdalBand, PixelBand pixelBand)
2014-03-13 09:01:19,282 - Internal error occurred within the program:
2014-03-13 09:01:19,283 -   Raster band is not byte, short, int, float, double
2014-03-13 09:01:19,284 -
2014-03-13 09:01:19,284 - Stack trace:
2014-03-13 09:01:19,329 -    at Landis.RasterIO.Gdal.GdalInputRaster`1.NewInputBand(Band gdalBand, PixelBand pixelBand)

I created the .img file using an Export to ERDAS Imagine in ArcGIS v9.3. I've also tried exporting to .jp2 format and get the same error. I've updated my LANDIS 6 core and extensions. Rasters I made a year ago work fine although apparently I left myself little information on how I created them. Could 32bit have something to do with it?

thanks

Guillaume Sainte-Marie

unread,
Mar 21, 2014, 8:42:57 PM3/21/14
to landis-...@googlegroups.com
Hi Caren,

It seems we all get back to that same error message once in a while... Personally, I solved it by using 16bits signed rasters. This is kind of weird, but I get the same message every time I'm using some other format.

Hope it works out for you as well...

Guillaume

Dominic Cyr

unread,
Mar 22, 2014, 11:46:37 AM3/22/14
to landis-...@googlegroups.com
Hi,
I got this error when encoding in 32 bits unsigned integers, but it works with 32 bits, signed integers, which is a mystery to me, because we don't use negative values... I never bothered to figure this out as I managed to get things workings, but I'd be interested if anyone could clarify this.

James Domingo

unread,
Mar 24, 2014, 12:36:40 PM3/24/14
to landis-...@googlegroups.com
Hi Caren,
 
Could you post more lines from the log (those above the error message)?  They'll provide more context about the error.
 
Thanx,
Jimm
--
James Domingo

Brian Miranda

unread,
Mar 24, 2014, 12:38:40 PM3/24/14
to landis-...@googlegroups.com
I have seen that others encountering this error have had success using a 16-bit signed integer format.  I believe that 32-bit signed integer should work too, but I have seen reports from others that they don't.  So, as long as your values can fit the constraints of 16-bit signed integer (-32768 to 32767) then that seems to be the safest format to use.
 
By the way, can you tell which extension is using the map that is causing your error?  If it's just one extension having this issue there may be a bug to fix there.
 
-Brian

Caren Dymond

unread,
Mar 25, 2014, 10:41:18 AM3/25/14
to landis-...@googlegroups.com
Thanks.

I'm not sure how to tell ArcMap to make a 16-bit signed integer format. It seems to decide for me based on the values in the raster, although that may be part of the problem when I'm using the Copy Raster tool and it's setting the null values to -999. I tried the Data Export this morning with null values set to 0 and got the same error.

 I think I'll try an ASCII grid. The GDAL page says that's an acceptable format. At least I'll be able to see what ESRI's done with the null values.

It's the Forest Carbon Succession module. The ecoregion raster is fine, it's the new initial communities map that is giving me trouble. Therefore I'm assuming a user error.

Caren Dymond

unread,
Mar 25, 2014, 2:32:15 PM3/25/14
to landis-...@googlegroups.com
I found the Export Raster  function in ArcCatalogue that allowed me to set the file type to 32 bit float with null values of 0 but that didn't work either. Used .img.
Exporting the grid to ascii and then replacing the null values of -9999 (in Notepad) with 0 and adding 0 to the initcomm.txt files seems to have worked.

Not exactly elegant. :)

rhodom

unread,
Mar 26, 2014, 9:35:21 AM3/26/14
to landis-...@googlegroups.com
May or may not solve the problem, but in ArcGIS 10.2, use the Data Management Tools>Raster Dataset>Copy Raster dialogue to change the pixel type to 16-bit or 8-bit signed integer format. I generally use 8-bit signed and .IMG format since it supports class values up to 127 (see attached screenshot).
copyraster.png

yan boulanger

unread,
Jun 2, 2014, 11:20:41 AM6/2/14
to landis-...@googlegroups.com
Hi guys,
 
I'm running with similar issues when I tried too load Fire regions from the Base Fire extension. On my side, it says that "Values are too large or too small for a UInt32" (see attached). However, values are between 1 and 4... I tried using either unsigned or signed 8, 16 or 32 bits integers with no luck (either as .img or .tif). All other rasters (ecoregions and initial communities as INT2S, tif format) would load fine. I'm really puzzled ... I'm creating my rasters using the writeRaster function in the raster package in R 3.0
 
Thanks!
Yan
Command Prompt_2014-06-02_11-16-08.jpg

yan boulanger

unread,
Jun 2, 2014, 1:33:38 PM6/2/14
to landis-...@googlegroups.com
Me again,
 
It seems that I found a way to get it work. As proposed by Caren, I saved my rasters (tif format, 16 bit, signed integer) while setting the NA value to 0 using the writeRaster function in R (NAflag = 0).
 
Yan
Reply all
Reply to author
Forward
0 new messages