1

I have two raster "T" and "N" which have values ranging from 0 to 1000. This is the logic that I want to query and create the new raster:

query logic

This is how I tried to query in a syntax-correct way in the Raster Calculator in ArcGIS, but the resulting raster only shows the value "1", but no error.

Con(("T.tif" < 50) & ("N.tif" < 40), 100, 0) | 
Con(("T.tif" < 50) | ("N.tif" < 40), 80, 0) |    
Con(("T.tif" < 55) & ("N.tif" < 45), 60, 0) | 
Con(("T.tif" < 55) | ("N.tif" < 45), 40, 0) | 
Con(("T.tif" < 60) & ("N.tif" < 50), 20, 0)

What am I doing wrong?

1 Answer 1

3

I think you want to use nested Con statements, like is described here to build your if-elif-else structure, instead of Con() | Con() | Con(). Instead of saying:

Con(queryA, trueA, falseA) | Con(queryB, trueB, falseB) | etc...

You should phrase it as:

Con(queryA, trueA, Con(queryB, trueB, Con(...)))

where the innermost Con() statement will have 0 as it's false value.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.