[gdal-dev] strange 'Access window out of range in RasterIO()' error

Volker Wichmann Volker.Wichmann at uibk.ac.at
Wed Dec 12 09:27:11 EST 2007


Hi,

I discovered a strange effect while creating and writing out a tiff - I 
get an 'out of range' error although I'm sure to write within limits: 
The error message is:

ERROR 5: Access window out of range in RasterIO().  Requested (0,81) of 
size 100x81 on raster of 100x100.

Even the values reported by the message suggest I'm within the limits. 
This error only happens with a specific raster extent. In detail:

- I create a dataset with
    upper left coordinates: 10, 10
    number of cells in x/y: 100, 100
    cellsize: 1

- I use GDALGetBlockSize to set the blocksize and

- write with GDALRasterIO(hBand, GF_Write, nXOffset, nYOffset, 
nBlockXSize, nBlockYSize, pData, nBlockXSize, nBlockYSize, eOutputType, 
0, 0);


The error only happens with this dataset definition, using an other 
number of cells in x/y works. I'm also able to write the above dataset 
by setting nBlockXSize and nBlockYSize by hand to other values (e.g. 
100, 20). Seems to me there is an issue in the function checking the 
range allowed for writing.

I'm using GDAL 1.4.2,
thanks,
Volker



More information about the gdal-dev mailing list