Spatial Analysis & Raster Calculations
Spatial Analysis & Raster Calculations
1
Readings – at http://help.arcgis.com
• Elements of geographic information starting from “Overview of
geographic information elements”
http://help.arcgis.com/en/arcgisdesktop/10.0/help/00v2/00v200000003
000000.htm to “Example: Representing surfaces”
Readings – at http://help.arcgis.com
• Rasters and images starting from “What is raster data”
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t00
000002000000.htm to end of “Raster dataset attribute tables”
2
Two fundamental ways of representing
geography are discrete objects and fields.
The discrete object view represents the real world as
objects with well defined boundaries in empty space.
(x1,y1)
Continuous surface
Point
Line
Zone of cells
Polygon
3
Raster and Vector are two methods
of representing geographic data in
GIS
• Both represent different ways to encode and
generalize geographic phenomena
• Both can be used to code both fields and
discrete objects
• In practice a strong association between
raster and fields and vector and discrete
objects
Grid
4
Triangulated Irregular Networks, TINs
“Flipping”
Algorithm
This is NOT Delauney This one IS Delauney
5
Six approximate representations of a field used in GIS
Regularly spaced sample points Irregularly spaced sample points Rectangular Cells
from Longley, P. A., M. F. Goodchild, D. J. Maguire and D. W. Rind, (2001), Geographic Information
Systems and Science, Wiley, 454 p.
6
The grid data structure
Definition of a Grid
Cell size
Number
of
rows
NODATA cell
(X,Y)
Number of Columns
7
Points as Cells
8
Polygon as a Zone of Cells
NODATA Cells
9
Cell Networks
Grid Zones
10
Floating Point Grids
11
Raster Sampling
Raster Generalization
12
Raster Calculator
Example
5 6 Precipitation
Cell by cell 7 6
evaluation of -
-
mathematical Losses
3 3
functions 2 4 (Evaporation,
Infiltration)
=
2 3
=
5 2 Runoff
P
P qo
qr
qs
13
Runoff generation at a point depends on
• Rainfall intensity or amount
• Antecedent conditions
• Soils and vegetation
• Depth to water table (topography)
• Time scale of interest
Accumulation of runoff
within watersheds
14
Raster calculation – some subtleties
Resampling or interpolation
(and reprojection) of inputs
+ to target extent, cell size,
and projection within
region defined by analysis
mask
=
Analysis mask
150 m
40 50 55
40 50 55
4 6
150 m
4 6
42
42
47
47
43
43
2 2
4 4
42
42 44
44 41
41
15
New depth calculation using Raster
Calculator
“snow100” - 0.5 * “temp150”
16
The Result
• Outputs are
on 150 m grid.
38 52
• How were
values
obtained ?
41 39
40 50 55
40-0.5*4 = 38
42 47 43
55-0.5*6 = 52
38 52
42 44 41
42-0.5*2 = 41
41-0.5*4 = 39 41 39
150 m
4 6
2 4
17
Scale issues in interpretation of
measurements and modeling results
The scale triplet
a) Extent b) Spacing c) Support
From: Blöschl, G., (1996), Scale and Scaling in Hydrology, Habilitationsschrift, Weiner Mitteilungen Wasser Abwasser Gewasser, Wien, 346 p.
From: Blöschl, G., (1996), Scale and Scaling in Hydrology, Habilitationsschrift, Weiner Mitteilungen Wasser Abwasser Gewasser, Wien, 346 p.
18
Use Environment Settings to control the scale
of the output
Extent
4 4 6 6 6
2 4 4
2 4
2 4 4
19
Calculation with cell size set to 100 m grid
“snow100” - 0.5 * “temp150”
• Outputs are on
100 m grid as
38 47 52 desired.
• How were
41
41 45 these values
obtained ?
41 42 39
40-0.5*4 = 38
40 50 55 50-0.5*6 = 47
55-0.5*6 = 52
42 47 43
42-0.5*2 = 41
38 47 52
47-0.5*4 = 45
42 44 41 43-0.5*4 = 41
41 45 41
42-0.5*2 = 41
150 m
4 6 6 44-0.5*4 = 42
41 42 39
4 6 41-0.5*4 = 39
2 4 4
2 4 Nearest neighbor values resampled to
2 4 4 100 m grid used in raster calculation
20
What did we learn?
• Raster calculator automatically uses
nearest neighbor resampling
• The scale (extent and cell size) can be set
under options
Interpolation
Estimate values between known values.
A set of spatial analyst functions that predict values for a
surface from a limited number of sample points creating a
continuous raster.
21
Interpolation
methods
• Nearest neighbor
• Inverse distance 1
z zi
weight ri
• Bilinear
z (a bx )(c dy)
interpolation
• Kriging (best linear z w iz i
unbiased estimator)
• Spline z ci x e i ye i
22
Interpolation Comparison
Further Reading
Grayson, R. and G. Blöschl, ed. (2000),
Spatial Patterns in Catchment Hydrology:
Observations and Modelling, Cambridge
University Press, Cambridge, 432 p.
23
Spatial Surfaces used in Hydrology
3-D detail of the Tongue river at the WY/Mont border from LIDAR.
Roberto Gutierrez
University of Texas at Austin
24
Topographic Slope
dz (a 2d g) - (c 2f i)
dx 8 * x_mesh_spacing
a b c
d e f dz (g 2h i) - (a 2b c)
g h i dy 8 * y_mesh_spacing
2 2
rise dz dz rise
deg atan
run dx dy run
25
ArcGIS Aspect – the steepest downslope
direction
dz
dz / dx
dy atan
dz / dy
dz
dx
30 Example
a b c dz (a 2d g) - (c 2f i)
80 74 63 dx 8 * x_mesh_spacing
(80 2 * 69 60) (63 2 * 56 48)
d e f 145.2o
69 67 56 8 * 30
0.229
g h i
60 52 48 dz (g 2h i) - (a 2b c)
dy 8 * y_mesh_spacing
(60 2 * 52 48) (80 2 * 74 63)
Slope 0.229 2 0.329 2 8 * 30
0.401 0.329
0.229 180o
Aspect atan 34.8
o
0.329 145.2o
26
Hydrologic Slope (Flow Direction Tool)
- Direction of Steepest Descent
30 30
80 74 63 80 74 63
69 67 56 69 67 56
60 52 48 60 52 48
67 48 67 52
Slope: 0.45 0.50
30 2 30
32 64 128
16 1
8 4 2
27
Limitation due to 8 grid directions.
The D Algorithm
Proportion Steepest direction
flowing to downslope
neighboring Proportion flowing to
grid cell 4 is neighboring grid cell 3
1/(1+2) is 2/(1+2)
3 2
4 2 1
Flow
direction.
5 1
6 8
7
Tarboton, D. G., (1997), "A New Method for the Determination of Flow Directions and
Contributing Areas in Grid Digital Elevation Models," Water Resources Research,
33(2): 309-319.) (http://www.engineering.usu.edu/cee/faculty/dtarb/dinf.pdf)
28
The D Algorithm
Steepest direction
downslope
3 2
4
2
e e
0 1 1 atan 1 2
5 1 e0 e1
2 2
8 e e e e
6
7 S 1 2 0 1
If 1 does not fit within the triangle the angle is chosen along the steepest
edge or diagonal resulting in a slope and direction equivalent to D8
D∞ Example
30
80 74 63 e e
1 atan 7 8
e0 e7
eo
69 67 56 52 48
atan 14.9
o
67 52
e7 e8
60 52 48
2 2
284.9o 52 48 67 52
S
14.9o 30 30
0.517
29
Key Spatial Analysis Concepts
• Contours and Hillshade to visualize topography
30
Subwatershed Precipitation by
Thiessen Polygons
• Thiessen Polygons
• Feature to Raster (Precip
field)
• Zonal Statistics (Mean)
• Join
• Export to DBF (Excel)
Subwatershed Precipitation by
Interpolation• Kriging (on Precip
field)
• Zonal Statistics
(Mean)
• Join
• Export
31
Runoff Coefficients
• Interpolated precip for each
subwatershed
• Convert to volume, P
• Sum over upstream
subwatersheds
• Runoff volume, Q
• Ratio of Q/P
Watershed HydroID's
Subwatershed Precip from Thiessen Polygons Plum Ck at Lockhart, TX 330
Mean Precip Volume Blanco Rv nr Kyle, TX 331, 332
HydroID Area (m^2) Precip (in) (ft^3) San Marcos Rv at Luling, TX 331,332,333,336
330 2.91E+08 36.37 9.49E+09
331 9.21E+08 37.82 3.12E+10
332 1.49E+08 40.48 5.42E+09
333 1.27E+08 40.48 4.60E+09 Precip
336 9.80E+08 37.59 3.31E+10 Flow volume
Flow Volume Subwater‐ subwater‐ Runoff
Watersheds (cfs) (ft^3) sheds shed sum ratio
Plum Ck at Lockhart, TX 49.00 1.5E+09 330 9.49E+09 0.16303
Blanco Rv nr Kyle, TX 165.00 5.2E+09 331, 332 3.67E+10 0.14203
331, 332,
San Marcos Rv at Luling, TX 408.00 1.3E+10 333, 336 7.43E+10 0.17325
Summary Concepts
• Grid (raster) data structures represent
surfaces as an array of grid cells
• Raster calculation involves algebraic like
operations on grids
• Interpolation and Generalization is an
inherent part of the raster data
representation
32
Summary Concepts (2)
• The elevation surface represented by a grid digital
elevation model is used to derive surfaces
representing other hydrologic variables of interest
such as
– Slope
– Drainage area (more details in later classes)
– Watersheds and channel networks (more details
in later classes)
33