gis-e1060 - spatial analytics: map algebra and raster analysis
TRANSCRIPT
GIS-E1060 - Spatial Analytics: Map algebra and raster analysisJaakko Madetoja12.11.2020Slides partly adopted from Kirsi Virrantaus & Paula Ahonen-Rainio
Learning goals
In this session you will learn
• To explain what different types of Map algebra operations are
• To list examples where Map algebra can be used
• To explain what watershed, viewshed and cost surface
analysis are
11.11.2020
2
Grid representation
• Geometry
• Shape of a pixel: usually a square (can be a triangle, a hexagon)
• Square pixel: • 4 neighbors (joint edge)
• 8 neighbors (joint edge or corner)
• Implicit topology
• Joint edge – adjacency (viereisyys)
• Joint edge or corner – connectivity (yhdistävyys)
• Orientation, origin, resolution (size of a pixel/grid cell)
11.11.2020
3
X
X
Applications with raster data
• Environmental applications with source data from satellite images
• E.g., detecting changes in land use, vegetation
• Elevation model based analyses
• Visibility: e.g. locating telecommunication towers, view from a road in landscape planning, military applications
• Slope (kaltevuus) and aspect (suunta): e.g. watershed (vedenjakaja), catchment areas, risk of avalanche
• Analyses on statistical (grid) data (Statistics Finland)
• Terrain and mobility analyses
• For crisis management and military applications, prediction of animal movement, forestry
11.11.2020
4
Raster vs. vector
• Environmental applications: Remote sensing produces raster images
• Elevation and visibility: elevation is continuous; difficult to model with vector
• Statistical grids: Sometimes it might be a better idea to use grid as vector type
• Terrain and mobility analyses: For example shortest route analysis with raster allows mobility everywhere; with vector only on roads
11.11.2020
5
Map algebra (kartta-algebra)
• Developed by Dana Tomlin: “GIS and Cartographic modeling” (ebook)
• Map algebra is a formal language for raster analysis
• Forms the basis of raster operations
• Key concepts:
• Layers: Input1, Input2, …, InputN, Output• Definition of neighborhood, zones• Functions: Min, Max, Boolean, arithmetic,…
11.11.2020
6
Map algebra
• A set of primitive operations, which allows two or more raster layers to produce a new raster layer using operations
• Operations on one pixel, neighborhood, zone or entire layer
• By combining these, one can define a procedure to perform complex tasks
• A formal language, an open standard
• Forms the basis of raster tools in many GISs
• Spatial analyst –toolbox in ArcGIS
11.11.2020
7
Map algebra
• Operations on a raster are of four types
• Local operations are determined by the attributes of one cell, usually for many layers
• Focal operations are determined by a cell and its neighbors
• Zonal operations apply to cells within the same zone
• Global operations compute properties of the entire raster layer
11.11.2020
8
Examples
11.11.2020
9
Bolstad: GIS Fundamentals
plus 4
neighbourhood
maximum
global
maximum
Local functions
• Input1, Input2, … => Output
• Operations on one pixel at a time, e.g.
• Local Difference
• Local Maximum
• Local Ratio
• Local Sum
• Raster version of map overlay
11.11.2020
10
Figure by ESRI
Map overlay
• Example of map
overlay analysis made
by using raster data
on the right. In each
pixel the layer value is
considered and the
chosen operation is
then performed.
11.11.2020
11
Examples
• Operations can also be Boolean:
• On each layer, possible values for each cell are 1 or 0
• E.g., suitability of a region to a certain purpose by logical reasoning: different layers have binary values for each location, the result based on the logics on these values
• Local map algebra example: visualizing contours using DEM:
• Divide all values of pixels by 10, multiply the integer result by 10, subtract this value from the original; color each value according to the following: values 4 and 6, 3 and 7, 2 ja 8 and 1 ja 9 get the same color, 0 is white, 5 is black; one meter contours
11.11.2020
12
11.11.2020
13
Tomlin: GIS and Cartographic Modeling
Example: Reclassification
11.11.2020
14
Bolstad: GIS Fundamentals
Example: enjoyable (landscape) areas in Espoo
for locals for tourists for landscape experts
11.11.2020
15
Reclassify land cover based on preferences:
Example: enjoyable (landscape) areas in EspooFinal preference map as a weighted sum: Locals 40%, tourists
30%, experts 30%
See exercise 4.
11.11.2020
16
Focal functions
• Input1, neighborhood => Output
• Operations on a pixel and its 4 (or 8, or 32, or…) neighboring pixels, e.g.• FocalMaximum• FocalMean• FocalStandardDeviation
• For example,• Smoothing the map layer by FocalAverage; high and low values are smoothed
away (continuous values)• Generalization by filtering out individual pixels that differ from their
surrounding (categorical values)• Mobility simulation by producing a cost surface of mobility
11.11.2020
17
Examples
• Focal Sum
• Edge detection
• This is actually calculated using a custom mask called high-pass filter:
11.11.2020
18
Example: Filtering
11.11.2020
19
Bolstad: GIS Fundamentals
Example: Edge detection
11.11.2020
20
Tomlin: GIS and Cartographic Modeling
Zonal functions
• Input1, zones => Output
• Data is related to some zoning
• For example,
• ZonalSum• ZonalMaximum• ZonalAverage
• Example:
• Calculate the amount of apartments in a block: ZonalSum• Calculate the most common soil type for each land cover area: ZonalMode (or
ZonalMajority in ArcGIS)
11.11.2020
21
Example: Zonal average
11.11.2020
22
Bolstad: GIS Fundamentals
Example
• Energy self-sufficiency in Otaniemi: how big portion of energy consumption can be gathered using solar panels on top of roofs
• Data: Solar energy data, buildings, energy consumption
• Analysis: ZonalSum to get total energy per building
11.11.2020
23
Example
11.11.2020
24
Further raster analysis
• Digital elevation model and its derivates
• Watershed
• Viewshed
• Cost surface analysis
11.11.2020
25
DEM (digital elevation model) and its derivates• Key characteristics: slope, aspect (kaltevuus ja viettosuunta)
• Slope is usually expressed as angle (0-90) or percentage
• Aspect is the direction
of downslope (0-360)
11.11.2020
26
Example: Analysing the watershed
11.11.2020
27
Bolstad: GIS Fundamentals
Example: Viewshed
11.11.2020
28
Bolstad: GIS Fundamentals
Example: landscape planning
11.11.2020
29
(Juanjo Galan, MAR-E1046 GIS in Landscape Planning)
Cost surface
Route on cost surface
• Each cell has determined cost, for example:
- the density of the vegetation
- environmental impacts
- depth of snow
• How to travel from starting point to end point with minimum cost
• Cost distance tools in ArcGIS
11.11.2020
30
Cost surface
11.11.2020
31
http://wiki.gis.com
• Cost surface raster in the
background: red is high cost and
green is low cost
• Black line shows the least
expensive route from origin to
destination
An example: Forest fire risk analysis
11.11.2020
32
(Amakihe, Bloch, Gyinaye, Toivanen;
course project work, 2014)
An example: Forest fire risk analysis
11.11.2020
33
An example: Forest fire risk analysis
Final risk map
11.11.2020
34
An example: Picking mushrooms
11.11.2020
35(course project work, 2012)
An example: Picking mushrooms
Final map for finding mushrooms and hot spot analysis after
generalization
11.11.2020
36
An example: Picking mushrooms
11.11.2020
37
A complex example: Flood in a mine
A flood in a mine:
• Modelling the flood
• Water will fill the lower areasfirst
• Water will reach close by areasearlier than far away areas
• How to escape
• Create a cost surface: the easierfor the water to reach, the higher the cost
• Cheapest route to escape
11.11.2020
38
(Gupta, Lu, Pajukoski;
course project work, 2013)
A complex example: Flood in a mine
How fast the water will reach a given area:
11.11.2020
39
A complex example: Flood in a mine
Escape route using
previous raster as a cost
surface
11.11.2020
40
Further reading
GIS and Cartographic Modeling by C. Dana Tomlin
• Part II Cartographic modeling capabilities
• E-book available
• Lots of calculation examples
11.11.2020
41