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?

matteo
  • 3,304
  • 1
  • 23
  • 47

1 Answers1

3

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

 (( "dem@1" = 500)  * -9999) +  (( "dem@1" != 500) * "dem@1" ))
Ian Turton
  • 81,417
  • 6
  • 84
  • 185