lidR (version 1.5.0)

lasfilterdecimate: Thin LiDAR data

Description

Thin LIDAR data randomly removes a given proportion of points to reach specific point/pulse densities.

Usage

lasfilterdecimate(.las, density, homogenize = TRUE, res = 5,
  use_pulse = FALSE)

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.

use_pulse

logical. Decimate by removing random pulses instead of random points

Value

It returns a LAS object.

Details

lasfilterdecimate is designed to produce output datasets that have uniform densities throughout the coverage area. For each cell, the proportion of points/pulses that will be retained is computed using the actual density and the desired density. If the required density is greater than the actual density it returns an unchanged set of points (it cannot increase the density). If homogenize = FALSE is selected, it randomly removes points/pulses to reach the required density over the whole area (see area). The cell size must be large enough to compute a coherent local pulse density i.e., in a 2 points/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 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, select = "xyz")

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

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

Run the code above in your browser using DataCamp Workspace