Select to view content in your preferred language

Spatial - Map Algebra and Raster Calculator

1845
15
11-09-2009 05:54 PM
SteveKopp
Esri Contributor
Several threads have touched on the changes to the Spatial Analyst Map Algebra and disappearance of the Raster Calculator. For all you who love Map Algebra and the Raster Calculator, the team agrees with you! The changes we have made to the Map Algebra language to make it integrate well with Python do change the language, but we feel it still looks and behaves enough like Map Algebra that you???ll feel the benefit is worth it.

There are two Map Algebra experiences, the scripting experience and the raster calculator experience. Improvements to the language were made to improve the scripting experience. Having Map Algebra tightly integrated with our native scripting environment, Python, has not been possible except in Workstation when we wrote our own verison of both. Python provides a rich set of capabilities for you to take advantage of and integrate with our out of the box tools. We believe that Python will be the language of GIScience and this integration will play a key role. A feature you will see in beta2 that compliments this is  the ability to move blocks of pixels back and forth between ArcGIS rasters and Python arrays, allowing you to write your own raster analysis tools.

The other side of Map Algebra is the raster calculator experience. We know that the Python window is not a substitute for the point and click experience and direct output of the raster calculator. We plan to build a calculator-like tool that will provide the point and click experience but also be something that you can drop into a model. Envision a combination of the old raster calculator and the SOMA tool. Unfortunately it won???t make it into beta2.

And while I have your attention I???d like to suggest that if you have colleagues who seldom use Spatial Analyst, don???t make them learn Map Algebra. Show them where to find the tools and run it from the dialogs, or better yet build them a little ModelBuilder model with a couple parameters exposed and hide all the details.

Steve
0 Kudos
15 Replies
EricRice
Esri Regular Contributor
Thomas,

If you note what Steve said in the first post to this thread you will find info regarding your question.  You will have to wait until post beta 2.

"We plan to build a calculator-like tool that will provide the point and click experience but also be something that you can drop into a model. Envision a combination of the old raster calculator and the SOMA tool. Unfortunately it won�??t make it into beta2."

Regards,
0 Kudos
curtvprice
MVP Esteemed Contributor
I wonder how I can use any Map Algebra in a model without having the SOMA Tool?


I think it's also really good news that we can still get to SOMA (or MOMA if we REALLY need it, say for $$ROWMAP,$$COLMAP) through the old arcgisscripting object.

In ModelBuilder, you could use Calculate Value to run a python script (or use a script tool) to access SOMA/MOMA -- in the unlikely 😉 case that the new "calculator tool" doesn't do what you need at 9.4.0.
0 Kudos
GaryHecox
Deactivated User
Regardless of what is in the inital post to this thread, based on the 9.4 b2 help menu and the reply back from the ERSI support people today on my 9.4 Beta 2 comments, it appears that the easy to use and powerful Raster Calculator is now gone from ArcGIS 9.4/10.  The response has been very clear that Raster Calculator has been removed from ArcGIS and replaced by Python Map Algebra scripting.  This is a major loss in the capabilities of ArcGIS to analyze rasters and perform raster math.  What used to take a few minutes with the Raster Calcualtor now will take much longer as people have to try and stumble through the issues associated with Python scripting.  I wish ESRI would understand that the vast majority of GIS analysts are not and never will be computer programmers.  They are hired to perform spatial analysis and create maps, not write computer code.  The disappearance of Raster Calculator in 9.4/10 is a huge loss for us.
0 Kudos
curtvprice
MVP Esteemed Contributor
The jury is out - raster calculator has some huge shortcomings in terms of validation and its lack of integration with the rest of the geoprocessing environment.

I do hope the raster team can post a video or an early patch of the graphical interface to create command line map algebra, or a video showing how raster calculator type stuff can be done in the python command line window.

With the intellisense etc I would think it may be *easier* to use than the raster calculator. We will see though.... I need to play with it a bit before I decide whether this is a net negative.

The biggest issue is the loss of a map algebra tool within modelbuilder, but there are workarounds.

May I suggest you post a use-case of a raster calculator expression you would normally do and maybe someone from the raster team can walk you through how to do it in 9.4?
0 Kudos
curtvprice
MVP Esteemed Contributor
When I do this at the ArcMap command line (9.4b2):

>>> atanb6  = Ln(upareag + 1) / Tan((Raster("nedslp") + 1) * (3.14 / 180.))

I get a layer in my map. If I hit the back button and do it again with a slight change (like I am used to in Grid), nothing happens (apparently).

>>> atanb6  = Ln(upareag + 1) / Tan((Raster("nedslp") + 1) * (3.14 / 181.))


I need to change the name of the output:

>>> atanb7  = Ln(upareag + 1) / Tan((Raster("nedslp") + 1) * (3.14 / 181.))


This works - a new layer is created in the map with the output.

I would expect the layer to be re-written with a new result, not nothing to happen. What's going on, and does this deserve an error message of some type?
0 Kudos
TedCronin
MVP Honored Contributor


I do hope the raster team can post a video or an early patch of the graphical interface to create command line map algebra, or a video showing how raster calculator type stuff can be done in the python command line window.


Is there a possibility in this happening, because I too would be interested in seeing a prototype.
0 Kudos