[GRASSLIST:4568] Re: different CELL integer types?

William K woklist at charter.net
Mon Oct 18 19:00:40 EDT 2004


A little more info:

> I've been importing a bunch of SRTM data recently and noticed that 
> there seems to be (at least) 2 different integer cell types - 16 bit 
> and 32 bit.  As imported, one tile takes up a maximum of 2.7MB in the 
> CELL file, same as the source SRTM data file, and in the GRASS header 
> file it's type is 1.

I mean, the 'format:' line in the header file.

> After I run it thru fillnulls, I round that back to integers with 
> r.mapcalc, and the CELL file sizes double, and the GRASS header has a 
> type of 3.
>
At least many end up like this.  I looked closer at a few, and it seems 
that all the tiles with some negative values switch to the larger 
integer size.  If the whole tile is positive, it stays as 16 bit.  Are 
grass 16 bit ints not signed, so grass has to use 32 bit ints?  I can 
mapcalc them to be all positive and they do switch back to 16 bit (or 8 
bit for those low, flat tiles).

Also, with a script importing a bunch and doing fillnulls I only 
remember how the first couple I looked at imported - as 16 bit, I guess 
I got lucky on those because tiles with negative cells really do import 
as 32 bit.

> So, is there a way to get these back to the 16 bit cell types?  Since 
> these are meter elevations on the earth, I'm not worried about them 
> ever going beyond +/-32767.  Normally I wouldn't worry about it, but 
> I've converted many GB of these SRTM tiles now and saving a few GB 
> would be nice.

-----
William Kyngesburye <kyngchaos at charter.net>
http://webpages.charter.net/kyngchaos/

"I ache, therefore I am.  Or in my case - I am, therefore I ache."

- Marvin




More information about the grass-user mailing list