Skip to contents

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_las() is the main function that dispatches into to other functions. reader_las_coverage() processes the entire point cloud. reader_las_circles() and reader_las_rectangles() read and process only some selected regions of interest. If the chosen reader has no options i.e. using reader_las() it can be omitted.

Usage

reader_las(filter = "", ...)

reader_las_coverage(filter = "", ...)

reader_las_circles(xc, yc, r, filter = "", ...)

reader_las_rectangles(xmin, ymin, xmax, ymax, filter = "", ...)

Arguments

filter

the 'filter' argument allows filtering of the point-cloud to work with points of interest. The available filters are those from LASlib and can be found by running filter_usage. For a given stage when a filter is applied, only the points that meet the criteria are processed. The most common strings are "-keep_first", "-keep_class 2", "drop_z_below 2". For more details see filters.

...

passed to other readers

xc, yc, r

numeric. Circle centres and radius or radii.

xmin, ymin, xmax, ymax

numeric. Coordinates of the rectangles

Examples

f <- system.file("extdata", "Topography.las", package = "lasR")

pipeline <- reader_las() + rasterize(10, "zmax")
ans <- exec(pipeline, on = f)
# terra::plot(ans)

pipeline <- reader_las(filter = keep_z_above(1.3)) + rasterize(10, "zmean")
ans <- exec(pipeline, on = f)
# terra::plot(ans)

# read_las() 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_las_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_las_circles(273500, 5274500, 20) + rasterize(2, "zmax", ofile = ofile)
ans <- exec(pipeline, on = f)
# terra::plot(ans)