[gdal-dev] Embedding external TIFF overviews into GeoTiff

Frank Warmerdam warmerdam at pobox.com
Wed May 5 15:28:39 EDT 2010

Mika Lehtonen wrote:
> Hi,
> obviously Gdal can't swap external overview file(s) into internal in 
> GeoTiff format, am I right?
> I would like to use my own overviews in some Geotiffs and use them in 
> Geoserver, but Geoserver can't handle external overviews. How 
> complicated it would be to incorporate such a feature into Gdal? I don't 
> mean that it would have to be included into new releases and it wouldn't 
> have to cover more than just GeoTiff format with "normal" RGB-images. I 
> could try to taylor my own Gdal-version, but I am not sure how big job 
> that would be. I am not so much familiar with C, so the outcome 
> would/will be a little bit 'quick'n'dirty anyway.
> Any ideas?


I would use GDAL to generate normal overviews, and then copy over them
from your overviews using normal RasterIO() facilities against the
overviews.  So, use GetOverview() to fetch particular overview layers as
a GDALRasterBand and then use RasterIO() to write your imagery to them.

> Another approach is to embed GeoTiff tags into multipage tif, I guess. I 
> know I can dump Geotiff header into file with listgeo, edit Tiff with 
> some tool and copy header back with geotiffcp, but AFAIK this system 
> doesn't support overviews, right?

Note that it is not normal practice to set geotiff tags on overviews - at
least not in GDAL.  Is this required by GeoServer?

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