Redefining nodata value into zero in QGIS?
In QGIS, you can use Raster Calculator with the following calculation:
("your_raster" != -32768) * "your_raster"
With this calculation, if the cell value is -32768 you will get a 0 in that cell and if it is different from -32768 the cell will keep the value it had.
The simplest one-step and, IMO, most consistently reliable solution to reclassifying NoData to zero is to use the Reclassify Grid Values tool (SAGA) in the processing toolbox.
After selecting the raster to be reclassified, simply scroll to the bottom of the dialog, ensure the box replace no data values
box is checked. The default value is zero (but you can substitute something else of course). Then uncheck the replace other values
box and leave all other fields alone (so all you are doing is ensureing one box is checked and unchecking another - no other settings are required).
I found a solution for this. First I convert the image into a vrt layer (gdalbuildvrt
) with -srcnodata 0
, then I translate it back into a tif file with gdal_translate -a_nodata
.
Worked fine!