data.table
labeled according to LAS specifications. See the ASPRS documentation for the
LAS file format.
The optional logical parameters enables the user to save memory by choosing to load only the
fields they need. Indeed, data is loaded into the computer's memory (RAM) suboptimally because
R does not accommodate many different data types. Moreover, the function provides a streaming filter
to load only the points of interest into the memory without allocating any superfluous memory.
readlasdata(file, Intensity = TRUE, ReturnNumber = TRUE, NumberOfReturns = TRUE, ScanDirectionFlag = TRUE, EdgeOfFlightline = TRUE, Classification = TRUE, ScanAngle = TRUE, UserData = TRUE, PointSourceID = TRUE, RGB = TRUE, filter = "")
data.table
rlas
relies on the well-known LASlib
library written by Martin Isenburg
to read the binary files, the package also inherits the filter commands available in
LAStools. To use these filters the user can pass the
common commands from LAStools
into the parameter 'filter'
. Type rlas:::lasfilterusage()
to
display the LASlib
documentation and the available filters.
The filter works in two passes. First it streams the file without loading anything and counts
the number of points of interest. Then it allocates the necessary amount of memory and reads the file
a second time, and stores the points of interest in the computer's memory (RAM).
readlasheader
,
writelas
lazfile <- system.file("extdata", "example.laz", package="rlas")
lasdata <- readlasdata(lazfile)
lasdata <- readlasdata(lazfile, filter = "-keep_first")
lasdata <- readlasdata(lazfile, filter = "-drop_intensity_below 80")
Run the code above in your browser using DataLab