[GRASSLIST:8088] Re: error reading large rasters in 5.4/6.0

Glynn Clements glynn at gclements.plus.com
Fri Aug 26 20:17:54 EDT 2005


Markus Neteler wrote:

> > > I think the problem is a bug in writing rasters, not reading them. When
> > > creating a new raster, it writes a vector of row offsets to the fcell
> > > file in the function G__write_row_ptrs. It attempts to guess the size of
> > > the file offsets. 
> > > 
> > >  int nbytes = sizeof(off_t);
> > > ...
> > >  if (nbytes > 4 && fcb->row_ptr[nrows] <= 0xffffffff)
> > >     nbytes = 4;
> > > ...
> > >  len = (nrows + 1) * nbytes + 1;
> > >  b = buf = G_malloc(len);
> > > 
> ...
> > > Should I submit a bug report?
> > 
> > No need; I've comitted the fix to CVS.
> > 
> ...
> 
> I have fixed that in the 6.0-release branch as well 
> for a potential 6.0.2 (even if LFS is not well developed in 6.0.x).

Apart from LFS support, it's still useful for systems where
sizeof(long) == 8, where there shouldn't be any problems with files
larger than 2GiB or maps with more than 2^31 cells.

The problems all stem from trying to deal with more bytes or more
cells than will fit into a "long".

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




More information about the grass-user mailing list