Monday, 2 December 2019

qgis - How to set all pixels with value


I have a DEM raster with pixel values between about 3000 and -0.0003. I need to set all pixel with a value of 0 and smaler (<=0) to "nodata" (for later raster calculations and to reduce the filesize).


It seems for me that this is a task for the raster calculator (set value of pixels <=0 to "nodata") or a reclassification (set value of pixels <=0 to "nodata" and keep all other values) but I dont know how.




Answer



I didn't find a one-tool solution, but you can first use raster calculator to turn all values below a certain threshold to zero and then use gdal_translate with -a_nodata 0 to turn the 0 into nodata.


enter image description here


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...