i was trying to execute the following command in Map algebra-----raster calculator.
Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ((("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)) & ("slope_deg" <= 5)),5)
con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ((("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)) & ("slope_deg" > 5)),6)
con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ("tpi2010m_std" >= 100),7)
con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ("tpi2010m_std" <= -100),4)
con(("tpi300m_std" <= -100) & (("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)),2)
con(("tpi300m_std" >= 100) & (("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)),9)
con(("tpi300m_std" <= -100) & ("tpi2010m_std" >= 100),3)
con(("tpi300m_std" <= -100) & ("tpi2010m_std" <= -100),1)
con(("tpi300m_std" >= 100) & ("tpi2010m_std" >= 100),10)
con(("tpi300m_std" >= 100) & ("tpi2010m_std" <= -100),8)
however, I got the message ERROR 000539 parsing error indentationError unexpected indent.
anybody can help me please?
Solved! Go to Solution.
You would need to combine them in a single expression, like Nested Conditions
Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ((("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)) & ("slope_deg" <= 5)),5,Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ((("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)) & ("slope_deg" > 5)),6,Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ("tpi2010m_std" >= 100),7,Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ("tpi2010m_std" <= -100),4,Con(("tpi300m_std" <= -100) & (("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)),2,Con(("tpi300m_std" >= 100) & (("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)),9,Con(("tpi300m_std" <= -100) & ("tpi2010m_std" >= 100),3,Con(("tpi300m_std" <= -100) & ("tpi2010m_std" <= -100),1,Con(("tpi300m_std" >= 100) & ("tpi2010m_std" >= 100),10,Con(("tpi300m_std" >= 100) & ("tpi2010m_std" <= -100),8))))))))))
You would need to combine them in a single expression, like Nested Conditions
Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ((("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)) & ("slope_deg" <= 5)),5,Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ((("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)) & ("slope_deg" > 5)),6,Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ("tpi2010m_std" >= 100),7,Con((("tpi300m_std" > -100) & ("tpi300m_std" < 100)) & ("tpi2010m_std" <= -100),4,Con(("tpi300m_std" <= -100) & (("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)),2,Con(("tpi300m_std" >= 100) & (("tpi2010m_std" > -100) & ("tpi2010m_std" < 100)),9,Con(("tpi300m_std" <= -100) & ("tpi2010m_std" >= 100),3,Con(("tpi300m_std" <= -100) & ("tpi2010m_std" <= -100),1,Con(("tpi300m_std" >= 100) & ("tpi2010m_std" >= 100),10,Con(("tpi300m_std" >= 100) & ("tpi2010m_std" <= -100),8))))))))))
I really appreciate. it works!