The current code falls back to the base table for small scales.
That approach has some drawbacks cause it forces the original table to
share some conditions with its overviews (same SRID, alginment, scale
constraints) for the rendering to work properly.
What we propose is to always fall back to the highest resolution
overview (lowest scale), rather than the original table, in order to
avoid coupling the original table with the constraints imposed by
rendering and still have them linked (in postgis raster metadata).
Please note this approach is not 100% compatible as the base table
won't be used. This should be no big deal because overviews can have
an arbitrary resolution/scale.
refs #2551
Postgis raster_columns view is returning NULL values for raster
overviews with large scale factors. That issue in postgis is described
in http://trac.osgeo.org/postgis/ticket/3006
This causes two main problems:
- The first overview with scale = NULL is wrongly chosen for rendering
always
- The messed up scaling factor causes the render symbolizer to spent
an insane amount of CPU and memory to render a messed up tiles.
The patch in postgis is expected to be released with the new version, a
few months from now.
Conflicts:
plugins/input/pgraster/pgraster_datasource.cpp