I ran a proximity (raster distance) function and I would like to invert the result.
Is there a simple way to do this without converting it back to vector format and editing the attribute table?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI ran a proximity (raster distance) function and I would like to invert the result.
Is there a simple way to do this without converting it back to vector format and editing the attribute table?
Thanks to Mr. Stimson I used the expression 1000-(raster layer) to get the inverted raster result. I chose 1000 because it didn't have to be an exact invert and I didn't want negative numbers. I need to run it through r.cost algorithm which creates an error if there is a negative number.
If you are wondering what number to use try this link How to extract pixel value counts from a raster in QGIS?
Invert values with QGIS Raster Calculator:
-1 * "yourRaster@1" + MAX("yourRaster@1")
but MAX()
is not working properly according to some QGIS Bugs Reports.
Instead of MAX()
put the maximum value of your raster. Then:
-1 * "yourRaster@1" + "put the maximum value of your raster"
Cheers