[Gdal-dev] Implementing GDALRasterBand::IRasterIO

Frank Warmerdam warmerdam at pobox.com
Thu Jan 15 18:09:22 EST 2004


James Gallagher wrote:
> Frank, et al.,
> 
> I'm busy implementing IRasterIO() and I'd like to know the best way to
> test my (at this point partial) implementation. I have a little test
> program that does:
> 
>     int nXSize = poBand->GetXSize();
>     int nYSize = poBand->GetYSize();
>  
>     float *pafData = (float *) CPLMalloc(sizeof(float)*nXSize*nYSize);
>     poBand->RasterIO(GF_Read, 0, 0, nXSize, nYSize,
>                      pafData, nXSize, nYSize, GDT_Float32,
>                      0, 0);
>  
> But I was wondering if one of the programs in apps was more of an
> 'official' test program for a new driver.

James,

There is no real equivelent to ogrsf_frmts for GDAL drivers.  There
are some standard tests that can be applied against different drivers
from the python level in the gdalautotest tree.  For example, see
gdalautotest/gcore/hfa_read.py as an example.

However, it might be worthwhile to have something like this more
generally.  I will see if Andrey could spend some time on it.

> A few misc. questions: Are band numbers indexed using a ones-based
> scheme? How about the n{X,Y}Offset parameters? From the docs it looks
> like ban numbers *do* use ones-based indexing, but I want to be sure.
> Same for the offsets.

Bands are 1 based.

X/Y offsets are zero based.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list