# NOT RUN {
LASfile <- system.file("extdata", "Topography.laz", package="lidR")
las = readLAS(LASfile)
plot(las)
# --- First option: compute a raster DTM with grid_terrain ---
# (or read it from a file)
dtm = grid_terrain(las, method = "kriging", k = 10L)
nlas = lasnormalize(las, dtm)
plot(dtm)
plot(nlas)
# --- Second option: interpolate each point (no discretization) ---
nlas = lasnormalize(las, method = "kriging", k = 10L, model = gstat::vgm(0.59, "Sph", 874))
plot(nlas)
# }
Run the code above in your browser using DataLab