Migrating 9.x scripts and models that use Map Algebra
If you have existing Python scripts or ModelBuilder models that use Single Output Map Algebra (SOMA) or Multiple Output Map Algebra (MOMA) tools, these statements will continue to work and do not need to be converted to ArcGIS 10 Map Algebra syntax.
If you wish to migrate existing scripts to take advantage of ArcGIS 10 Map Algebra, you can either re-create them or modify your existing expressions, keeping the following points in mind:
- Import the ArcPy site package, the Spatial Analyst module, and geoprocessing environment. Learn more about importing the Spatial Analyst module
import arcpy from arcpy.sa import * from arcpy import env
- If necessary, change the syntax to be algebraic:
out = function(parameters)
- Call the save method on the resulting raster object if you want to permanently save the referenced raster dataset associated with the raster object.
Related Topics
6/28/2013