Background

High-quality digital elevation models (DEM) provide essential data for research in many scientific disciplines as well as for numerous practical applications. Today, DEMs can be generated by a variety of remote sensing techniques including conventional and Structure-from-Motion photogrammetry (SfM), radar interferometry, lidar, or short-range 3D cameras [1, 2]. The different remote sensing sensors, platforms and DEM reconstruction algorithms result in DEM products with different properties in terms of spatial extent, resolution, accuracy, survey date, and whether they represent digital surface model (DSM) or bare ground. To address inhomogenity of available DEM products, several methods of fusing DEMs have been developed to obtain a complete DEM coverage with improved quality. Fusion approaches vary from simple techniques, such as weighted averaging of input DEMs based on height error maps [3], or terrain derivatives [4, 5], to more complex techniques involving the use of sparse representations [6], frequency domain filtering [7], slope-based Markov random field regularization [8], or k-means clustering [9].

In these cases the fusion method combines several overlapping DEMs in order to obtain a higher quality DEM with homogenous error characteristics. However, these methods are typically not suitable for cases when one DEM needs to be updated with a newer or a higher resolution one within a specific subregion. Simple merging or averaging the DEMs typically leads to surface discontinuities [10, 11] on the edge of the DEMs, which can lead to artificial landforms and patterns when the resulting DEM is applied for geomorphometry or hydrologic applications.

Several approaches to ensure smooth transition of DEMs have been proposed in the context of global DEM mosaicking and DEM void filling. Gruber et al. [12] fused interferometric synthetic aperture radar (InSAR) DEMs by the means of weighted average based on derived height errors. As the errors are higher at the borders, decreased weights towards the borders allow for smoother transitions between DEMs. A different approach proposed by Reuter et al. [10] creates seam lines along landscape features such as waterways or roads to merge non-overlapping patches of DEMs with minimum geometric discontinuities. Such seam lines can be automatically identified by morphological image compositing [13], frequently used for mosaicking satellite imagery, but rarely used for DEM mosaicking due to the complexity of the method and possible lack of suitable landscape features for the seam line. Achieving seamless transitions is also crucial when filling missing data in DEMs with a DEM from different source. The transition zone between the auxilary and the main DEM is typically interpolated using inverse distance weighting (IDW) [14], or estimated as a local average of neighboring elevation pixels [15]. However, depending on the complexity of landscape features the transition zone can be much smoother than its surrounding and become a visible artifact.

To ensure seamless transition between DEMs, Robinson et al. [11] proposed blending DEMs using weighted averaging method where weight is a function of distance to transition line between two DEMs. The blending zone in their case followed a single parallel and had constant width. However, many new DEMs derived from Unmanned Aircraft Systems (UAS) cover irregularly shaped areas and can contain gaps due to complex terrain and vegetation. Moreover, sub-meter resolution DEMs capture microtopography and above ground features not present in lower-resolution DEMs leading to larger elevation differences along the DEMs seam, which require wider blending zone in order to achieve smooth transition. On the other hand, a narrow blending zone is preferable along the seam sections with small elevation differences to preserve the high resolution topographic features captured by the DEMs.

Our aim is therefore to generalize the approach presented by Robinson et al. [11] for applications where an existing DEM is updated with a new DEM within a smaller subregion with irregularly shaped boundaries, and to improve the preservation of terrain shape when fusing DEMs by applying a data-driven, spatially variable blending zone width. We describe the general workflow for the presented method, provide its software implementation (see Additional file 1) in GRASS GIS [16] and demonstrate our method on two use cases.

Methods

Given two raster-based DEMs, D E M A and D E M B, we describe a method to combine them into a new D E M AB, for the purpose of updating D E M B with D E M A, or replacing parts of D E M A with D E M B. Although not a necassary rule, D E M A is typically more recent, and has higher resolution, but smaller extent comparing to D E M B. The input DEMs must be co-registered into the same coordinate system and aligned and reinterpolated to the same resolution. The selection of the common resolution and reinterpolation method is highly dependent on the local topography and fused DEM application and is beyond the scope of this paper. Depending on the application, large elevation differences along the edge of D E M A, typically representing vegetation or built structures, should be identified and removed, for example by defining a difference threshold.

