Menu

Not equal in raster calculator

2023-03-22
2023-03-24
  • Diego Massat

    Diego Massat - 2023-03-22

    If eq(g1, 1) it's a conditional for TRUE or FALSE of g1 = 1
    How is the conditional for g1 != 1, I mean g1 NOT EQUAL to 1 in this case?

     
  • Diego Massat

    Diego Massat - 2023-03-22

    May be the answer is just ifelse(eq(eq(g1, 1) , 1), 0, 1)
    But I think must be a better answer...

     
  • Volker Wichmann

    Volker Wichmann - 2023-03-23

    Hi,

    the answer is to use an "ifelse" statement, but you can simplify it to

    ifelse(eq(g1,1), 0, 1)
    

    if you want get get "0" as result if "g1 == 1" and "1" for "g1 != 1".

    Best regards,
    Volker

     
    👍
    1
    • Diego Massat

      Diego Massat - 2023-03-24

      Hi Volker!

      Thanks!!

       

Log in to post a comment.