# 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. [1] 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. [2] This "script" allows for a procedure to be followed that can perform complex tasks.

The algebraic expressions used in map algebra range from simple addition and subtraction to lengthy and highly complex equations. This image displays the syntax and a visual representation for creating a normalized difference vegetation Index (NDVI) index using map algebra.

### Map Algebra Functions

There are four basic function types used in map algebra [2][3]:

• 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 [4]. 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 [3]:

• 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. [6]

• 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. [7]
• Python Window - a convenient place to use geoprocessing tools and python script. It is a beneficial tool for users that are new to python. [8]
• 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. [9]

### 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 [10]

## Bibliography

1. ESRI, "What is Map Algebra?", http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00p600000002000000, Accessed September 9, 2013.
2. Longely et al. [Geographic Information Systems and Science "Chapter 16"], 2006
3. "Map Algebra: Global, Zonal, Focal and Local Operations", GIS Geography, July 30, 2016 Accessed September 23, 2016.
4. ArcGIS Help, Overview of the rules for Map Algebra", http://desktop.arcgis.com/en/arcmap/10.3/guide-books/extensions/spatial-analyst/map-algebra/an-overview-of-the-rules-for-map-algebra.htm, Accessed September 25, 2017.
5. ArcGIS Help, Overview of the rules for Map Algebra", http://webhelp.esri.com/%5Carcgisdesktop/9.2/index.cfm?TopicName=An_overview_of_commonly_used_tools, Accessed September 25, 2017.
6. ESRI, "A quick tour of using map algebra", http://desktop.arcgis.com/en/arcmap/latest/extensions/spatial-analyst/map-algebra/a-quick-tour-of-using-map-algebra.htm , Accessed September 24, 2017.
7. ESRI, "Raster Calculator", http://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/raster-calculator.htm , Accessed September 24, 2017.
8. ESRI, "What is the Python Window?", http://desktop.arcgis.com/en/arcmap/10.3/analyze/executing-tools/what-is-the-python-window-.htm , Accessed September 24, 2017.
9. ESRI, "Writing Python Scripts", http://desktop.arcgis.com/en/arcmap/10.3/analyze/executing-tools/writing-python-scripts.htm#GUID-AF4B8D9D-0C71-461D-ADCA-DC85C81177E4, Accessed September 24, 2017.
10. DiBiase D, DeMers M, Johnson A, Kemp K, Luck T, Plewe B, Wents E. "Geographic Information Science & Technology Body of Knowledge" http://www.aag.org/galleries/publications-files/GIST_Body_of_Knowledge.pdf (2006)