Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#4940 closed defect (wontfix)

gdaladdo -clean doesn't remove overlays

Reported by: osjonathan Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 1.9.0
Severity: normal Keywords:


Using the top version from: (that a web-page, not an actual zip)

If I run:

gdaladdo -clean MiniScale_Colour_tiled.tif

I get: "0" pop up in my console.

However the file size is identical. It hasn't deleted the overlays.

Further, the documentation ( says: "If the file has existing overview levels at a level selected, those levels will be recomputed and rewritten in place."

But if I then build some new overlays using the exact same command as I made the previous ones, only with a different resampling method, the file gets even larger, as in, it looks very much like the new overlays are being stuck onto the end of the file and not overlapping the old ones.

Example: If I do a "cubic" set of overlays on a file I've cleaned before, I get a file of 429MB. But if I do it on a "fresh" file, the exact same command nets me 298MB.

Change History (3)

comment:1 by Even Rouault, 11 years ago

Resolution: wontfix
Status: newclosed

Yes, this is expected. The libtiff library doesn't handle compaction. If you want to change only the resampling method, don't delete the existing overviews before.

comment:2 by osjonathan, 11 years ago

In that case I'd suggest updating the documentation to:

a) Reflect the fact -clean won't actually remove the overlays, only the pointer.

b) That creating new overlays after cleaning will append rather than overwrite.

c) That NOT using clean is the desired state of affairs if you wish to resample.

comment:3 by Even Rouault, 11 years ago

r25434 "doc: add some precision about gdaladdo -clean not shrinking file (#4940)"

""" For internal GeoTIFF overviews (or external overviews in GeoTIFF format), note that -clean does not shrink the file. A later run of gdaladdo with overview levels will cause the file to be expanded, rather than reusing the space of the previously deleted overviews. If you just want to change the resampling method on a file that already has overviews computed, you don't need to clean the existing overviews. """

Note: See TracTickets for help on using tickets.