<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Denis,</p>
The maximum of nearest downsampling should be <= maximum of full
resolution.<br>
<p>Potential explanations:</p>
<p>- your source file has overviews that contain completely
different values than the full resolution image.</p>
<p>- or perhaps your input_raster_to_resize_with_max_val_92.tiff
file has a .aux.xml with outdated stats (gdalinfo -stats doesn't
regenerate stats if already found)</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 20/05/2021 à 21:42, Denis Rykov a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAJbvKNoW55-Q=X2DNzjRqeU88H2r1Aeot860aJu9Cprk1bEXyw@mail.gmail.com">
<div dir="ltr">
<pre><code><span>$ gdalinfo -stats -json input_raster_to_resize_with_max_val_92.tiff | jq '.bands[0].metadata[""].STATISTICS_MAXIMUM'
"92"
$ gdal_translate -outsize 1% 1% input_raster_to_resize_with_max_val_92.tiff output.tif
Input file size is 6845, 10302
0...10...20...30...40...50...60...70...80...90...100 - done.
$ gdalinfo -stats -json output.tif | jq '.bands[0].metadata[""].STATISTICS_MAXIMUM'
"3149.9255371094"
</span></code><span>
</span><span>I expected to get the same or at least close value as in the original raster. What might be the reason for that behavior?<code><span>
</span></code></span></pre>
<pre><code><div><div class="gmail-js-timeline-item gmail-js-timeline-progressive-focus-container"><div class="gmail-TimelineItem gmail-js-comment-container">
</div></div></div></code></pre>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</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>