2

I ran a proximity (raster distance) function and I would like to invert the result.

Is there a simple way to do this with out converting it back to vector format and editing the attribute table?

  • Yes, raster calculator docs.qgis.org/2.2/en/docs/user_manual/working_with_raster/… the actual calculation depends on what you mean by invert. – Michael Stimson Nov 22 '17 at 1:05
  • The proximity raster function creates pixels with higher values the further away from the object they are. I would like to invert those values so the numbers get smaller as they get further. – brink Nov 22 '17 at 1:11
  • 3
    Use an n-R calculation where n is a constant and R is you cell value.. where R is small the output is large, where R is large the output is small. – Michael Stimson Nov 22 '17 at 1:15
  • No worries! I'm glad you got a result. Can you please answer your own question, with screenshots preferably, for the benefit of users in the future who have the same requirement. – Michael Stimson Nov 22 '17 at 21:13
2

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. enter image description here

If you are wondering what number to use try this link How to extract pixel value counts from a raster in QGIS?

  • You can accept your answer with the checkbox – BERA Apr 30 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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