5

I am trying to combine three conditions into one con statement line:

ndvi_adjusted = Raster(ndvi_raw) * 0.004 - 0.08
con1 = Con(Raster(ndvi_adjusted) >= 0, ndvi_adjusted)
con2 = Con(IsNull(con1), 0, con1)

I am quite confused with the where clause input and map algebra expressions in Con. I tried some ways to aggregate the three lines into one but did not work out. How can Con statement be properly aggregated?

  • 1
    Con(isnull(raw),0, Con(raw>20, raw*0.004-0.08, 0)) – FelixIP May 27 '16 at 18:45
3

More logical solution in your case

Con(isnull(raw) or (raw<20), 0, formulae)

Use symbol from raster calculator for OR, I cannot find one on my phone

Formulae is .004*raw-0.08 which is negative at raw < 20

  • 1
    Did answer above solved your original question? Obviously yes, because you removed your comments. Rules here say: one Q per post, mark as solved, post a new one – FelixIP Jun 3 '16 at 18:44

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.