Wednesday 20 February 2019

reclassify - How to get the "absolute value" of a raster cell in QGIS?


I have a raster map (-100 to +100) and I need to get all the minus values as absolute values (-100=100; -99=99...). How can I do this? Is it something like reclassify?



Answer




You could use the Raster Calculator to do this. Square the pixel values to ensure all values are positive, and then extract the square roots to get back original number. Something like this:


sqrt ( myraster@1 * myraster@1 )

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...