gis-e1060 - spatial analytics: map algebra and raster analysis

41
GIS-E1060 - Spatial Analytics: Map algebra and raster analysis Jaakko Madetoja 12.11.2020 Slides partly adopted from Kirsi Virrantaus & Paula Ahonen-Rainio

Upload: others

Post on 10-May-2022

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

GIS-E1060 - Spatial Analytics: Map algebra and raster analysisJaakko Madetoja12.11.2020Slides partly adopted from Kirsi Virrantaus & Paula Ahonen-Rainio

Page 2: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 3: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 4: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 5: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 6: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 7: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 8: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 9: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Examples

11.11.2020

9

Bolstad: GIS Fundamentals

plus 4

neighbourhood

maximum

global

maximum

Page 10: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 11: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 12: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 13: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

11.11.2020

13

Tomlin: GIS and Cartographic Modeling

Page 14: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: Reclassification

11.11.2020

14

Bolstad: GIS Fundamentals

Page 15: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: enjoyable (landscape) areas in Espoo

for locals for tourists for landscape experts

11.11.2020

15

Reclassify land cover based on preferences:

Page 16: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 17: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 18: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Examples

• Focal Sum

• Edge detection

• This is actually calculated using a custom mask called high-pass filter:

11.11.2020

18

Page 19: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: Filtering

11.11.2020

19

Bolstad: GIS Fundamentals

Page 20: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: Edge detection

11.11.2020

20

Tomlin: GIS and Cartographic Modeling

Page 21: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 22: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: Zonal average

11.11.2020

22

Bolstad: GIS Fundamentals

Page 23: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 24: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example

11.11.2020

24

Page 25: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Further raster analysis

• Digital elevation model and its derivates

• Watershed

• Viewshed

• Cost surface analysis

11.11.2020

25

Page 26: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 27: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: Analysing the watershed

11.11.2020

27

Bolstad: GIS Fundamentals

Page 28: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: Viewshed

11.11.2020

28

Bolstad: GIS Fundamentals

Page 29: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

Example: landscape planning

11.11.2020

29

(Juanjo Galan, MAR-E1046 GIS in Landscape Planning)

Page 30: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 31: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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

Page 32: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

An example: Forest fire risk analysis

11.11.2020

32

(Amakihe, Bloch, Gyinaye, Toivanen;

course project work, 2014)

Page 33: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

An example: Forest fire risk analysis

11.11.2020

33

Page 34: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

An example: Forest fire risk analysis

Final risk map

11.11.2020

34

Page 35: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

An example: Picking mushrooms

11.11.2020

35(course project work, 2012)

Page 36: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

An example: Picking mushrooms

Final map for finding mushrooms and hot spot analysis after

generalization

11.11.2020

36

Page 37: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

An example: Picking mushrooms

11.11.2020

37

Page 38: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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)

Page 39: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

A complex example: Flood in a mine

How fast the water will reach a given area:

11.11.2020

39

Page 40: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

A complex example: Flood in a mine

Escape route using

previous raster as a cost

surface

11.11.2020

40

Page 41: GIS-E1060 - Spatial Analytics: Map algebra and raster analysis

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