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

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)

[Package lidR version 4.1.1 Index]