I'm using the ModelBuilder inside ArcMap to execute a set of raster calculations. I need to execute a different calculations based on the pixel value (If the pixel value is less then 0 - execute calculation no.2, If above 0 - execute calculation no.3). Of course in the same raster can be both cases, so I need it to indeed chech every pixel and execute the appropiate following calculation per pixel.

Any idea how to do such thing ?


You can use the conditional tool: Con((raster<x),(eq1),Con((raster>x), (eq2),(eq3 or constant))) where eq1 your first calculation for true statement, eq2 your calculation for your second true statement and eq3 or a constant for your false statement.

For example, for dataset Raster1 that has value ranging between 1:10, if Raster1 <=5 but >0 you need to multiply the values, if Raster1 is >5 you want to add the values and if it is 0 you want to set it to -1.

Con(((Raster1 >0) &(Raster1 <= 5)),(Raster1 x Raster1), Con((Raster1 >5), (Raster1 +Raster1),-1))

| improve this answer | |

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.