Skip to contents

According to the LAS specifications, a LAS file contains a core of defined attributes, such as XYZ coordinates, intensity, return number, and so on, for each point. It is possible to add supplementary attributes. This stages adds an extra bytes attribute to the points. Values are zeroed: the underlying point cloud is edited to support a new extrabyte attribute. This new attribute can be populated later in another stage

Usage

add_extrabytes(data_type, name, description, scale = 1, offset = 0)

Arguments

data_type

character. The data type of the extra bytes attribute. Can be "uchar", "char", "ushort", "short", "uint", "int", "uint64", "int64", "float", "double".

name

character. The name of the extra bytes attribute to add to the file.

description

character. A short description of the extra bytes attribute to add to the file (32 characters).

scale, offset

numeric. The scale and offset of the data. See LAS specification.

Value

This stage transforms the point cloud in the pipeline. It consequently returns nothing.

Examples

f <- system.file("extdata", "Example.las", package = "lasR")
fun <- function(data) { data$RAND <- runif(nrow(data), 0, 100); return(data) }
pipeline <- reader() +
  add_extrabytes("float", "RAND", "Random numbers") +
  callback(fun, expose = "xyz")
exec(pipeline, on = f)
#> NULL