lidR (version 1.2.1)

readLAS: Read .las or .laz files

Description

Read .las or .laz files in format 1 to 4 according to LAS specification and return an object of class LAS

Usage

readLAS(files, Intensity = TRUE, ReturnNumber = TRUE,
  NumberOfReturns = TRUE, ScanDirectionFlag = FALSE,
  EdgeOfFlightline = FALSE, Classification = TRUE, ScanAngle = TRUE,
  UserData = FALSE, PointSourceID = FALSE, RGB = TRUE, pulseID = TRUE,
  flightlineID = FALSE, color = TRUE, XYZonly = FALSE, all = FALSE,
  filter = "")

Arguments

files

array of characters or a Catalog object

Intensity

logical. do you want to load the Intensity field? default: TRUE

ReturnNumber

logical. do you want to load the ReturnNumber field? default: TRUE

NumberOfReturns

logical. do you want to load the NumberOfReturns field? default: TRUE

ScanDirectionFlag

logical. do you want to load the ScanDirectionFlag field? default: FALSE

EdgeOfFlightline

logical. do you want to load the EdgeOfFlightline field? default: FALSE

Classification

logical. do you want to load the Classification field? default: TRUE

ScanAngle

logical. do you want to load the ScanAngle field? default: TRUE

UserData

logical. do you want to load the UserData field? default: FALSE

PointSourceID

logical. do you want to load the PointSourceID field? default: FALSE

RGB

logical. do you want to load R,G and B fields? default: TRUE

pulseID

logical. do you want to compute the extra field pulseID? default: TRUE

flightlineID

logical. do you want to compute the extra field flightlineID? default: FALSE

color

logical. do you want to compute the extra field color? default: FALSE

XYZonly

logical. Overwrite all other options. Load only X, Y, Z fields. default: FALSE

all

logical. Overwrite all other options. Load everything. default: FALSE

filter

character. filter data while reading the file (streaming filter) without allocating any additional memory. (see rlas::readlasdata).

Value

A LAS object

Details

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 logical parameters enable the user to save memory by choosing to load only the fields they need. Indeed, the readLAS function does not 'stream' the data. Data is loaded into the computer's memory (RAM) suboptimally because R does not accommodate many different data types.

See Also

Class LAS Catalog

Examples

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

Run the code above in your browser using DataCamp Workspace