This is the first stage that must be called in each pipeline. The stage does nothing and returns
nothing if it is not associated to another processing stage.
It only initializes the pipeline. reader() is the main function that dispatches into to other
functions. reader_coverage() processes the entire point cloud. reader_circles() and
reader_rectangles() read and process only some selected regions of interest. If the chosen
reader has no options i.e. using reader() it can be omitted.
Usage
reader(filter = "", select = "*", depth = NULL, ...)
reader_coverage(filter = "", select = "*", depth = NULL, ...)
reader_circles(xc, yc, r, filter = "", select = "*", depth = NULL, ...)
reader_rectangles(
xmin,
ymin,
xmax,
ymax,
filter = "",
select = "*",
depth = NULL,
...
)Arguments
- filter
the 'filter' argument allows filtering of the point-cloud to work with points of interest. For a given stage when a filter is applied, only the points that meet the criteria are processed. The most common strings are
Classification == 2","Z > 2","Intensity < 100". For more details see filters.- select
character. Unused. Reserved for future versions.
- depth
integer. Maximum octree depth level for COPC or EPT data. Depth is 0-indexed. When NULL (default), all levels are read.
- ...
passed to other readers
- xc, yc, r
numeric. Circle centres and radius or radii.
- xmin, ymin, xmax, ymax
numeric. Coordinates of the rectangles
Details
Supported input formats: LAS, LAZ, COPC, PCD, and EPT (Entwine Point Tiles).
EPT endpoints are detected automatically from ept.json paths or URLs.
For remote files, COPC and EPT are strongly recommended as they support
efficient spatial streaming (only relevant data is downloaded).
Examples
f <- system.file("extdata", "Topography.las", package = "lasR")
pipeline <- reader() + rasterize(10, "zmax")
ans <- exec(pipeline, on = f)
# terra::plot(ans)
pipeline <- reader(filter = keep_z_above(1.3)) + rasterize(10, "zmean")
ans <- exec(pipeline, on = f)
# terra::plot(ans)
# reader() with no option can be omitted
ans <- exec(rasterize(10, "zmax"), on = f)
# terra::plot(ans)
# Perform a query and apply the pipeline on a subset
pipeline = reader_circles(273500, 5274500, 20) + rasterize(2, "zmax")
ans <- exec(pipeline, on = f)
# terra::plot(ans)
# Perform a query and apply the pipeline on a subset with 1 output files per query
ofile = paste0(tempdir(), "/*_chm.tif")
pipeline = reader_circles(273500, 5274500, 20) + rasterize(2, "zmax", ofile = ofile)
ans <- exec(pipeline, on = f)
# terra::plot(ans)