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.
No unfortunately it doesn't...you should forward this thread as an "issue" to tech support. There is a tendancy to show simple examples and not complex ones. I don't know if this would classify as a bug, but one would expect & (or any other boolean) to parse the left and the right correctly without the need for brackets. Otherwise indicate said information (via an example perhaps) in the online help files. I would also suggest that everyone use the online help rather than the arcmap help since it is updated and the built-in help is static for version 10 http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html?TopicName=welcome for 9.3 http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=welcome for previous versions substitute your version number in the appropriate spot.