[gdal-dev] Implementing overview support apart from the default support

Even Rouault even.rouault at mines-paris.org
Wed Oct 17 09:31:09 PDT 2012


Selon Jorge Arevalo <jorgearevalo at libregis.org>:

> Hello,
>
> I'm working with Mapserver, trying to serve images stored in PostGIS
> Raster via WMS using the new version of GDAL PostGIS Raster driver
> (I'm working to improve it). The images appears misplaced when
> overview tables are used. The overviews were correctly created, but
> the driver doesn't serve them in the right way. In other words: it
> isn't a data problem. It's a driver problem.
>
> I've been re-reading the GDAL driver implementation tutorial, but it
> only covers the default support in GDAL for external overviews stored
> in TIFF files. My overviews are stored in PostGIS Raster tables, not
> TIFF files. I'm looking at geotiff.cpp code. I guess the driver have
> to fullfill some requirements, like geotiff driver does. My question
> is: what are the most important parts in order to provide a good
> overview support, based on the idea that the overviews are raster
> tables? (Just reading support, so far)

Jorge,

I'm not sure if there are very well formalized requirements documented
somewhere, bu the ones I can think of are :

1) A few characteristics of the overview band should be the same as the base
band, i.e. same data type (this is probably not a so strong requirement, because
RasterIO() should do the translation to the requested data type), and same color
table in the case the base band has a color table associated

2) The spatial extent of the overview band should be exactly the same as the one
of the base band. This is really a strong requirement. And I feel this is the
likely cause of the mis-placement you observe. I'm not sure how your PostGIS
Raster overviews are built, but if they have a different extent that the full
resolution table, you'll surely have an issue, unless the driver compensates for
that by padding/cropping appropriately.

Best regards,

Even


More information about the gdal-dev mailing list