Select to view content in your preferred language

I was running Rastor calculator but I got indentation errors

1987
2
Jump to solution
02-09-2016 04:32 AM
HanibalLemma
Deactivated User

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?

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

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))))))))))



Think Location

View solution in original post

2 Replies
JayantaPoddar
MVP Esteemed Contributor

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))))))))))



Think Location
HanibalLemma
Deactivated User

I really appreciate. it works!