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

2012-10-17 Thread Jorge Arevalo
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)

Many thanks in advance,

-- 
Jorge Arevalo
http://www.krop.com/jorgearevalo
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


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

2012-10-17 Thread Even Rouault
Selon Jorge Arevalo jorgearev...@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
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev