<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">Vincent,<br><br>Thank you very much for your reply. I did what you suggested and it worked! :)<br><br>Regards,<br>Ammar<br><div><span><br></span></div><div><br></div> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Vincent Schut <schut@sarvision.nl><br> <b><span style="font-weight: bold;">To:</span></b> gdal-dev@lists.osgeo.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, December 5, 2013 4:48 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re:
[gdal-dev] Tiling and Overviews disappear after compressing with LZW<br> </font> </div> <div class="y_msg_container"><br><div id="yiv7462196271">
<div>
On 12/05/13 16:39, Vincent Schut wrote:<br>
<blockquote type="cite">
On 12/05/13 16:21, Ammar wrote:<br>
<blockquote type="cite">
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">Hello list,
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;
font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;
font-size:12pt;">
<div class="yiv7462196271y_msg_container">
<div id="yiv7462196271">
<div class="yiv7462196271yqt8543993028" id="yiv7462196271yqtfd63070">
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div class="yiv7462196271y_msg_container">
<div id="yiv7462196271">
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div class="yiv7462196271y_msg_container">
<div id="yiv7462196271">
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div><br clear="none">
</div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">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!<br clear="none">
</div>
<div> what I did was:</div>
<div><br clear="none">
</div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">gdal_translate
-a_srs "EPSG:3011" -co
"TILED=YES" -co
"BLOCKXSIZE=512" -co
"BLOCKYSIZE=512"
in.tif out.tif<span class="yiv7462196271tab">
</span><br clear="none">
</div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br clear="none">
</div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">gdaladdo
-r average file.tif 2
4 8 16 32<span class="yiv7462196271tab">
//Adding the
overviews</span></div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br clear="none">
<span class="yiv7462196271tab"></span></div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span class="yiv7462196271tab">gdal_translate -co compress=LZW in.tif out.tif</span></div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br clear="none">
<span class="yiv7462196271tab"></span></div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="font-weight:bold;"><span class="yiv7462196271tab">After the
compression, I got
the original block
size and with no
overviews!</span></span></div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br clear="none">
<span class="yiv7462196271tab"></span></div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span class="yiv7462196271tab">Any ideas, thoughts or tips will be
appreciated.</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Hello Ammar,<br>
<br>
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.<br>
<br>
Best,<br>
Vincent Schut.<br>
</blockquote>
<br>
Correction: that should of course read: "So your last gdal_translate
command effectively removes all tiling and overviews, while adding
lzw compression."<br>
<blockquote type="cite">
<blockquote type="cite">
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;
font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;
font-size:12pt;">
<div class="yiv7462196271y_msg_container">
<div id="yiv7462196271">
<div class="yiv7462196271yqt8543993028" id="yiv7462196271yqtfd63070">
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div class="yiv7462196271y_msg_container">
<div id="yiv7462196271">
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div class="yiv7462196271y_msg_container">
<div id="yiv7462196271">
<div>
<div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br clear="none">
<span class="yiv7462196271tab"></span></div>
<div style="color:rgb(0,
0,
0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span class="yiv7462196271tab">//Ammar<br clear="none">
</span></div>
</div>
</div>
</div>
<br clear="none">
<br clear="none">
</div>
</div>
</div>
</div>
</div>
</div>
<br clear="none">
<br clear="none">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
</div>
</div>
</div>
</div>
<br>
<fieldset class="yiv7462196271mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
gdal-dev mailing list
<a rel="nofollow" class="yiv7462196271moz-txt-link-abbreviated" ymailto="mailto:gdal-dev@lists.osgeo.org" target="_blank" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a rel="nofollow" class="yiv7462196271moz-txt-link-freetext" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
<br>
<fieldset class="yiv7462196271mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
gdal-dev mailing list
<a rel="nofollow" class="yiv7462196271moz-txt-link-abbreviated" ymailto="mailto:gdal-dev@lists.osgeo.org" target="_blank" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a rel="nofollow" class="yiv7462196271moz-txt-link-freetext" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</div>
</div><br>_______________________________________________<br>gdal-dev mailing list<br><a ymailto="mailto:gdal-dev@lists.osgeo.org" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br><br></div> </div> </div> </div></body></html>