Throughout the paper, we use the term digital elevation model (DEM) as a generic term for both bare ground and digital surface model (DSM) which includes vegetation and structures.

Weighted linear combination of DEMs

Given elevation surfaces z A (x,y) and z B (x,y), which have a minimum overlap of width s, we can compute the Euclidean distance d(x,y) from the edge of surface z A (x,y) and use it as weight coefficients w(x,y) for the linear combination of the two surfaces z A (x,y) and z B (x,y):

$$ z_{AB} = z_{A} w +z_{B}(1-w) $$
(1)

where weight w(x,y) is a function of a constant overlap width s and distance d(x,y):

$$ w(x, y) = f(s, d(x,y)) = \left\{ \begin{array}{ll} \frac{d(x,y)}{s} &\ \ 0 \leq d(x,y) < s \\ 1 &\ \ d(x,y) > s \end{array}\right. $$
(2)

where w∈〈0,1〉 (Fig. 1).

Fig. 1
figure 1

Schema of DEM fusion. Top: DEMs are blended on the overlap of width s, where the weight grows from 0 to 1 based on the distance from the edge of D E M A. Bottom: Overlap width can be uniform (left) or spatially dependent on the elevation difference Δz along the edge of D E M A

Alternatively, the weight function does not have to be linearly dependent on the distance d(x,y), but can be defined using non-linear relationships, for example logistic curve:

$$ w(x, y) = f(k, s, d(x,y)) = \frac{1}{1+e^{-k (d(x,y) - s/2)}} $$
(3)

where k is a parameter controlling the steepness of the logistic curve and w∈〈0,1〉.

For elevation surfaces z A (x,y) and z B (x,y) represented by raster-based D E M A and D E M B, the fusion process can be implemented using basic GIS functions, such as raster algebra. We compute the distance raster D=d(x,y) from nearest null cells of D E M A and derive the weight raster W=w(x,y) from D and s using linear Eq. (2) or a non-linear equation, for example Eq. (3). We select suitable overlap width s based on the elevation differences between D E M A and D E M B along the blending seam. The updated D E M AB is then computed using Eq. (1).

The limitation of this approach is that the overlap width s is constant and does not take into account the spatially variable elevation differences Δ z(x,y) between surfaces z A (x,y) and z B (x,y) along the overlap. By using a spatially variable overlap width s(x,y), we can achieve a more gradual transition along the overlap where Δ z(x,y) is large (Fig. 1) while keeping a small overlap width and preserving the subtle features of both DEMs where Δ z(x,y) is small. Eq. (2) then becomes:

$$ w(x, y) = f(s(x,y), d(x,y)) $$
(4)

Different approaches can be used to derive spatially variable overlap s(x,y). For example, by specifying a transition angle α as an approximation of the steepness of transition, we can compute the overlap width as:

$$ s(x,y) = \frac{\Delta z(x,y) }{ \tan \alpha} $$
(5)

The raster-based fusion process with spatially variable overlap surface S=s(x,y) can then be implemented as follows:

  1. 1.

    Compute the distance surface D from nearest null cells of D E M A.

  2. 2.

    Compute the absolute value of the difference between D E M A and D E M B, Δ D E M AB =|Δ z(x,y)|=|D E M A D E M B |.

  3. 3.

    Using distance D derive a one-pixel-wide edge of D E M A and along this edge extract cell values from Δ D E M AB into raster Δ D E M e .

  4. 4.

    Compute surface Δ D E M e′ where each cell has the value of the nearest non-null cell of Δ D E M e .

  5. 5.

    To avoid discontinuities, smooth surface Δ D E M e′, for example by using moving-window operation with average statistics.

  6. 6.

    Given transition angle α, compute overlap width surface using Eq. (5) as S=Δ D E M e′/ tanα.

  7. 7.

    Compute weight surface from Eq. (4) as W=D/S.

  8. 8.

    Derive updated elevation surface using Eq. (1).

Most steps, specifically 2, 3, 6, 7, and 8 can be implemented using raster algebra, for example, with module r.mapcalc in GRASS GIS. Modules r.grow.distance can be used for steps 1 and 4, and r.neighbors for step 5.

The spatially variable overlap ensures a gradual smooth transition between the two merged DEMs and the resulting DEM can then be used for surface water flow modeling with minimized edge artifacts.

To demonstrate the importance of smooth fusion for water flow modeling at sub-meter resolution we use the path sampling technique for solving the shallow water flow continuity equation [17]. This technique allows us to simulate impact of microtopography on distribution of water depth including ponding in microdepressions and dispersed water flow. The method was implemented in GRASS GIS in the module r.sim.water. The module computes overland flow depth or discharge based on steady, spatially distributed rainfall excess, elevation surface gradient, and surface roughness given by Manning’s coefficient.

Results

We demonstrate the proposed fusion method on two case studies located at the Lake Wheeler Road Field Laboratory of North Carolina (NC) State University in Raleigh, NC (Fig. 2).

Fig. 2
figure 2

Study area. Study area is located near Lake Wheeler Road Field Laboratory of North Carolina State University, Raleigh, NC. Yellow outlines show the extent of UAS surveys. Insets A and B highlight the areas of first and second case study respectively

Fig. 3
figure 3

Spatially variable overlap width. Top figure presents an overview of fusion source data for the study area and highlights the spatially variable overlap width with transition degree α=1.15° and fusion weights w(x,y). The weights for both fusions (June UAS with October UAS, and resulting UAS-based DEM with lidar) are displayed. Bottom figures capturing enlarged study area A show the spatially variable overlap (right) derived from the absolute differences between DEMs (left, units meters). For the sake of clarity only data related to the fusion of UAS with lidar DEM are shown in the bottom figures. The azimuth of the light source for shaded relief is 270° (clockwise from north) and the altitude angle is 30°

Updating lidar-based DEM with UAS-based DSMs

The first case study provides an example of modeling water flow on very high-resolution DSM of a cultivated field, derived from imagery captured by a UAS and processed by SfM technique. UAS surveys provide topographic data with high spatial and temporal resolution, however, water flow modeling on the SfM-based DSMs poses several challenges. First, the SfM method produces DSMs, which capture vegetation, creating artificial barriers to water flow (Fig. 5 b). Secondly, the extent of the UAS DSM in our case does not match the watershed boundaries, underestimating the amount of water flowing over the landscape. We address the first issue by reconstructing bare earth from two UAS surveys acquired in June and October 2015 before and after the crop harvest. By replacing the sections of the June DSM covered by crops with the bare earth data from the October DSM, we obtain close approximation of the microtopography of the June DSM suitable for water flow modeling. We solve the second issue of DSM extent by fusing the new DSM derived from the two UAS surveys, with available lidar bare earth data. The lidar bare earth is used also in areas of the UAS DSMs with stable vegetation such as trees and shrubs.

Fig. 4
figure 4

Terrain profiles of fused and source DEMs. Vertical dotted lines delimit the overlap zone where the source DEMs are fused. See Fig. 5 for profile locations

Fig. 5
figure 5

Effect of DEM fusion on water flow patterns. Figure a shows the boundaries of DEMs used for fusion. High crops in June DSM (b) create artificial barriers to water flow resulting in ponding (zone c) and lower water depth in a forming rill in zone b comparing to DEMs derived from two other sources (c and d). Comparing the fused DEM with blended overlaps (d), flow simulation on the DEM derived by simple patching of all DEMs (c) results in depressions at the edge of the DEMs where water accumulates (zone a and d). See Table 1 to compare the simulated amount of water in these zones between different DEMs. Lines 1 and 2 represent profiles from Fig. 4. The azimuth of the light source for shaded relief is 270° and the altitude angle is 30°

Table 1 The amount of simulated rainfall water during steady state captured on plots a, b, c, and d in Fig. 5

The UAS data were interpolated from the point clouds to 0.3 meter resolution rasters. The details of the data acquisition and processing of the UAS-based DEMs are provided by Jeziorska et al. [18]. Lidar data used in this study were collected by the North Carolina Floodplain Mapping Program [19] in 2015 as part of a state-wide survey, with average point density of 3 points per square meter and multiple return classified points. We extracted bare earth points and in order to keep consistent resolution with the UAS DSMs we interpolated the DEM at 0.3 meters using regularized spline with tension [20]. The sections of both UAS-based DSMs with high vegetation such as trees and shrubs were masked out and the sections covered by crops were removed from the June DSM by masking out areas with elevations 0.3 meters above the ground given by the lidar-based DEM.

We merged the DEMs in two stages. First, we merged the June and October UAS-based DSMs, and then the resulting DSM with the lidar-based DEM. We applied the fusion method with the spatially variable overlap width to preserve as much of the microtopography as possible while ensuring smooth transition between the three DEMs. We specified sufficiently low transition angle α=3° (approximately 0.1 meter elevation difference on 2 meters) to achieve smooth blending on the overlap. The average overlap width was then 3.3±1.6 meters and 2.9±2.2 meters for the first and second fusion respectively (Fig. 3). Figure 4 shows two profiles which compare the fused DEM with the source DEMs. The profile of the fused DEM seamlessly transitions from the profile of one DEM to the other. Due to the spatially variable overlap width, the length of the transition zone differs for each profile (3.6 meters and 4.8 meters for profiles 1 and 2 respectively).

We then used the fused DEM to model shallow overland water flow using path sampling method assuming uniform rainfall excess rate of 30 milimeters per hour. We simulated flow at 0.3 meters resolution for 40 minutes until steady state was reached in most of the modeled area. To account for different roughness of the areas with crops, we created a Manning’s coefficient surface of 0.15 for bare earth and 0.3 for areas with crops captured in the June dataset [21].

We compared the flow pattern modeled on the June DSM (Fig. 5 b), and on the UAS- and lidar-based DEMs merged with (Fig. 5 d) and without blending of the overlap (Fig. 5 c). Table 1 quantifies and compares the amount of runoff water in four selected plots (Fig. 5) simulated on these different DEMs.

UAS-based DSM from June captures high crops, which results in artificial ponding as visible for example in plot c in Table 1. Such artificial accumulation of water can result in underestimating water depth downstream. For example, in plot b we can observe that simulation based on the DSM underestimates the amount of water in a forming rill by 50%. Replacing vegetated areas with elevation data from different sources (Fig. 5 a) provides better approximation of flow, however, if the transition between DEMs is not smooth enough, water can accumulate near the edges of the DEMs, resulting in unrealistic patterns (Fig. 5 b). Plots a and d are examples where the simulation based on the DEMs merged without blending (patched DEM) overestimates the amount of water by more than 50% comparing to the simulation ran on the fused DEM where blending is used. The solution is therefore to smooth the transition using the described approach, allowing for more realistic flow as demonstrated in Fig. 5.

Merging lidar- and Kinect-based DEMs

In the second case study we apply presented method to merge a lidar-based DEM with a georeferenced, virtual DEM obtained by scanning a physical, scaled model in Tangible Landscape environment [22]. Tangible Landscape couples a malleable physical model with a digital landscape through a cycle of real-time scanning, analysis, and projection. As users change the physical model it is continuously scanned using Microsoft Kinect v2 sensor into GRASS GIS [16], in which landscape processes are simulated and results are projected back onto the physical model. The boundaries of the physical model and its scale define the spatial extent of our interactions on the landscape. These boundaries often do not match the boundaries of the physical processes, such as water flow, which accumulates within watersheds. The effects of our interventions on the physical model affect the water flow downstream outside of the model’s boundaries, and similarly modeling water flow without considering surface runoff from outside the model results in underestimating the amount of water in the landscape.

In this application, we use the physical model to design runoff control measures to reduce concentrated flow causing gully erosion. To simulate water flow within the entire studied watershed we merge the scanned DEM of the physical model with the lidar-based DEM covering the entire watershed. Smooth fusion is essential for ensuring that the simulated water flows in and out of the physical model. In this case we applied the fusion with fixed overlap width, since this method is very fast thus suitable for real-time interaction with the model and feedback on the flow patterns.

We manually built a physical model from polymer-enriched sand of a small section of the area used in the first case study based on the 2015 lidar data at 1 : 420 scale and 4 times vertical exaggeration, to facilitate scanning and interaction. We used projected contours and color-coded difference of the scanned and real DEM [22, Chapter 4] while building the model to ensure its sufficient accuracy. We then merged the lidar-based and scanned DEMs with fixed overlap width of 15 meters and ran the water flow simulation on the merged DEM over the watershed including the physical model. We modeled the steady state flow assuming uniform rainfall excess rate of 30 mm/hr, and uniform Manning’s coefficient of 0.15. The simulation ran at resolution of 0.85 meter, which is given by the resolution of the scanner multiplied by the model scale.

We then started to modify the physical model using sculpting tools and our hands to fill the actively eroding rill and divert flow to the edge of the field while the new water flow pattern was being projected over the modified sand model. Further, we built a series of checkdams to prevent erosion by reducing water flow velocity during rainstorm events. Figure 6 shows the simulated water flow before and after the change projected over the physical model. We can observe how water flows smoothly into and out of the sand model thanks to the blending on the DEMs’ overlap.

Fig. 6
figure 6

Tangible Landscape. Physical model of landscape (see inset B in Fig. 2) with projected orthophoto from March 2015, 20 cm contours and simulated water flow depth in meters. Top figure shows the original landscape with eroding rill, the bottom figure shows the landscape after our modifications which included diverting the flow to the edge of the field and building a series of checkdams

Discussion

The presented case studies demonstrate the effectivity and utility of the described method to eliminate edge artifacts along the seamline between two DEMs. Despite the relatively precise alignment of the DEMs in the first study (around 20 centimeters of elevation difference at the edge in average), we showed that even small discontinuities affected processes driven by microtopography, such as overland water flow. The proposed blending technique effectively reduced the artifacts along the edges and allowed for more realistic water flow. In comparison with other fusion techniques, our goal was not to derive best terrain representation globally, but only locally along the edges of the DEMs, in order to preserve the original topography of both DEMs. Therefore the proposed method introduces a blending zone with spatially variable width derived from elevation differences, which ensures smooth transition for large edge artifacts and at the same time reduces the smoothing effect when not desired. Although we presented this method in the context of high-resolution DEMs, it can be used at any scale. However, we recommend to carefully consider applying the method in cases when the discontinuities at the edge are large and smooth transition would create unrealistic features in the resulting DEM. In such cases, the cause of this misalignment given by the data acquisition technology and processing should be identified and rectified first, for example by the means of co-registration [23], removing non-ground components, or specifically in case of UAS, by collecting imagery with suitably distributed control points [24].

The proposed technique is described in the context of raster-based DEMs, the prevalent representation of DEMs for environmental and geomorphological applications. Since the Eqs. (1) and (2) are general, the method could be adapted for other terrain representations such as point clouds. However, GIS software typically lacks the ability to manipulate large point clouds in a way that would match the efficiency and variability in processing functionality of raster representation [25]. The presented raster-based solution can be therefore implemented efficiently in any GIS software with raster support.

Conclusions

We presented a fast and effective technique to merge raster DEMs with different spatial extents by blending the DEMs along their overlap using distance-based weighted average. The novel approach based on spatially variable overlap width improves preservation of subtle topographic features of the high-resolution DEMs while ensuring smooth transition. The two case studies demonstrated the importance of smooth transition for modeling water flow patterns while capturing the impacts of microtopography or when interacting with physical models using tangible user interface. With the increasingly widespread use of low-cost 3D sensors and UAS platforms the proposed technique becomes highly relevant for researchers and practitioners working with time series of high-resolution DEMs.