[gdal-dev] Tiling and Overviews disappear after compressing with LZW

Ammar ammar83_h at yahoo.com
Fri Dec 6 02:13:43 PST 2013


Vincent,

Thank you very much for your reply. I did what you suggested and it worked! :)

Regards,
Ammar




________________________________
 From: Vincent Schut <schut at sarvision.nl>
To: gdal-dev at lists.osgeo.org 
Sent: Thursday, December 5, 2013 4:48 PM
Subject: Re: [gdal-dev] Tiling and Overviews disappear after compressing with LZW
 


On 12/05/13 16:39, Vincent Schut wrote:

On 12/05/13 16:21, Ammar wrote:
>
>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!
>>
>> what I did was:
>>
>>
>>gdal_translate -a_srs "EPSG:3011" -co "TILED=YES" -co "BLOCKXSIZE=512" -co "BLOCKYSIZE=512" in.tif out.tif
>>
>>
>>
>>gdaladdo -r average file.tif 2 4 8 16 32    //Adding the overviews
>>
>>
>>gdal_translate -co compress=LZW in.tif out.tif
>>
>>
>>After the compression, I got the original block size and with no overviews!
>>
>>
>>Any ideas, thoughts or tips will be appreciated.
>Hello Ammar,
>
>the default for gdal_translate is no tiling, no compression, and
      don't copy overviews. So your last gdal_translate command
      effectively removes all tiling, overviews and compression. If you
      want to have a tiled and compressed file, add the '-co
      compress=lzw" to your first gdal_translate command, which will
      create a tiled and compressed 'out.tif'. Then add overviews to
      that with gdaladdo. If I'm not mistaken, the overviews use the
      settings from the main dataset, so would also use lzw compression.
>
>Best,
>Vincent Schut.
>
Correction: that should of course read: "So your last gdal_translate
    command effectively removes all tiling and overviews, while adding
    lzw compression."


>>
>>//Ammar
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>_______________________________________________
gdal-dev mailing list gdal-dev at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>_______________________________________________
gdal-dev mailing list gdal-dev at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131206/c7045bc0/attachment.html>


More information about the gdal-dev mailing list