readLDA: FUSION R command line interface - Read LDA format files and...

View source: R/UtilityFunctions.R

readLDAR Documentation

FUSION R command line interface – Read LDA format files and return data frame or LAS-class object

Description

readLDA reads point data stored in FUSION's LDA format and returns either a data frame or a LAS-class object. To create the LAS-class object, you must provide an existing LAS or LAZ file to provide a template for the LAS header. Typically, this would be a file used to clip the LDA file using TreeSeg (this is the only FUSION program that can't output LAS files). The template file also provides coordinate system information for the LAS-class object.

Usage

readLDA(fileName = NULL, type = "DF", epsg = NULL, LASTemplate = NULL)

Arguments

fileName

character (required): Name of the LDA file containing point data.

type

character: Desired return type: "DF" for a data frame and "LAS" for LAS-class object.

epsg

numeric: EPSG code defining the projection for the point data. This is assigned to the LAS-class object when type = "LAS".

LASTemplate

character: File name (including path) for the LAS/LAZ file that will provide a template for the LAS header. Used only when type = "LAS".

Details

When type = "DF" (default), the return is a data frame containing the following columns:

  1. x

  2. y

  3. x

  4. pulse: pseudo-pulse number. This is generated using the GPS time when the LDA file is created

  5. return: return number

  6. angle: scan angle rank

  7. intensity: intensity

When type = "LAS", the LAS-class object returned by readLDA is somewhat imperfect. Many of the attributes for individual points are not populated with valid values because the LDA format does not have all of the information required to fully populate the point records. In particular, GPS time,number of returns in the pulse, and classification are not available. NumberOfReturns for all point records is set to 1 for all point records. This may cause tools designed to evaluate the validity of LAS data to throw warning since there may be points labeled as return 2, 3, ... yet the NumberOfReturns will still be 1.

Value

Return value depends on type. If type = "DF", return value is a (invisible) data frame with the columns listed above. If type = "LAS", return value is a (invisible) LAS-class object compatible with the lidR package.

See Also

Other helpers: readDTM(), writeDTM()

Examples

## Not run: 
pts <- readLDA("points.lda")
las <- readLDA("points.lda", type = "LAS", LASTemplate = "source.las")

## End(Not run)

bmcgaughey1/fusionwrapr documentation built on Dec. 1, 2024, 7:13 a.m.