[GRASS5] rasters?

Glynn Clements glynn at gclements.plus.com
Sun Mar 19 16:02:21 EST 2006


Andrea Antonello wrote:

> Some lines to clarify (for me mostly):
> The first byte of a raster file cast to a number (between 0 and 255) contains 
> the number of bytes that can be used to store the row addresses in the header 
> and therefore it also is the limit for raster size, right?

Correct.

> > However, this version shrank the row pointers to 4 bytes if the file
> > size was <4Gb (i.e. in most cases).
> 
> Alright. Which would look like the proper behaviour to me...

Except that we don't know how large the file will eventually be when
the offset table is first written out.

> > This didn't work, as it would shrink the pointers when the file was
> > empty, then enlarge them again if the file was >=4Gb when it was
> > closed, overwriting the beginning of the data.
> 
> Alright, I understand what happens, but does this mean that that byte is now 
> always set to 8 is the LFS is enabled?

It is always set to sizeof(off_t), whatever that happens to be.

The code which reads and writes the row pointers is entirely generic;
if you had a platform with a 7-byte off_t, it would work. Similarly,
you can read maps with 8-byte row pointers on a system where
sizeof(off_t) is 4, provided that the file doesn't actually exceed
2Gb.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list