[gdal-dev] Tiling and Overviews disappear after compressing with LZW
Jukka Rahkonen
jukka.rahkonen at mmmtike.fi
Thu Dec 5 09:58:28 PST 2013
Ammar <ammar83_h <at> yahoo.com> writes:
>
> Hello list,
>
> I am new to GDAL and I have been using the utilities to process and
prepare TIFF to create a mosaic in Geoserver. I am
> expermineting with different
> compression methods and I have noticed that after compressing a file with
LZW, the previously created tiles and overviews disappear!
Hi,
Experimenting is good but reading manuals is not a bad idea either. I
recommend these Geoserver recipes
http://www.slideshare.net/geosolutions/gs-steroids-sgiannecfoss4g20130103
The gdaladdo manual page http://www.gdal.org/gdaladdo.html seems to need
some improvements but is is still worth reading.
Gdal_translate writes always a new file, it does not improve something
existing. Gdaladdo behaves a bit differently and it add overviews into
existing geotiff.
Good defaults for aerial images is to run first
gdal_translate -of GTiff -co tiled=yes -co compress=jpeg -co
PHOTOMETRIC=YCBCR in.tif out.tif
and then
gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR
--config INTERLEAVE_OVERVIEW PIXEL out.tif 2 4 8 16
For raster maps jpeg compression is not ideal. Experiment with compression
methods (or stay with uncompressed if you have space), resampling options
and consider if you want to use internal or external overviews (-ro). Both
behave in a similar way but building internal overviews saves some disk
space. On the other hand external overviews can be removed easily if you
want to have a try with different parameters.
-Jukka Rahkonen-
More information about the gdal-dev
mailing list