What is Map Algebra?

Available with Spatial Analyst license.

Available with Image 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.

License:

You can also use Map Algebra in Python if you have an Image Analyst extension license available. Not all of the tools available in Spatial Analyst can be used in Image Analyst, however. You can see the categories of available tools in the Image Analyst toolbox overview. The rest of the discussion in the Map Algebra section here will mention Spatial Analyst specifically, but where appropriate it will apply equally well when using the functionality with an Image Analyst license.

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.

To use the tools with an Image Analyst extension license, the syntax would be to import the ia module:

from arcpy.ia import *
outRas = Slope("indem")

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:

Related topics