I am trying to implement Koppen's Climate classification on my map based on the amount of precipitation and temperature in US. The following is the criteria for B climate zones.
"70% or more of annual precipitation falls in the summer half of the year and r less than 20t + 280, or 70% or more of annual precipitation falls in the winter half of the year and r less than 20t, or neither half of the year has 70% or more of annual precipitation and r less than 20t + 140"
What I did was that I used a modelbuilder to calculate r less than 20t + 280, r less than 20t, and r less than 20t + 140, and then I tried to use Con tool to assign each one of these 3 if certain condition is true (70% or more of annual precipitation falls in the summer half of the year, 70% or more of annual precipitation falls in the winter half of the year , and else).
The picture below is my model. The one in the middle is where I did the calculation of 3 different values, and the one on the left if my Con expression for summer and the left one is my con expression for winter.
How can I do the "else" in Con tool?
Solved! Go to Solution.
One idea that comes to mind is to use the Raster Calculator GP tool in your ModelBuilder. In the Raster Calculator, create a nested CON statement as described in the following link here.
There is an example of three CON statements in a single statement: OutRas = Con(InRas1 > 23, 5, Con(InRas1 > 20, 12, Con((InRas1 > 2) & (InRas1 < 17), Sin(InRas1), 100)))
Hope this helps!
One idea that comes to mind is to use the Raster Calculator GP tool in your ModelBuilder. In the Raster Calculator, create a nested CON statement as described in the following link here.
There is an example of three CON statements in a single statement: OutRas = Con(InRas1 > 23, 5, Con(InRas1 > 20, 12, Con((InRas1 > 2) & (InRas1 < 17), Sin(InRas1), 100)))
Hope this helps!
Thank you so much! This is what I needed.
I think I got it working finally!
OK My result is still not showing the value for when it is false. Can you help me see what I did wrong?
I have 2 expressions for when it is true and one for when it is false.
I want to return "Neithervalue" when it is false, but it is not displayed on my map.
Con("%PRISM_ppt_30yr_normal_800mM2_annual_bil.bil%"*0.7 >= "%PRISM_ppt_30yr_normal_800mM2_09_bil.bil%" + "%PRISM_ppt_30yr_normal_800mM2_08_bil.bil%" + "%PRISM_ppt_30yr_normal_800mM2_07_bil.bil%" + "%PRISM_ppt_30yr_normal_800mM2_06_bil.bil%" + "%PRISM_ppt_30yr_normal_800mM2_05_bil.bil%" + "%PRISM_ppt_30yr_normal_800mM2_04_bil.bil%" , "%Summervalue%",
Con("%PRISM_ppt_30yr_normal_800mM2_annual_bil.bil%" * 0.7 >= "%PRISM_ppt_30yr_normal_800mM2_03_bil.bil%" +"%PRISM_ppt_30yr_normal_800mM2_02_bil.bil%" +"%PRISM_ppt_30yr_normal_800mM2_01_bil.bil%" +"%PRISM_ppt_30yr_normal_800mM2_12_bil.bil%" +"%PRISM_ppt_30yr_normal_800mM2_11_bil.bil%" +"%PRISM_ppt_30yr_normal_800mM2_10_bil.bil%","%Wintervalue%",
"%Neithervalue%"))
Would using the ModelBuilder If-Then-Else Logical tools work for your workflow? You can find more about the various logical tools here.
Thanks it worked!