Learn R Programming

lidR (version 1.2.1)

lasdecimate: Thin LiDAR data

Description

Thin LIDAR data randomly removes a given proportion of pulses to reach specific pulse densities

Usage

lasdecimate(.las, density, homogenize = TRUE, res = 5)

Arguments

.las

An object of the class LAS

density

numeric. The expected density

homogenize

logical. If TRUE, the algorithm tries to homogenize the pulse density to provide a uniform dataset. If FALSE the algorithm will reach the pulse density over the whole area.

res

numeric. Cell size to compute the pulse density.

Value

It returns a LAS object.

Details

lasdecimate is designed to produce output datasets that have uniform pulse densities throughout the coverage area. For each cell, the proportion of pulses that will be retained is computed using the actual pulse density and the desired pulse density. If the required pulse density is greater than the actual pulse density it returns an unchanged set of points (it cannot increase the pulse density). If homogenize = FALSE is selected, it randomly removes pulses to reach the required pulse density over the whole area (see lasarea). The cell size must be large enough to compute a coherent local pulse density i.e., in a 2 pulse/m^2 dataset, 25 square meters would be feasible; however, an extent too small to thin (e.g. <1 square meter) would not be feasible because pulse density does not have meaning at this scale.

Examples

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

# By default the method is homogenize = TRUE
thinned = lidar %>% lasdecimate(1, res = 5)
lidar   %>% grid_density %>% plot
thinned %>% grid_density %>% plot

# Method homogenize = FALSE enables a global pulse density to be reached
thinned = lidar %>% lasdecimate(1, homogenize = FALSE)
thinned %>% summary
thinned %>% grid_density %>% plot
# }

Run the code above in your browser using DataLab