| filters {lidR} | R Documentation |
Filter points of interest
Description
Filter points of interest (POI) from a LAS object where conditions are true.
Usage
filter_poi(las, ...)
filter_first(las)
filter_firstlast(las)
filter_firstofmany(las)
filter_ground(las)
filter_last(las)
filter_nth(las, n)
filter_single(las)
filter_duplicates(las)
## S3 method for class 'LAS'
filter_duplicates(las)
## S3 method for class 'LAScatalog'
filter_duplicates(las)
Arguments
las |
An object of class LAS |
... |
Logical predicates. Multiple conditions are combined with '&' or ',' |
n |
integer ReturnNumber == n |
Details
filter_poiSelect points of interest based on custom logical criteria.filter_firstSelect only the first returns.filter_firstlastSelect only the first and last returns.filter_groundSelect only the returns classified as ground according to LAS specification.filter_lastSelect only the last returns i.e. the last returns and the single returns.filter_nthSelect the returns from their position in the return sequence.filter_firstofmanySelect only the first returns from pulses which returned multiple points.filter_singleSelect only the returns that return only one point.filter_duplicatesRemoves the duplicated points (duplicated by XYZ)
Value
An object of class LAS
Non-supported LAScatalog options
The option select is not supported and not respected because it always preserves the file format
and all the attributes. select = "*" is imposed internally.
Examples
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
lidar = readLAS(LASfile)
# Select the first returns classified as ground
firstground = filter_poi(lidar, Classification == 2L & ReturnNumber == 1L)
# Multiple arguments are equivalent to &
firstground = filter_poi(lidar, Classification == 2L, ReturnNumber == 1L)
# Multiple criteria
first_or_ground = filter_poi(lidar, Classification == 2L | ReturnNumber == 1L)