1

I'm stack with a simple issue.

I have a raster (DEM) and what I want to do is to assign -9999 where the pixel value of the DEM is 500 and leave all the other values as the original ones.

I tried:

 (  ( "dem@1" = 500)  * (-9999)) OR  (  ( "dem@1" != 500)  * "dem@1" ) 

but I get a new raster with nan and 1.

Some idea?

3

Based on @underdark's answer to this question I think you need to do:

 (( "dem@1" = 500)  * -9999) +  (( "dem@1" != 500) * "dem@1" ))

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.