
7.10 ANALYSIS OF DIGITAL ELEVATION MODELS (BY R. GEBBERS) 229
7 SPATIAL DATA
tation of hydrological characteristics from the DEM.
Flow accumulation, also called specific catchment area or upslope
contributing area, is de ned as the number of cells, or area, that contrib-
ute runo to a particular cell (Fig. 7.14). In contrast to the local parameters
slope and aspect, ow accumulation can only be determined from the glob-
al neighborhood. e principal operation is to add cell in ows from higher
neighboring cells, starting from the speci ed cell and working up to the
watersheds. Before adding together the out ows from each cell, we need
to determine the gradient of each individual cell towards each neighbor-
ing cell, indexed by
N. e array N contains indices for the eight adjacent
cells according to the MATLAB convention as shown in Figure 7.13. We
make use of the
circshift function to access the neighboring cells. For
a two-dimensional matrix
Z, the function circshift(Z,[r c]) circu-
larly shi s the values in the matrix
Z by an amount of rows and columns
given by
r and c, respectively. For example, circshift(Z,[1 1]) will
circularly shi
Z one row down and one column to the right. e individual
gradients are calculated by
for the eastern, southern, western, and northern neighbors (the so-called
rook’s case) and by
for the diagonal neighbors (bishop’s case). In these formulae, h is the
cell size, z
r,c
is the elevation of the central cell and z
r+y,c+x
the eleva-
tion of a neighbor. e cell indices x and y are obtained from the matrix
N. e gradients are stored in a three-dimensional matrix grads, where
grads(:,:,1) contains the gradients towards the neighboring cells to
the east,
grads(:,:,2) contains the gradients towards the neighboring
cells to the south-east, and so on. Negative gradients indicate out ow from
the central cell towards the relevant neighboring cell. To obtain the sur-
face ow between cells, gradients are transformed by the inverse tangent of
grads divided by 0.5π.
N = [0 -1;-1 -1;-1 0;+1 -1;0 +1;+1 +1;+1 0;-1 +1];
[a b] = size(SRTM);
grads = zeros(a,b,8);
for c = 2 : 2 : 8
grads(:,:,c) = (circshift(SRTM,[N(c,1) N(c,2)]) ...