[QGIS-Developer] GDAL-warp and gdal-translate strange behaviour regarding output NODATA vaue

Alexandre Neto senhor.neto at gmail.com
Thu Jul 8 16:02:00 PDT 2021


Hi,

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.

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.

Is it just me that finds this unexpected?

On the other hand, if you use the same similar option in the DGAL raster
calculator it works as (I) expected.

Best regards,

Alexandre Neto
User Support
www.cooperative.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20210709/b41e5e73/attachment.html>


More information about the QGIS-Developer mailing list