[GRASS-user] ERROR: Bytes do not match file size with r.in.bin (but file size is correct!!)

Dear list members,

I get this error while running the following command:

r.in.bin -f input=inputfile.bin output=outputmap bytes=4 n=51:05:20.4N s=41:21:50.4N w=5:08:31.2W e=9:33:36E r=19450 c=29404 anull=-9999.0 --overwrite

The file inputfile.bin is a binary grid written by a fortran program, with real*4 values. When I run the command I get the following error message:

WARNING: File Size -2007336096 … Total Bytes 2287631200

ERROR: Bytes do not match file size

256

Note the minus sign in front of the first value given for the files size in the warning message. Important to notice also that when I do an ls –l on the binary input file I get the correct size (19450x29404x4):

-rw-rw-r-- 1 user group 2287631200 May 7 15:05 inputfile.bin

Any suggestion on the origin of this error? Is there any limit on the file size for importing binaries into GRASS? I am able to run exactly the same code on another region (which implies that the inputfile.bin is smaller 1.9GB vs the 2.2GB for this one) so I’m wondering if it’s a metter of size and if there is any workaround.

Thanks in advance for whatever assistance you might provide.

Ludovico

On Tue, May 7, 2013 at 6:23 PM, Ludovico Nicotina
<Ludovico.Nicotina@rms.com> wrote:

Dear list members,

I get this error while running the following command:

r.in.bin -f input=inputfile.bin output=outputmap bytes=4 n=51:05:20.4N
s=41:21:50.4N w=5:08:31.2W e=9:33:36E r=19450 c=29404 anull=-9999.0
--overwrite

The file inputfile.bin is a binary grid written by a fortran program, with
real*4 values. When I run the command I get the following error message:

WARNING: File Size -2007336096 ... Total Bytes 2287631200

I guess you hit the file size barrier on a 32bit system:

2^31
[1] 2147483648

you:
     2287631200 which is more.

...

Any suggestion on the origin of this error?

Please tell us
- which GRASS GIS version
- which operating system
- was large file support compiled into GRASS GIS if not on 64bit

Then it may be easier to suggest a solution.

Please note:
http://grasswiki.osgeo.org/wiki/GRASS_GIS_Performance#Large_raster_data_processing

Markus