Map algebra

Map algebra, also known as cartographic modeling, is a simple yet powerful algebra that utilizes a variety of tools, operators, and functions to perform geographic analysis using raster data. It can be used to manipulate geographic data using a mathematical function to obtain desired information or results such as converting units, combining values, or selecting data within specific ranges.

Map algebra was proposed by Dr. C. Dana Tomlin in the early 1980s. Tomlin proposed primitive operators for processing geographic data. This method can only process raster inputs and outputs by classifying all GIS operations into four classes: local, focal, global, and zonal. When expressing a model, this method is useful in creating a simple script for that model to follow. This "script" allows for a procedure to be followed that can perform complex tasks.



Map Algebra Functions
There are four basic function types used in map algebra :
 * Local Operations: examine rasters cell by cell comparing the value in each cell in one layer with the values in the same cell in other layers (i.e. average elevation)
 * Focal Operations: compare the value in each cell with the values in its neighboring cells (i.e. moving windows)
 * Global Operations: produce results that are true of the entire layer (i.e. Euclidean distance)
 * Zonal Operations: compute results for blocks of contiguous cells that share the same value and then attach their results to all of the cells in each contiguous block (i.e. total mean volume of precipitation from a watershed zone)

Map algebra functions need to follow some rules in order to combine all of it's components, the same way languages follow rules to communicate better. The function needs to have a name followed by an assignment operator (=) that separates the action and the output of the function. Map algebra calculation are used to determine slope, mean value or hill-shade. There are, as well, different tools used to create map algebra expressions. Some examples from the Geoprocessing tool are buffer, clip, integrate, etc.

Syntax and Applications
Within the four basic operations, there are more specific operations that can be used, these include :
 * Arithmetic operations - addition, subtraction, multiplication, division etc. (i.e. average rainfall between two raster sets)
 * Relational operations - used to return true or false results; expressions include equals, greater than, less than etc. (i.e. "rainfall < 6 inches")
 * Boolean operations - used to combine multiple conditions in an expression using AND, OR, NOT etc. (i.e. "rainfall < 6 inches AND elevation < 1000 feet")
 * Statistical Operations - minimum, maximum, average, median etc.
 * Trigonometric Operations - sine, cosine, tangent, arcsine etc.
 * Exponential & Logarithmic Operations - exponent, logarithm etc.

Additionally, GIS software contains many preset map algebra functions, allowing tasks to be performed without the user having to assemble them. Examples include slope calculation or creation of shaded relief from an elevation data set.

Using Map Algebra in Esri's ArcMap and ArcGIS Pro
Esri's ArcMap and ArcGIS Pro are examples of mapping software that are capable of map algebra. Map algebra can be used to run simple statements as well as more complex statements with the integration of python. Simply, the user inputs tools and operations to receive an output of some desired layer. Map Algebra can be run using three tools: The Raster Calculator tool, the Python Window, and Python integrated development environment.
 * Raster Calculator - an embedded calculator that allows the user to execute map algebra expressions and output a result. It can be used as a single tool or be used in Esri's ModelBuilder.
 * Python Window - a convenient place to use geoprocessing tools and python script. It is a beneficial tool for users that are new to python.
 * Python integrated development environment (IDE) - a learning environment that aids in the assistance of learning python. A good learning environment could provide help with code templates, highlighting, and tools for debugging.

GIS&T Body of Knowledge Concept
This page is part of topic AM4-4 in the 2006 GIS&T Body of Knowledge. It is also referenced in AM1-2, AM1-2-4, AM4-3, and GC3-4-2 in the 2006 GIS&T Body of Knowledge

Additional References

 * Demers, Michael N., Fundamentals of Geographic Information Systems
 * Map Algebra, ArcGIS Spatial Analyst, www.esri.com, Accessed 7 September, 2011.
 * Huber, William A. Introduction to Map Algebra. Penn State - Great Valley, Accessed 7 September, 2011.
 * Hurvitz, Phil, Raster Analysis & Map Algebra, FM 490, University of Washington, College of Forest Resources, Accessed 7 September, 2011.
 * Grid function types in Raster Analysis I, ESRM 250, Introduction to Geographic Information Systems in Forest Resources, University of Washington. Accessed 7 September, 2011.
 * Map Algebra, Department of Geography and Environmental Studies, Bar Ilan University. Accessed 7 September, 2011.