if raster: print "True!" else: print "False!"
>>> out = raster1 == 1 & raster2 == 2 Traceback (most recent call last): File "<interactive input>", line 1, in <module> ValueError: The truth value of a raster is ambiguous. Invalid use of raster with Boolean operator or function. Check the use of parentheses where applicable.
out = raster1 == (1 & raster2) == 2
tmpA = 1 & raster2 out = raster1 == tmpA and tmpA == 2
out = rasterA and rasterB
>>> out = (raster1 == 1) & (raster2 == 2)
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.