2

I have two raster layers - one with slope(degrees), called theta, and one with slope(%). I need to calculate the S-factor by using attatched formula. How do I write this in the raster calculator? Is it possible?

enter image description here

4

A "True" condition evaluates numerically to 1, and a "False" condition to zero, so if you add up the result of multiplying the test conditions by the value expressions for those tests, you get the result you are after. So:

("slope@1" < 9 ) * (10.8 * sin("theta@1")+0.03) +
("slope@1" >=9 ) * (16.8 * sin("theta@1")-0.05)

should do it. Make sure your theta is in radians, not degrees. To convert, multiply by pi/180, except there's no "pi" in the calculator, but acos(0) is pi/2, so multiply by acos(0)/90 is equivalent.

[Hint: save your calculator expressions in a text file and paste them into/out of the calculator because it doesn't save them and I'm not typing that all in again!!]

1
  • Thank you so much! Sorry, i'll save my calculator expressions from now on :-) – anneke May 6 at 16:01

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.