Opened 15 years ago
Closed 15 years ago
#2915 closed defect (fixed)
Need Mechanism to Clear Overviews
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.7.0 |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | normal | Keywords: | overviews |
Cc: | gaopeng |
Description
GDAL needs a mechanism to clear existing overviews.
It is planned to treat the case of passing an empty list of overview levels to BuildOverviews() to indicate that any existing overviews should be cleared.
Attachments (1)
Change History (10)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Milestone: | → 1.7.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
I have added testing in trunk for the clear overviews functionality (r16697).
comment:3 by , 15 years ago
comment:4 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
BuildOverviews on a tiff (or other formats such as Grid) with an existing RRD is broken. It now just deletes the existing rrd without building any overviews.
comment:5 by , 15 years ago
Gao,
I tried running gdaladdo -clean, followed by gdaladdo to add an overview and this seemed to work ok.
I tried the following:
import gdal gdal.SetConfigOption( 'USE_RRD', 'YES' ) gdal.SetConfigOption( 'HFA_USE_RRD', 'YES' ) ds = gdal.Open('pyr93_v.jpg',gdal.GA_ReadOnly) ds.BuildOverviews( overviewlist = [] ) ds.BuildOverviews( overviewlist = [ 9 ] ) ds = None
and it worked. But if I remove the config options, it ended up replacing the .aux file with a TIFF file with the name .aux. Is it possible this is the behavior you saw? What overview related config options are in effect in ArcGIS?
comment:6 by , 15 years ago
Frank,
The 'USE_RRD'option is not set. The behavior I am looking for is:
- creating new overviews as .ovr for all except HFA
- updating existing overviews using the same format.
comment:7 by , 15 years ago
Here are overviews related config options:
CPLSetConfigOption("HFA_USE_RRD", "YES"); CPLSetConfigOption("COMPRESS_OVERVIEW", "LZW");
BuildOverviews is used to directly update/rebuild overviews without removing the existing one first.
comment:8 by , 15 years ago
Gao,
I tried the script:
gdal.SetConfigOption( 'COMPRESS_OVERVIEW', 'LZW' ) gdal.SetConfigOption( 'HFA_USE_RRD', 'YES' ) ds = gdal.Open('pyr93_v.jpg',gdal.GA_ReadOnly) ds.BuildOverviews( overviewlist = [ 9 ] )
and this worked fine, in the sense that it build an _ss_9_ overview layer in the existing .rrd file. If I first clean the overviews, and then generate overviews without closing the file in between then I end up deleting the .rrd file, and .aux file, and then rebuilding the .aux file, but actually in TIFF format and this does not work afterwards. I will fix this aspect though it is not entirely clear that it directly relates to the problem you are seeing.
comment:9 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Version: | unspecified → svn-trunk |
I have made changes in the GDALDefaultOverviews::CleanOverviews() method to reset the osOvrFilename according to the normal rules. Now a clean and build in sequence results in the .aux and .rrd being deleted and an .ovr built.
The changes are in trunk (r17263) and 1.6-esri branch (r17264).
I have added an initial implementation which implements BuildOverviews(0) to clear overviews in the HFA, and GTiff drivers, as well as in the gdaldefaultoverviews class and adds a -clear option to gdaladdo. This is in trunk (r16670).
No regression tests yet...