Skip to contents

Write a LAS or LAZ file at any step of the pipeline (typically at the end). Unlike other stages, the output won't be written into a single large file but in multiple tiled files corresponding to the original collection of files.

Usage

write_las(
  ofile = paste0(tempdir(), "/*.las"),
  filter = "",
  keep_buffer = FALSE
)

Arguments

ofile

character. Output file names. The string must contain a wildcard * so the wildcard can be replaced by the name of the original tile and preserve the tiling pattern. If the wildcard is omitted, everything will be written into a single file. This may be the desired behavior in some circumstances, e.g., to merge some files.

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 processes. The most common strings are "-keep_first", "-keep_class 2", "drop_z_below 2". For more details see filters.

keep_buffer

bool. The buffer is removed to write file but it can be preserved.

Examples

f <- system.file("extdata", "Topography.las", package="lasR")
read <- reader_las()
tri  <- triangulate(filter = keep_ground())
normalize <- tri + transform_with(tri)
pipeline <- read + normalize + write_las(paste0(tempdir(), "/*_norm.las"))
exec(pipeline, on = f)
#> [1] "/tmp/RtmpI3nt3B/Topography_norm.las"