[Gdal-dev] Reading from Overviews with GDALDataset

David Friberg dfriberg23 at gmail.com
Thu Nov 30 19:06:36 EST 2006


So it sounds like you are saying that if I read using
GDALDataset::RasterIO, passing the same number for both PixelSpace and
LineSpace, an attempt will be made to use an overview sampled at the
requested rate to fullfill that read request.  Correct?

For my purposes, I want to read portions of external image files at
some resolution only if those files actually contain image data at
that resolution; I do not want GDAL to do any sampling.  So I suppose
I will also need to query one of the GDALRasterBands comprising the
dataset in order to get the number of overviews (presumably could use
the first band in the dataset?).

Dave

On 11/26/06, Frank Warmerdam <warmerdam at pobox.com> wrote:
> David Friberg wrote:
> > Hi,
> >
> > I need a way to read from Overviews using GDALDataset::RasterIO or
> > similar, i.e. one call to read retrieves data for bands.  I don't see
> > a way to do this without getting each band and reading separately.
> >
> > Am I missing something, or is this the only way to do it?
>
> David,
>
> Normally if you do a RasterIO() call against a normal band at a reduced
> resolution, the GDAL machinery will automatically use appropriate overviews.
>
> If you want to specifically control which overview you use, you can fetch
> back the overview GDALRasterBand object, and access it yourself.  But this
> is very rarely necessary.
>
> I did write a little application in gdal/apps called dumpoverviews for
> dumping out the overviews, but it mainly useful for various kinds of
> detailed testing of overviews in new file formats.
>
> 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    | President OSGeo, http://osgeo.org
>
>



More information about the Gdal-dev mailing list