<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 31/12/2021 à 09:04, Evert Etienne
(SITEMARK) a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:3e8cde93-ee8c-4ede-991e-2e1f2669ed5b@email.android.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div dir="auto">
<div>> If you output to regular GTiff, the 2 step process
might be needed to get the best compression</div>
<div dir="auto"><br>
</div>
<div dir="auto">Are there some guidelines to when this is needed
since you say 'might'? </div>
<div dir="auto">Would it be possible to explain why this is the
case?</div>
</div>
</blockquote>
<p>By default, warping doesn't proceed by chunks that would
necessarily align on entire target blocks, so some target blocks
might be rewritten several times, which will usually cause some
space to be lost in the file if it uses compression (at least this
is true for GeoTIFF output). The whole logic is at
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/master/alg/gdalwarpoperation.cpp#L1363">https://github.com/OSGeo/gdal/blob/master/alg/gdalwarpoperation.cpp#L1363</a>.
The -wo <span class="pl-s"><span class="pl-pds"></span>OPTIMIZE_SIZE<span
class="pl-pds">=YES warping option can be specified to avoid
that, but it is sometimes detrimental for speed of execution
if the shapes of the source and target images are
significantly different due to characteristics of their CRS.<br>
</span></span></p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:3e8cde93-ee8c-4ede-991e-2e1f2669ed5b@email.android.com">
<div dir="auto">
<div dir="auto"><br>
</div>
<div dir="auto">Thanks<br>
<div class="gmail_extra" dir="auto"><br>
<div class="gmail_quote">On Dec 30, 2021 23:26, Even Rouault
<a class="moz-txt-link-rfc2396E" href="mailto:even.rouault@spatialys.com"><even.rouault@spatialys.com></a> wrote:<br
type="attribution">
<blockquote class="quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<p>Matt,</p>
<p>There has been an enhancement in gdalwarp to
support writing directly to drivers, like COG, that
supports only the CreateCopy mode. So you don't need
the 2 step process and can directly gdalwarp -of COG
(it will more or less do the 2 steps internally)</p>
<p>If you output to regular GTiff, the 2 step process
might be needed to get the best compression</p>
<p>Even<br>
</p>
<div>Le 30/12/2021 à 22:29, <a
href="mailto:Matt.Wilkie@yukon.ca"
moz-do-not-send="true">Matt.Wilkie@yukon.ca</a> a
écrit :<br>
</div>
<blockquote>
<div>
<p>A few years ago it was best practice to follow
a gdal warp process with translate in order to
get better compression, and even overall speed
although extra disk write is involved. Is this
still the case? and when using COG output
driver? e.g.</p>
<p> </p>
<p>gdalwarp infile.tif interim.tif</p>
<p>gdal_translate -of cog -co compress=zstd
interim.tif final.tif</p>
<p> </p>
<p>thanks!</p>
<p> </p>
<p><b>Matt Wilkie</b></p>
<p>Geomatics Developer & Administrator</p>
<p>Environment | Technology, Innovation and
Mapping</p>
<p>T 867-667-8133 | <u><a
href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fyukon.ca%2F&data=04%7C01%7Cevert.etienne%40sitemark.com%7C956448b3d0fb4d64e85e08d9cbe36bbd%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637764999902500335%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=RW%2FH6JNyDipGaTjWVJixD38pCPT3PlqrkmZgXQQM%2B80%3D&reserved=0"
moz-do-not-send="true">Yukon.ca</a></u></p>
<p><i>Hours: 08:30-16:30, Mon-Wed: Office, Thu:
Remote, Fri: Away.</i></p>
<p> </p>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" moz-do-not-send="true">gdal-dev@lists.osgeo.org</a>
<a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=04%7C01%7Cevert.etienne%40sitemark.com%7C956448b3d0fb4d64e85e08d9cbe36bbd%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637764999902500335%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=M%2F%2BmehTP3cdAaThPcV0bk9ChffUupqTzcsaxyJw8jho%3D&reserved=0" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre>--
<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.spatialys.com%2F&data=04%7C01%7Cevert.etienne%40sitemark.com%7C956448b3d0fb4d64e85e08d9cbe36bbd%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637764999902500335%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=laNHz%2FOiaBi5f62f1cxan%2FF3KcSMJvHREQ0H5ggnVSg%3D&reserved=0" moz-do-not-send="true">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>