Learn R Programming

TreeLS (version 2.0.2)

tlsSample: Resample a point cloud

Description

Applies a sampling algorithm to reduce a point cloud's density. Sampling methods are prefixed by smp.

Usage

tlsSample(las, method = smp.voxelize())

Arguments

las

LAS object.

method

point sampling algorithm. Currently available: smp.voxelize and smp.randomize

Value

LAS object.

Examples

Run this code
# NOT RUN {
file = system.file("extdata", "pine.laz", package="TreeLS")
tls = readTLS(file)
nrow(tls@data)

### sample points systematically from a 3D voxel grid
vx = tlsSample(tls, smp.voxelize(0.05))
nrow(vx@data)

### sample half of the points randomly
rd = tlsSample(tls, smp.randomize(0.5))
nrow(rd@data)

# }

Run the code above in your browser using DataLab