Available with Spatial Analyst license.
Map Algebra is a simple and powerful algebra with which you can execute all Spatial Analyst tools, operators, and functions to perform geographic analysis. Map Algebra is available through the Spatial Analyst module; an extension of the ArcPy Python site package. As Map Algebra has been integrated in Python, all the functionality of Python and ArcPy and its extensions (modules, classes, functions, and properties) is available to you.
Spatial Analyst tools are accessed through an algebraic format. That is, an object whose name is identified to the left of an equal sign is created based on a tool or operator stated to the right of the equal sign.
from arcpy.sa import *
outRas = Slope("indem")
The above statement calculates the slope for each cell in the indem dataset and creates a Raster object called outRas to store the results. Specific information on importing the Spatial Analyst module to utilize Map Algebra can be found at Importing the Spatial Analyst module.
Map Algebra within Python is composed of tools, operators, functions, and classes. For more information on the syntax rules of Map Algebra, refer to the following resources:
- Overview of the rules for Map Algebra
- Working with raster objects
- The Raster object
- An overview of Spatial Analyst classes
- Building complex statements