Imagine being able to calculate fire risk, map potential flood zones, or identify ideal hiking trails—all by applying mathematical logic to your maps. That’s the power of map algebra: a toolset that turns raw geographic data into answers to real-world questions.
The term “map algebra” was coined by Dr. Dana Tomlin in the 1980s and revolutionized raster-based spatial analysis in GIS.
Performing Map Algebra Functions
Map algebra powers a lot of the geospatial analyses in GIS, from simple calculations to more involved workflows. It helps you combine raster layers, apply mathematical operations, and create new spatial insights. Whether you’re identifying areas suitable for a hiking trail or mapping flood risks, map algebra can help you turn raw data into maps, reports, and data dashboards that provide valuable insights.
How might combining different layers of spatial data help you answer a real-world question in your community?
Exercising control in cartographic modeling
Modern GIS platforms like ArcGIS Pro and QGIS make map algebra much more accessible than in the early days of GIS, when it required tedious command-line operations or custom programming. Ready-to-use tools like the Raster Calculator walk you through the process, allowing you to:
- Choose inputs: You can add raster data layers, tables, or constants.
- Define operations: You use math operators (+, −, *, /) and logical expressions (<,>, AND, OR) to combine data.
- Visualize results: You can see the output of your operations as you perform them.
As an example of using map algebra, here are steps you might take to map fire risk for an area:
- Add rasters for slope and vegetation density.
-
Use this formula: (Slope > 15) AND (Vegetation > 70).
The output highlights steep slopes and dense vegetation, which are important factors in assessing fire risk and planning mitigation efforts.
The use of logical operators, like the ones that appear in the preceding Step 2, simplifies complex queries. When you need to focus on specific conditions such as finding areas with a steep slope AND dense vegetation, logical expressions work great.
What kinds of questions could you answer by combining raster data using logical expressions?
Using local functions
Local functions are the simplest type of map algebra because they work on individual cells without considering neighboring ones. Each cell in the output is calculated independently based on one or more input layers.
Figure 16-2 shows an example of how a local function works, which is by adding two rasters together, cell by cell. Notice how each cell in the output is the sum of corresponding cells from the input rasters; for example:
- The top leftmost cell in the first raster is 8, and the top leftmost cell in the second raster is 1. Adding the two cells together, the output cell in the top leftmost position becomes 9.
- This operation is repeated independently for each of the corresponding cells in the raster grids.
Table 16-1 lists some common types of local functions and what you do with them. The functions listed in the table are primarily for ArcGIS Pro’s Raster Calculator and Map Algebra. Many of the functions also work in QGIS, but QGIS often relies on simpler mathematical expressions instead of named functions.
Want to go deeper? The science behind local, focal, and zonal functions
While local functions operate on single cells, map algebra also includes focal functions (which consider a cell’s neighbors—useful for smoothing or edge detection) and zonal functions (which consider all cells within a defined region or “zone”—helpful for aggregation). Understanding the differences helps you select the right tool for your analysis.
Type of Function |
Functions |
Use |
Example |
|---|---|---|---|
Selection |
|
Use logical conditions to extract specific values. |
Find all cells where land use equals “forest” and elevation > 500 meters. |
Trigonometric |
Sin(), Cos(), Tan(), Atan() |
Perform calculations like sine and cosine. |
Useful for advanced mathematical or terrain analysis like modeling solar radiation. |
Exponential and logarithmic |
Exp(), Log(), Sqrt(), Power() |
Handle transformations like squares, cubes, and log base 10. |
Often used in scaling or normalizing data. |
Reclassification |
Reclassify(), Remap() |
Change cell values based on rules. |
Group elevation ranges into categories like “low,” “medium,” and “high.” |
Statistical |
|
Compute mean, median, or other statistics across layers. |
Find the average value across several datasets for each cell. |
A set of operations that enables mathematical and logical manipulation of raster data to create new spatial layers and insights.
An operation in map algebra where each output cell value is computed independently based on the corresponding value(s) from the input raster(s).
Urban planners use map algebra to identify potential locations for new parks by overlaying population density, land cost, and proximity to green space.
Map algebra is only for advanced programmers or GIS experts.
Modern GIS platforms provide user-friendly tools like Raster Calculator, making map algebra accessible to anyone with basic GIS skills.
How does understanding the difference between local, focal, and zonal functions help you choose the right analysis tool for your project?
- Map algebra combines mathematical and logical operations with spatial data for powerful analysis.
- Local functions process each cell independently, enabling fast and flexible data transformation.
Practice using a local function to combine two raster datasets in your GIS software.
- Open your GIS platform (e.g., QGIS or ArcGIS Pro) and load two raster layers of the same extent (e.g., elevation and rainfall).
- Open the Raster Calculator tool.
- Enter an addition expression (e.g.,
"Elevation" + "Rainfall"). - Run the calculation and view the output raster—each cell value should be the sum of the respective input cells.
Describe a situation where you would use a local function versus a logical expression in map algebra. How would your approach differ?
What is a local function in map algebra?
Tap to revealAn operation where each output cell value depends only on the values at the same location in the input raster(s).
Give an example of a logical expression used in map algebra.
Tap to reveal(Slope > 15) AND (Vegetation > 70) — highlights areas meeting both conditions, such as fire risk zones.
What is the primary purpose of the Raster Calculator tool?
Tap to revealIt allows users to perform mathematical and logical operations on raster datasets to generate new spatial outputs.
Which type of map algebra function calculates each output cell value without considering neighboring cells?
Map algebra enables you to combine, analyze, and transform raster data through mathematical and logical operations, providing powerful tools to answer spatial questions and solve real-world problems.
Map algebra can help you turn raw data into maps, reports, and data dashboards that provide valuable insights.
Local functions in map algebra process each cell independently, making them ideal for fast calculations and flexible data manipulation in GIS workflows.
How might you use map algebra in a project to address an environmental or urban planning challenge?
The Shift
- Map algebra empowers you to analyze spatial data by applying mathematical and logical operations to raster layers.
- Local functions are straightforward yet powerful, enabling cell-by-cell calculations for rapid data transformation.
- Modern GIS tools make these advanced analyses accessible to all, not just programming experts.