Select to view content in your preferred language

Raster calculator in ModelBuilder?

5254
8
04-06-2010 12:30 PM
ChristopherJursa
Emerging Contributor
Hello,

Is it possible to use the raster calculator outside of the Spatial Analyst drop down menu?

I would like to run it in a model I am building in ModelBuilder.  Is this possible?  Is it possible to use in a Python script as well?

I am asking as I have a model set up with other functions.  However, before the end, I want to run a special equation and use the output for another function.

Thanks in advance.
0 Kudos
8 Replies
CrystalDorn
Esri Contributor
Hello,

Is it possible to use the raster calculator outside of the Spatial Analyst drop down menu?



Check out the Single_Output_Map_Algebra'>Single Map Algebra Output Tool in Spatial Analyst Toolbox > Map Algebra Toolset.

It can be used in ModelBuilder.  I assume you are working with 9.3 or 9.3.1.

Also, the Multi Output Map Algebra tool might be of interest for your workflow.
0 Kudos
ChristopherJursa
Emerging Contributor
Hi, thanks!

I simply want to multiply my grid * 0.3048 to convert feet to meters.

How would I do so with this tool?
0 Kudos
DanPatterson_Retired
MVP Emeritus
why not use the Times tool (Spatial analyst tools, Math toolset, Times tool
0 Kudos
ChristopherJursa
Emerging Contributor
The times tool worked great.  Thanks!
0 Kudos
ELENIMOUGIAKOU
Emerging Contributor
I need to use rater calculator into the model builder. The equation I need to enter is the following:

con ([recl_pop_dens] eq 0, 0, ~
                     [recl_pop_dens] eq 1 and [recl_plus] eq 3, 1, ~
                     [recl_pop_dens] eq 1 and [recl_plus] eq 2, 2, ~
                     [recl_pop_dens] eq 1 and [recl_plus] eq 1, 3, ~
                     [recl_pop_dens] eq 2 and [recl_plus] eq 3, 2, ~
                     [recl_pop_dens] eq 2 and [recl_plus] eq 2, 3, ~
                     [recl_pop_dens] eq 2 and [recl_plus] eq 1, 4, ~
                     [recl_pop_dens] eq 3 and [recl_plus] eq 3, 4, ~
                     [recl_pop_dens] eq 3 and [recl_plus] eq 2, 5, ~
       [recl_pop_dens] eq 3 and [recl_plus] eq 1, 6, ~
           4)

Note that [recl_pop_dens] and [recl_plus] are rasters generated from the same model. I do not really understand how to use Multy Output Map Algebra.

Any help would be very much appreciated
0 Kudos
ToreBorvik
Occasional Contributor
Can multi output be used in modelbuilder? I thought it couldn't.
0 Kudos
ELENIMOUGIAKOU
Emerging Contributor
Bill thanks a lot for your effort to help me.

My equation is working perfectly in the map - Raster Calculator (probably isn't correct for the use of model builder). Your interpretation is not totally correct but anyway, I do not understand who to use something like this in the model builder, which is my main problem.
0 Kudos
ELENIMOUGIAKOU
Emerging Contributor
Thanks Bill, SOMA works fine!!!! (I do not know why all this time I was trying with MOMA )
0 Kudos