[Gdal-dev] [newbie] Reading of large TIF files

Frank Warmerdam warmerdam at pobox.com
Thu Nov 10 09:32:27 EST 2005


On 11/10/05, t.laue at web.de <t.laue at web.de> wrote:
> At the moment GDALRasterBand::RasterIO is being used for accessing overview levels
> and reading small image patchs because I did not find a way how to read from single
> overview levels using GDALDataset::RasterIO. Everything is working fine as long as I
> am utilising gray value images with one raster band.
>
> In the case of RGB images I can employ a loop for retrieving the data of all three raster
> bands from the same overview level resulting in three buffers which contain the data. I
> would like to display the color image at the screen but I have no idea how to combine
> them again.
>
> Is there a way to create a new dataset for adding the data read from different bands? Is
> it possible to use GDALDataset to access single overview levels? Do I have to use
> another method independent of GDAL to bring the three buffers together in order to
> recreate a RGB image patch? Is anyone working with Qt 4 and GDAL?

Thomas,

You can fetch "overview bands" from a band using the
GDALRasterBand::GetOverview() method.  GDALRasterBand::GetOverviewCount()
will indicate how many are available.

However, as someone else noted, you don't normally need to explicitly
reference the overviews as GDAL will use the most appropriate overview
or the base band depending on the level of downsampling implicit in
your RasterIO() request.

Also, you can fetch all desired bands in one pass using the
GDALDataset::RasterIO() method.  For some formats this
will be faster while for others it just does a rasterio on each band,
reorganizing the data into a mixed band.

I'll leave the Qt issues to Tim.

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