Learn R Programming

viewshed3d (version 3.2.0)

downsample_scene: Reduces the point cloud density

Description

Reduces the point cloud density

Usage

downsample_scene(data, method, filter)

Arguments

data

LAS file of a 3D point cloud.

method

character string. Defines the method to use for downsampling. Can be "space" or "random". See details. Default = "space".

filter

numeric. The intensity of the filter that depends on the method. See details.

Value

The downsampled data.

Details

method = "space"

a single point is conserved within a voxel of filter size.

method = "random"

randomly select a user defined proportion of the point cloud. Here, filter is the proportion of points to keep in the point cloud.

Examples

Run this code
# NOT RUN {
#- import the tree_line_plot dataset
file <- system.file("extdata", "tree_line_plot.laz", package="viewshed3d")
tls <- lidR::readLAS(file,select="xyz")

#- reduce the point cloud density: keep one point in a voxel of 4cm.
sub = viewshed3d::downsample_scene(tls,filter=0.04)

#- plot the downsampled point cloud
lidR::plot(sub)
# }

Run the code above in your browser using DataLab