[gdal-dev] IReadBlock() and number of bands

Frank Warmerdam warmerdam at p...
Sat Apr 27 10:58:14 EDT 2002


Andrey Kiselev wrote:
> Frank,
> 
> Am I understand correctly that IReadBlock() called for every image band
> separately? So if a have nBands pixel interleaved in the input block
> (scanline) one will be read nBands times? It is quite ineffective...

Andrey,

IReadBlock() is called separately for each raster band. If you have a
pixel interleaved file, and use a simplistic mechanism to access the
band data, reloading the pixel interleaved data for each bands request,
the overhead is substantial. In fact, this is exactly what the Raw dataset
code does for the pixel intereaved case, and it does result in substantial
overhead.

However, when implementing a pixel interleaved format it is possible to
internally have the dataset load the pixel interleaved scanline and then
band pull out the data of interest to avoid multiple loads. This pushes
the responsibility for managing the data access into the driver but I it
need not have a substantial effect on efficiency.

In fact I would like to rework the Rawdataset handling somewhat to more
efficiently handle pixel interleaved data in hyperspectral formats (with
hundreds of bands) where the overview becomes a very serious issue.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
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