Read .las or .laz files

Reads .las or .laz files in format 1 to 3 according to LAS specification and returns an object of class LAS. If several files are given the returned LAS object is considered as one LAS file. The information retained in the header will be read from the first file in the list. The optional parameters enable the user to save a substantial amount of memory by choosing to load only the fields or points required. These internal options are much more memory efficient than any other R code.

readLAS(files, select = "xyztinrcaRGBP", filter = "", ...)

array of characters or a LAScatalog object


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


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


compatibility with former arguments from lidR (<= 1.2.1)


The 'select' argument specifies which data 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, 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, * - is the wildcard and enables everything from the LAS file. x, y, z are implicit and always loaded. 'xyzia' is equivalent to 'ia' and an empty string is equivalent to 'xyz' but select = "xyz" is more readable and explicit than select = "".

Three extra metrics can be computed on the fly with the following flags: P - pulse id, F - flightline id and C - color string (see Class LAS. The symbol + is a shortcut for 'PFC'.

The 'filter' argument allows filtering of the point cloud while reading files. This is much more efficient than lasfilter in many ways. If the desired filters are known before reading the file, the internal filters should always be preferred. The available filters are those from LASlib and can be found by running the following command: rlas:::lasfilterusage()


A LAS object

See Also

Class LAS LAScatalog

  • readLAS
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las = readLAS(LASfile)
las = readLAS(LASfile, select = "xyz")
las = readLAS(LASfile, select = "xyzi", filter = "-keep_first")
las = readLAS(LASfile, select = "xyziar", filter = "-keep_first -drop_z_below 0")
las = readLAS(LASfile, select = "*+")
# }
Documentation reproduced from package lidR, version 1.3.0, License: GPL-3

Community examples

Looks like there are no examples yet.