[GRASS5] rasters?

Glynn Clements glynn at gclements.plus.com
Tue Mar 14 03:50:49 EST 2006


Andrea Antonello wrote:

> > I can only think of two changes:
> >
> > 1. For compressed maps (integer or FP), the size of the row offsets is
> > sizeof(off_t) rather than sizeof(long). The main consequence of this
> > is that 8-byte offsets will now be more common, so if your code only
> > handles 4-byte offsets, it will fail more often.
> 
> I'm not completely sure but it should be that, which should again be easy to 
> solve (hopefully). I will check and in case come back with new questions.
> 
> Do you know when more or less sizeof(long) was changed.

The initial change was:

	revision 1.4
	date: 2004/08/12 13:53:51;  author: glynn;  state: Exp;  lines: +97 -77
	Raster I/O cleanup
	Use off_t instead of long, to allow for files >2Gb

However, this version shrank the row pointers to 4 bytes if the file
size was <4Gb (i.e. in most cases).

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.

That was changed in:

	revision 2.1
	date: 2005/08/23 21:23:08;  author: glynn;  state: Exp;  lines: +0 -3
	Fix bug where row pointers were enlarged to 8 bytes, overwriting the
	beginning of the data (discovered by Andrew Danner).

Since then, the row pointers have always been sizeof(off_t). On x86,
this will be either 4 or 8 bytes depending upon whether the
--enable-largefile option was passed to the configure script.

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




More information about the grass-dev mailing list