1

I want to remove the no data values from my raster and save the resulting file. Currently, I am using the method shown below to save the raster without no data values.

enter image description here

The issue is that I have to save more than 100 raster files after removing no data values, which range from 30000 to 33000.

Is there any code or method to automatically do this?

3
  • Do you have those Rasters directly in QGIS or somewhere in a folder? Should output rasters be placed in the same folder as the input?
    – Taras
    Commented Jun 14, 2021 at 14:44
  • 1
    You can try with the Raster Calculator and after QgsRasterFileWriter qgis.org/pyqgis/3.0/core/Raster/QgsRasterFileWriter.html. Otherwise check this gis.stackexchange.com/a/350471/99589
    – Taras
    Commented Jun 14, 2021 at 14:51
  • @Taras I have them in a single folder. It is okay if the output rasters are placed in the same folder with a new name.
    – G.S. J
    Commented Jun 14, 2021 at 15:01

1 Answer 1

1

You could use the Graphical Modeler in QGIS to create a small Python-script.

In your case you would set a Raster layer as say input_raster and use that as the input for r.null to set certain values to NULL and write the new raster into an output file.

As with all these scripts you can either run this for each file singularly or as a batch process. Since you will still have to fill in some things like input and output filenames I am not sure, how much time this effectively saves in the end, but it should make the process somewhat faster.

Not the answer you're looking for? Browse other questions tagged or ask your own question.