Learn R Programming

lidR (version 2.2.5)

LAS-class: An S4 class to represent a .las or .laz file

Description

Class LAS is the representation of a las/laz file according to the LAS file format specifications.

Usage

LAS(data, header = list(), proj4string = sp::CRS(), check = TRUE)

Arguments

data

a data.table containing the data of a las or laz file.

header

a list or a LASheader containing the header of a las or laz file.

proj4string

projection string of class CRS-class.

check

logical. Conformity tests while building the object.

Value

An object of class LAS

Functions

  • LAS: creates objects of class LAS. The original data is updated by reference to clamp the coordinates with respect to the scale factor of the header. If header is not provided scale factor is set to 0.001

Slots

bbox

Object of class matrix, with bounding box

proj4string

Object of class CRS, projection string

data

Object of class data.table. Point cloud data according to the LAS file format

header

Object of class LASheader. las file header according to the LAS file format

Extends

Class Spatial, directly.

Details

A LAS object inherits a Spatial object from sp. Thus it is a Spatial object plus a data.table with the data read from a las/laz file and a LASheader (see the ASPRS documentation for the LAS file format for more information). Because las files are standardized the table of attributes read from the las/laz file is also standardized. Columns are named:

  • X (numeric)

  • Y (numeric)

  • Z (numeric)

  • Intensity (integer)

  • ReturnNumber (integer)

  • NumberOfReturns (integer)

  • ScanDirectionFlag (integer)

  • EdgeOfFlightline (integer)

  • Classification (integer)

  • Synthetic_flag (logical)

  • Keypoint_flag (logical)

  • Withheld_flag (logical)

  • ScanAngle (integer)

  • UserData (integer)

  • PointSourceID (integer)

See Also

readLAS

Examples

Run this code
# NOT RUN {
# Read a las/laz file
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
las

# Creation of a LAS object out of external data
data <- data.frame(X = runif(100, 0, 100),
                   Y = runif(100, 0, 100),
                   Z = runif(100, 0, 20))
data

las <- LAS(data) # /!\ data is updated by reference

data
las
# }

Run the code above in your browser using DataLab