Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

read.las

Read data from a .las or .laz file


Description

Reads data from .las or .laz files according to LAS specifications and returns a data.table labeled according to LAS specifications. See the ASPRS documentation for the LAS file format. The optional parameters enable the user to save memory by choosing to load only the fields they need. Moreover, the function provides a streaming filter to load only the points of interest into the memory and hence avoids allocating any superfluous memory.

Usage

read.las(files, select = "*", filter = "", transform = "")

Arguments

files

array of characters

select

character. select only columns of interest to save memory (see details)

filter

character. streaming filters - filter data while reading the file (see details)

transform

character. streaming transformation - transform data while reading the file (see details)

Details

Select: the 'select' argument specifies the data that will actually be loaded. For example, 'xyzia' means that the x, y, and z coordinates, the intensity and the scan angle will be loaded. The supported entries are t - gpstime, a - scan angle, i - intensity, n - number of returns, r - return number, c - classification, s - synthetic flag, k - keypoint flag, w - withheld flag, o - overlap flag (format 6+) u - user data, p - point source ID, e - edge of flight line flag, d - direction of scan flag, R - red channel of RGB color, G - green channel of RGB color, B - blue channel of RGB color, N - near-infrared channel. C - scanner channel (format 6+). Also numbers from 1 to 9 for the extra bytes data numbers 1 to 9. 0 enables all extra bytes to be loaded and '*' is the wildcard that enables everything to be loaded from the LAS file.
Note that x, y, z are implicit and always loaded. 'xyzia' is equivalent to 'ia'.

Filter: the 'filter' argument allows filtering of the point cloud while reading files. rlas relies on the well-known LASlib library written by Martin Isenburg to read the binary files. Thus the package 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 read.las(filter = "-help") to display the LASlib documentation and the available filters.

Transform: the 'transform' argument allows transformation of the point cloud while reading files. rlas relies on the well-known LASlib library written by Martin Isenburg to read the binary files. Thus the package inherits the tranform commands available in LAStools. To use these transformations the user can pass the common commands from LAStools into the parameter 'transform'. Type read.las(transform = "-help") to display the LASlib documentation and the available transformations

Value

A data.table

Examples

lasfile <- system.file("extdata", "example.las", package="rlas")

lasdata <- read.las(lasfile)
lasdata <- read.las(lasfile, filter = "-keep_first")
lasdata <- read.las(lasfile, filter = "-drop_intensity_below 80")
lasdata <- read.las(lasfile, select = "xyzia")

rlas

Read and Write 'las' and 'laz' Binary File Formats Used for Remote Sensing Data

v1.4.0
GPL-3
Authors
Jean-Romain Roussel [aut, cre, cph], Florian De Boissieu [aut, ctb] (Enable the support of .lax file and extra byte attributes), Martin Isenburg [cph] (Is the author of the LASlib and LASzip libraries), David Auty [ctb] (Reviewed the documentation), Pierrick Marie [ctb] (Helped to compile LASlib code in R), Tiago de Conto [ctb] (Implemented the -thin_with_voxel filter method)
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.