the same coordinate system. These simple methods
can be classified in two different types: Cover and
Average (Eastman, 2012).
Cover type methods do not operate any adjust-
ments to the input DEMs, they are simply superim-
posed. The DEM resulting from this method assumes
cell values of the first input across its entire extent and
values from the second input in areas not covered by
the first. The resulting DEM can yield significant ele-
vation discontinuities along the boundary between the
input DEMs, resulting in erroneous slope and aspect
values (Hickey, 2000).
Average methods assign to the merged DEM the
average elevation within areas where the input DEMs
overlap. Outside the overlapping area the resulting
DEM assumes the value of the existing input; only va-
lues within the overlapping area are changed. Some
of these methods try to tackle the discontinuities is-
sue using a weighted average, as is the case with
IDRISI (Eastman, 2012). A subset of these, usually
referred as Blend methods, go further, using a avera-
ging weighting function that may be linear, smoothed
(e.g. bicubic), or discontinuous; this way more weight
can be given to one of the inputs in certain areas, e.g.
closer to borders. It must be noted though, that these
averaging methods act as low pass filters, therefore
reducing the accuracy of the resulting DEM.
2.2 MBlend
The MBlend method differs from conventional met-
hods in two essential aspects: it is aware of the dif-
ferent spatial resolution of its inputs and modifies
areas for which only low resolution data are availa-
ble (Leit
˜
ao et al., 2016). This method works by identi-
fying two edges: the border between the low and high
resolution inputs (near edge) and the border around
the area of the low resolution input not overlapping
with the high resolution input (far edge). Points are
set along each of these two edges, those on the near
edge take the difference between the two inputs at the
location; those on the far edge take the value zero (see
Figure 1). From these points is computed a transition
surface, spatially restricted to the area of the low re-
solution input, not overlapping with the high resolu-
tion input. Finally, the transition surface is subtracted
from the low resolution input; the resulting DEM as-
sumes the values of the high resolution input within
its extent and outside the values of the low resolution
input minus the transition surface.
The MBlend method consist in seven essential
steps:
1. Obtain the low resolution extent - this is the ex-
tent of the study area that is only covered by the
low resolution DEM. It can be obtained by vecto-
rising the extent of each DEM and then applying
an intersection.
2. Compute differences - obtained by subtracting the
low resolution from the high resolution DEM.
3. Obtain the near edge - the differences map is vec-
torised into points. A buffer around the low re-
solution extent is then used to select from these
difference points those that lay along the border
between the two rasters (see Figure 1 (a)).
4. Obtain the far edge - the low resolution DEM is
vectorised to points and those along the border are
selected using an internal buffer to the low resolu-
tion extent.
5. Build interpolation points set - the value zero is
assigned to the points in the far edge; it is then
merged with the near edge into a single data set.
6. Interpolate smoothing surface - a new raster sur-
face is created by interpolation using the edges
points data set. The resulting surface smoothly
transitions from the full difference between the
two input DEMs along the near edge towards zero
along the far edge (see Figure 1 (b)).
7. Apply smoothing - the smoothing surface is added
to the low resolution raster. The result is then pa-
tched with the high resolution raster to obtain a
single data set covering the entire study area.
3 Implementation
3.1 The GRASS Add-on Development
Environment
GRASS is a Geographical Information System (GIS)
originally developed by the US Army Corps of En-
gineers with a focus on spatial data management and
analysis (Neteler et al., 2012). It is characterised by a
deep dataset management and archiving structure and
a vast roll of analysis operations, also known as mo-
dules. GRASS manages multiple data-set types: ras-
ter, vector, imagery and voxel (3D).
GRASS was originally written in C, with its mo-
dern structure now also coded in C++. Since 2012, in
the wake of version 6.4.2
1
, an API to the GRASS C
library was made avaialble for the Python program-
ming language (Sanner et al., 1999). This API greatly
simplified the development of new GRASS modules,
1
https://grass.osgeo.org/announces/announce grass642
.html
Improvements to DEM Merging with r.mblend
43