fill_voids_k08: Void filling using derivatives

Description Usage Arguments Details References Examples

Description

Void filling using trigonometric, elevation of pixels surrounding the voids, and slope and aspect from the fill source.

Usage

1
fill_voids_k08(x, slp, asp, show_progress_bar = TRUE)

Arguments

x

RasterLayer. DEM with voids.It must be in a cartographic projection with the same unit that the elevation data (meters is strongly recommended).

slp

RasterLayer. Slope in radians derivate from the fill source.

asp

RasterLayer. Aspect in radians derivate from the fill source.

show_progress_bar

logical.

Details

This function implement the algorithm developed by Karkee et al. (2008) (see references). The filling process iteratively grows from the surrounding pixels to the center of the void.

References

Karkee, M., Steward, B., Aziz, S., 2008. Improving quality of public domain digital elevation models through data fusion. Biosyst. Eng. 101, 293-305. doi:10.1016/j.biosystemseng.2008.09.010

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
set.seed(11)
reference <- fake_dem(n_random_data = 60, z_range = c(0, 600))
plot(reference)

set.seed(18)
fillSource <- fake_dem(z_range = c(0, 20))
fillSource <- fillSource - mean(fillSource[])
fillSource <- fillSource + reference
fillSource <- smooth_dem(fillSource, theta = 6)
plot(fillSource)

p <- sampleRegular(reference, 10, sp = TRUE)
voidsMask <- fake_voids(p, void_size = 20, reference)

dem <- reference
dem[voidsMask] <- NA
plot(dem)

slp <- terrain(fillSource, "slope")
asp <- terrain(fillSource, "aspect")
demF2 <- fill_voids_k08(dem, slp, asp, show_progress_bar = TRUE)

plot(demF2)

plot(demF2 - reference)

hs <- hillShade(terrain(demF2, "slope"), terrain(demF2, "aspect"))
plot(hs , col= grey((0:255)/255), legend = FALSE)

GastonMauroDiaz/rdemtools documentation built on Oct. 22, 2019, 8:32 p.m.