<HTML><BODY><div class="js-helper js-readmsg-msg"><div id="style_17108603221275315526"><div id="style_17108603221275315526_BODY"><div class="cl_867670"><div><div>Yes, the target files already exists. Yes, I’ve tried to investigate this issue on some small and medium files. For example:<br>original hillshade.tif size is 11469 bytes, after gdal_rasterize its size is 26465 bytes, and after gdal_translate - 15426 bytes,</div><div>original - 7477 K, gdal_rasterize - 8705 K, gdal_translate - 5964 K,</div><div>original - 39110 K, gdal_rasterize - 39112 K, gdal_translate - 446 K.<br>So, <span lang="en"><span><span>it depends on the content of the raster.</span></span></span></div><div><span lang="en"><span><span>I would like to avoid intermediate processing if possible. This will require additional time for processing and space for the data. Moreover, in some cases a lot of space needs to be allocated for intermediate files.</span></span></span></div><div> </div><div>Andrey</div><div class="mail-quote-collapse"><blockquote style="border-left:1px solid #0857A6;margin:10px;padding:0 0 0 10px;"><span data-type="sender">Tuesday, March 19, 2024 4:25 PM +03:00 from Rahkonen Jukka <<a href="/compose?To=jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>>:<br> </span><div data-type="body"><div id=""><div class="js-helper_mr_css_attr js-readmsg-msg_mr_css_attr"><div><div id="style_17108547490217322390_BODY_mr_css_attr"><div class="cl_858737_mr_css_attr"><div class="WordSection1_mr_css_attr"><p class="MsoNormal_mr_css_attr"><span style="mso-fareast-language:EN-US">Hi,</span></p><p class="MsoNormal_mr_css_attr"><span style="mso-fareast-language:EN-US"> </span></p><p class="MsoNormal_mr_css_attr"><span style="mso-fareast-language:EN-US" lang="EN-US">So the target files dem.tif and hillshade.tif exist already? Maybe it is not so simple to update already compressed data in place. Have you tried what happens if you re-write the results into new files<br><br>gdal_translate -co tiled=yes -co compress=LZW hillshade.tif final_hillshade.tif.</span></p><p class="MsoNormal_mr_css_attr"><span style="mso-fareast-language:EN-US" lang="EN-US"> </span></p><p class="MsoNormal_mr_css_attr"><span style="mso-fareast-language:EN-US" lang="EN-US">-Jukka Rahkonen-</span></p><p class="MsoNormal_mr_css_attr"><span style="mso-fareast-language:EN-US" lang="EN-US"> </span></p><div class="mail-quote-collapse"><div><div data-type="body"><div><div style="border-top:solid #e1e1e1 1.0pt; border:none; padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal_mr_css_attr"><b>Lähettäjä:</b> gdal-dev <<a>gdal-dev-bounces@lists.osgeo.org</a>> <b>Puolesta </b>Andrey VI via gdal-dev<br><b>Lähetetty:</b> tiistai 19. maaliskuuta 2024 14.43<br><b>Vastaanottaja:</b> <a>gdal-dev@lists.osgeo.org</a><br><b>Aihe:</b> [gdal-dev] gdal_rasterize processed GTiff filesize question</p></div></div></div></div><p class="MsoNormal_mr_css_attr"> </p><div><div id="style_17108518540727893310_BODY_mr_css_attr"><div><div><p class="MsoNormal_mr_css_attr">Hello.</p></div><div><p class="MsoNormal_mr_css_attr"> </p></div><div><p class="MsoNormal_mr_css_attr">I’m using gdal_rasterize to remove some data from DEM (Int16) and hillshade (Byte) rasters with shape-file, like this:</p></div><div><p class="MsoNormal_mr_css_attr">gdal_rasterize -burn -32768 shape.shp dem.tif and gdal_rasterize -burn 0 shape.shp hillshade.tif</p></div><div><p class="MsoNormal_mr_css_attr">Both DEM and hillshade GTiffs created with -co COMPRESS=LZW -co TILED=YES options. After processing with gdal_rasterize the <span lang="EN">size of GTiffs becomes 1.5 times larger</span>. Why it happens? <span lang="EN"> I assumed that it should be the other way around, because a significant portion of the data is replaced with the same values and should be compressed well.</span></p></div><div><p class="MsoNormal_mr_css_attr"> </p></div><div><p class="MsoNormal_mr_css_attr">Andrey</p></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></BODY></HTML>