AnsweredAssumed Answered

Con statement error in raster calculator

Question asked by rrupp on Sep 17, 2010
Latest reply on Sep 20, 2010 by Dan_Patterson
I'm trying to pull out the cells from 2 8-bit integer rasters (same area, different years) that have the same value. The raster calculator statement:

Con("raster1" == 61 & "raster2" == 61, 1, 0)

The error: rcexec()<type 'exceptions.ValueError'>: The truth value of a raster is ambiguous.

These are FGDB rasters, but I get the same results with grids. I've also tried this on a couple of different computers, and I've created a couple of similar random rasters with the same results. If I break the statement down into simple one (ie Con("raster1" == 61, 1, 0)) it will run.

One possibility is that the raster properties  report both rasters as having a continous data type rather than discrete. I'm not sure how to change that.

I know I can do some reclass work arounds, but I'm at the beginning of a modelling project, and I am hoping to build some more complex Con statements. Any advice is welcome.

I'm working with ArcGIS 10 Arcinfo on 64-bit Windows 7.

Outcomes