Opened 17 years ago

Closed 16 years ago

#1849 closed defect (fixed)

Masks and Overviews - Two great tastes that don't taste great together

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone: 1.5.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: mask pverview
Cc: gaopeng

Description

I believe that currently the default overview, and default mask support do not work together. In particular, if an overview is generated on a format like PNG that uses the .ovr file, and if that file has a nodata mask, the mask will not be generated for the overview levels. Doing GetMaskBand() on the overview bands will presumably return the "all valid" mask.

Change History (1)

comment:1 by warmerdam, 16 years ago

Keywords: mask pverview added
Resolution: fixed
Status: newclosed

I believe I have mostly fixed this in r12795 though a few other commits were also in support of this.

However, on deeper consideration I feel it is also imprudent for applications to expect overviews to have components like masks. Overview bands don't normally have nodata settings, colormap sor other metadata for instance. It is generally not expected that overview bands offer anything *except* the actual raster data.

But the r12795 changes do ensure that overviews build on datasets managed via GDALDefaultOverviews will also have overviews built on any "real" masks. This ensures that masks can be loaded efficiently when using raster io, and - though I consider it unwise to depend on it too much - the overview bands will even have proper mask flags and mask bands if they have *real* masks.

Derived masks (from nodata for instance) do not exist for overview bands.

some testing for the new functionality was added in autotest/gcore/mask.py (tests mask_4 and mask_5).

Note: See TracTickets for help on using tickets.