[GRASSLIST:6437] Re: Weird behavior (GDAL???)

Hamish hamish_nospam at yahoo.com
Tue Apr 12 22:35:40 EDT 2005


> So I exported some rasters using r.out.bin and, under grass 5.7 (macos
> x fink install) the outputs were fine, but with grass 6.0 + gdal 1.2.6
> I'm now getting outputs which, while visually ok, are coming out as
> gargantuan numbers instead of smaller decimals...  Thoughts?


Sounds very much like a big/little endian problem..

try using the '-s' flag with r.out.bin.


There is some C code for translating in raster/r.out.bin/tif_swab.c
if you want to try and convert manually.


or if you have access to Matlab, you can just do

fp1= fopen('file.bin','r','ieee-be');

where 'ieee-be' can be:

ieee-be     for big endian
ieee-le     for little endian
ieee-be.l64 for big-endian 64-bit long data type
ieee-le.l64 for little endian 64-bit long data type
 (+ more options in the fopen help page)


try playing around with the different types until you find the correct
one; it should be one of the above.


If it ends up being GRASS not exporting correctly, please let us know.
Should we issue a "Exporting in big-endian format" message?



Hamish




More information about the grass-user mailing list