Learn R Programming

lidR (version 2.1.4)

lasfilter: Return points with matching conditions

Description

Return points with matching conditions

Usage

lasfilter(las, ...)

Arguments

las

An object of class LAS

Logical predicates. Multiple conditions are combined with '&' or ','

Value

An object of class LAS

See Also

Other lasfilters: lasfilterduplicates, lasfiltersurfacepoints, lasfilters

Examples

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

# Select the first returns classified as ground
firstground = lasfilter(lidar, Classification == 2L & ReturnNumber == 1L)

# Multiple arguments are equivalent to &
firstground = lasfilter(lidar, Classification == 2L, ReturnNumber == 1L)

# Multiple criteria
first_or_ground = lasfilter(lidar, Classification == 2L | ReturnNumber == 1L)
# }

Run the code above in your browser using DataLab