Select to view content in your preferred language

Raster calculator expressions - not transferable to 10.1?

488
1
05-08-2013 11:04 AM
CyndyBresloff
Emerging Contributor
Another question! 

I am in the process of updating a bunch of scripts written not by me, that work under arc 9.2, to work under 10.1.  The original author used many raster calculator string expressions that were then executed like:

gp.SingleOutputMapAlgebra_sa(stringExpression, rasterOutput)

If I understand correctly, there is no string expression input based way to do this, in 10.1.  I need to create the equivalent operations with raster objects, as seen here:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v000000wt000000

Correct?   I want to make sure, before I go reinventing the wheel, that I need to do this.  Thanks!
Tags (2)
0 Kudos
1 Reply
Luke_Pinner
MVP Regular Contributor
If I understand correctly, there is no string expression input based way to do this, in 10.1.


SingleOutputMapAlgebra is still supported, I assume for backwards compatibility. i.e.

>>> import arcpy
>>> print  arcpy.__path__
['c:\\Program Files (x86)\\ArcGIS\\Desktop10.1\\arcpy\\arcpy']
>>> print arcpy.gp.SingleOutputMapAlgebra
<function <lambda> at 0x1748C3B0>
>>> import arcgisscripting
>>> gp=arcgisscripting.create()
>>> gp=arcgisscripting.create(10.1)
>>> print gp.singleoutputmapalgebra
<Tool: 'Single Output Map Algebra'>


However... I find the new raster object map algebra syntax to be much easier to use and much more flexible. Also, it's more future proof than relying on something that may not be available later on.
0 Kudos