26/06/2024
Department of Geomatics Engineering
Design and Implementation of GIS (GE 350)
Lecturer: Michael Mutale
Mobile: +260 96 254 9674
Date: Wednesday, 26 June 2024
Design and Implementation of GIS (GE 350)
Outline
• Raster Data
• Raster analysis techniques
– Map Algebra and Boolean overlay
– Other functions
1
26/06/2024
Design and Implementation of GIS (GE 350)
Raster Data
• A data set composed of an array of numeric
values, each of which represents a condition
in a square element of ground.
X, Y
X, Y
Columns location
location
Rows
Raster data file
N rows by M columns Georeferenced to earth’s
surface
3
Design and Implementation of GIS (GE 350)
Pixels or Cells
30m
• Each pixel contains 3 1 4 4 1 30m
one numeric value
3 1 4 4 1
• Dimension of a pixel
varies (resolution) 6 2 1 1 2
• Value represents some 5 4 3 3 4
property of that pixel 3 1 4 4 1
area, e.g. elevation or
rainfall
Unlike a polygon, each cell
• Values may be integers has only ONE attribute: its
or floating point value.
numbers
Storing multiple values
means storing multiple
rasters.
4
2
26/06/2024
Design and Implementation of GIS (GE 350)
Pixel depth
• The number of bytes used for each pixel
– More bytes = larger numbers = more space
• Integer values
– 8-bit pixel (one byte) stores 0 - 255
– 16-bit pixel (two bytes) stores 0 - 65,565
– 24-bit pixel (three bytes) stores 0 -16.7 million
• Floating point values
– Required for decimal number storage
– 32-bit pixel (four bytes)
Design and Implementation of GIS (GE 350)
Types of raster data
Discrete raster: land use Continuous raster: DEM
Discrete raster: roads Continuous raster: image
3
26/06/2024
Design and Implementation of GIS (GE 350)
Why use rasters?
• Better at storing certain kinds of data.
• Better at analyzing certain kinds of data.
• Often faster analysis than vectors.
• Imagery desirable for certain maps.
• BUT
– Coordinate precision generally lower.
– High precision has high storage costs.
– Cannot store multiple attributes.
Design and Implementation of GIS (GE 350)
Raster resolution
• Measured by cell size dimensions
• Storage space increases as the square of the
resolution
50 m raster
Vector format 200 m raster
16X bigger!
8
4
26/06/2024
Design and Implementation of GIS (GE 350)
Cell size units
• Cell x-y resolution units are based on the
raster’s coordinate system definition
– Decimal degrees*
– Meters
– Feet
*Because distances and
areas are fundamental to
raster analysis, it is best to
use projected coordinate
systems for rasters.
Design and Implementation of GIS (GE 350)
Raster analysis techniques
• Raster analysis uses cell-by-cell
functions on one or more input grids.
• Cells must be the same size and line up
spatially.
• Older software required the user to
ensure that all input rasters had exactly
the same size, shape, and aligned cell
sizes.
10
10
5
26/06/2024
Design and Implementation of GIS (GE 350)
Resampling
• If input grids do not match, then one
must be resampled to match the other.
Resampling can degrade the accuracy of a
raster even if the difference in cell size
and location is small.
• The new cell grid is determined, and the
old cell values must be fit into the new
structure somehow.
• Several methods are used for resampling.
Y2
11
11
Design and Implementation of GIS (GE 350)
Caution
• ArcGIS automatically resamples rasters for analysis if needed, without
warning the user.
• Because resampling can degrade raster quality, users should be aware
that this may be happening.
• Best practices:
– Strive to create and keep analysis data in aligned rasters with common
extents and cell sizes.
– Use environment settings to enforce common grids for newly created rasters
– Use the available resampling functions to prepare data, so that YOU can
control how resampling happens rather than having the software do it
automatically.
12
12
6
26/06/2024
Design and Implementation of GIS (GE 350)
Map algebra and Boolean overlay
Map Algebra
• Rasters are 5 7 Ingrid1
essentially arrays 2 4
+
of numbers
3 2 Ingrid2
• Can be added, 1 6
subtracted, etc
=
• Line up matching 8 9
cells vertically 3 10
Outgrid
Map algebra
13
13
Design and Implementation of GIS (GE 350)
Map Algebra: Conversions
Precip in cm Precip in inches
[Precip_cm] / 2.54
14
14
7
26/06/2024
Design and Implementation of GIS (GE 350)
Map Algebra: logical operators
• Logical operators produce either TRUE (1) or FALSE (0) values in the output
grid, based on whether a cell meets the condition.
[crowncov] < 70 AND
[Elevation] > 1200 [Slope] < 10
[crowncov] > 40
15
15
Design and Implementation of GIS (GE 350)
Boolean rasters
• Boolean rasters represent maps of True/False
states for a particular condition
1 = True
0 = False
Slope < 10 degrees?
16
16
8
26/06/2024
Design and Implementation of GIS (GE 350)
Boolean operators
A AND B A OR B
A B
Boolean rasters
can be evaluated
further using the
Boolean
operators. A XOR B A NOT B
17
17
Design and Implementation of GIS (GE 350)
Boolean Map Algebra
Compare values of corresponding cells and determine output value
18
18
9
26/06/2024
Design and Implementation of GIS (GE 350)
Boolean overlay (AND) example
0 0
0
AND =
1 1 1
[Precip] AND [ElevGT1500]
19
19
Design and Implementation of GIS (GE 350)
AND is also multiplication
0 0
0
x =
1 1 1
1 AND 1 = 1 1×1=1 Boolean AND is equivalent to
1 AND 0 = 0 1×0=0 multiplication. So multiplying layers
0 AND 1 = 0 0×1=0 works just as well.
0 AND 0 = 0 0×0=0
20
20
10
26/06/2024
Design and Implementation of GIS (GE 350)
Additive Boolean overlay
0 0
0
+ =
1 2
1
Instead of multiplying, add the layers
together to create a ranked result.
21
21
Design and Implementation of GIS (GE 350)
Other functions
Other raster analysis techniques
• Reclassification
• Surface functions
• Distance functions
• Density functions
• Interpolation
• Neighborhood functions
• Zonal functions
22
22
11
26/06/2024
Design and Implementation of GIS (GE 350)
Reclassify
Slope High slope/low slope
Convert one set of
grid values to another
Manual or classify
23
23
Design and Implementation of GIS (GE 350)
Surface analysis
DEM
Slope
Aspect
Hillshade
Contouring
24
24
12
26/06/2024
Design and Implementation of GIS (GE 350)
Slope function
Calculates slope of the surface based
on surrounding cells. Can be expressed
in degrees or percent.
25
25
Design and Implementation of GIS (GE 350)
Aspect function
Calculates direction of steepest slope,
e.g. which way the slope “faces”. Value
represents direction from 0-360 where
0/360 is North. Flat areas are assigned a
-1 value.
26
26
13
26/06/2024
Design and Implementation of GIS (GE 350)
Hillshade
Calculates the brightness or illumination of a surface from a
specified light source.
Applications include terrain display and modeling satellite
reflectance.
Azimuth is direction of illumination Altitude is the angle of the source
source (315 by default) above the horizon (45 deg)
27
27
Design and Implementation of GIS (GE 350)
Viewshed analysis
• Calculate areas
visible from a set of
observation points
28
28
14
26/06/2024
Design and Implementation of GIS (GE 350)
Hydrologic functions
Derive streams, watersheds, and other hydrologic features based
on analysis of a DEM.
29
29
Design and Implementation of GIS (GE 350)
Euclidean distance
• Starts from a set of
features (points,
lines, polygons).
• Creates a grid
where each cell
represents distance
to the closest of the
features.
• Distances are given
in coordinate
system map units
Distance to roads (meters)
30
30
15
26/06/2024
Design and Implementation of GIS (GE 350)
Euclidean direction
• Often created in association
with a distance function
• Indicates direction of travel
to the closest road.
Direction to roads (degrees)
31
31
Design and Implementation of GIS (GE 350)
Buffers
Roaddist < 500
Logical expressions easily create Boolean
rasters representing buffers from distance
rasters.
32
32
16
26/06/2024
Design and Implementation of GIS (GE 350)
What is interpolation?
• Interpolation is the prediction of values in between measured points.
• Sampling of points may be uniform, random, or based on a sampling
scheme.
• Numerous methods are used which have different mathematical
models and make different assumptions about the data.
• Best application of interpolation relies on substantial study of models
and assumptions. If you use it a lot—learn more!
33
33
Design and Implementation of GIS (GE 350)
Interpolation is NOT truth!
Actual elevation
Interpolated from summits
34
34
17
26/06/2024
Design and Implementation of GIS (GE 350)
Density functions
• Appear like interpolation, but
are calculated differently
– Interpolation predicts values
between points using a variety
of mathematical methods
– Density functions count
occurrences within a given
radius and divide by the area Occurrences may be features or
attributes of features (number of
cities versus city population).
35
35
Design and Implementation of GIS (GE 350)
Neighborhood statistics
Calculates a statistic for the specified window.
Window
3 1 4 4 1
3 1 4 4 1
6 2 1 1 2
5 4 3 3 4
3 1 4 4 1
36
36
18
26/06/2024
Design and Implementation of GIS (GE 350)
Zonal statistics
Watersheds and slope
• Zones defined by
the zone layer
(watersheds)
• Generates statistics
Average slope in watershed for each zone from
the value grid
(slope)
• Output is either a
raster, or a table
37
37
19