<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>By design, only speaking about behaviour of the GDAL utilities
themselves:<br>
</p>
<p>- gdal_translate -a_nodata just modifies the nodata metadata, and
doesn't alter pixel values</p>
<p>- gdalwarp [-srcnodata xxx] -dstnodata yyy modifies the nodata
metadata and pixel values<br>
</p>
<div class="moz-cite-prefix">Le 09/07/2021 à 01:02, Alexandre Neto a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CA+H0G_HOdFgkkxdMZsnEuzDxH5CBu-3tzxNy874zpgdHM2370A@mail.gmail.com">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I was quite surprised with the behavior of gdal_translate
(in clip raster by extent) and gdal_warp (reproject) when the
user sets up an output nodata value different from the
original nodata value of the input files.</div>
<div><br>
</div>
<div>My intuition was telling me that by using that option, all
the old nodata pixel values would be transferred to the new
nodata values. So, if I have a raster with nodata =
-3.40282e+38 and I use as output nodata value -9999, I would
expect that all -3.40282e+38 pixels would be converted to
-9999 and considered to be NODATA. But I was wrong. By doing
this, I ended up with rasters containing pixels with actual
-3.40282e+38 value, no longer considered as nodata.</div>
<div><br>
</div>
<div>Is it just me that finds this unexpected?</div>
<div><br>
</div>
<div>On the other hand, if you use the same similar option in
the DGAL raster calculator it works as (I) expected.</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Alexandre Neto</div>
<div>User Support</div>
<div><a href="http://www.cooperative.net" moz-do-not-send="true">www.cooperative.net</a><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
QGIS-Developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-developer">https://lists.osgeo.org/mailman/listinfo/qgis-developer</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>