lidR (version 1.0.2)

grid_terrain: Digital Terrain Model

Description

Interpolate ground points and create a rasterized digital terrain model. The interpolation is base on lasterrain which provides 3 methods for spatial interpolation: "knnidw", "akima" and "kriging". The algorithm uses the points classified as "ground" to compute the interpolation. The function forces the original lowest ground point of each pixel (if it exists) to be chosen instead of the interpolated values.

Usage

grid_terrain(.las, res = 1, ...)

Arguments

.las

LAS objet

res

numeric resolution.

...

parameters for lasterrain. Select the method and its parameters for spatial interpolation.

Value

A RasterLayer from package raster

See Also

lasterrain lasnormalize RasterLayer

Examples

Run this code
# NOT RUN {
LASfile <- system.file("extdata", "Topography.laz", package="lidR")
lidar = readLAS(LASfile)
plot(lidar)

dtm1 = grid_terrain(lidar, method = "knnidw")
dtm2 = grid_terrain(lidar, method = "akima")

raster::plot(dtm1, col = height.colors(50))
raster::plot(dtm2, col = height.colors(50))
plot3d(dtm1)
plot3d(dtm2)

# }
# NOT RUN {
dtm3 = grid_terrain(lidar, method = "kriging")
raster::plot(dtm3, col = height.colors(50))
# }

Run the code above in your browser using DataCamp Workspace