Select to view content in your preferred language

Raster Calculator fails in ModelBuilder but works when used as individual tool

2115
2
12-11-2012 05:04 AM
StephanieFrank
Deactivated User
Hello,

I am building a model in ModelBuilder to identify suitable locations, and I am trying to use Raster Calculator as a mechanism for selecting out pixels for a suitable location based on environmental variables (slope, soil texture, etc...). I initially use Raster Calculator on 3 input rasters to change all suitable cells for that particular environmental variable to have a value of 1 and all remaining unsuitable cells to 0. I then use Raster Calculator again to sum the output rasters, producing a final raster that contains only suitable location cells. The model will run up until the final step, which is using Raster Calculator to sum the individual output rasters. The map algebra expression looks like this:

"%rastercalc%" + "%rastercalc2%" + "%rastercalc3%"

I receive the error message that is attached. However, when I take the output rasters generated in ModelBuilder and then run Raster Calculator outside of ModelBuilder to sum them, the result is successful. I am not sure why this is happening. Any help?
0 Kudos
2 Replies
JeremyWilliams
Emerging Contributor
We've got a similar situation here, one of the analysts cannot run Raster Calc in Model Builder.  The model is fine, it runs on any other machine.  We uninstalled reinstalled 10.1 to see if that helped, with no change.  We are going to try a different user on the same machine (corrupted profile) or a re-image of the computer to see if that fixes it.

I will update once we do this...
0 Kudos
curtvprice
MVP Alum
I would expect your expression to look more like:

"rastercalc" + "rastercalc2" + "rastercalc3"

with the three names showing up in the Raster Calculator tool dialog box. I'm assuming the three names are raster datasets or raster layers that are elements in the model.

I'll also mention that the above expression would probably be handled easier (and more efficiently, and with handy additional option on how NoData cells are handled) using the Cell Statistics tool instead of Raster Calculator.
0 Kudos