lidR (version 2.0.1)

lastransform: Datum transformation for LAS objects

Description

A version of spTrasform for LAS objects. Returns transformed coordinates of a LAS object from the projection of the object to the the projection given by arguments.

Usage

lastransform(las, epsg, CRSobj = NULL)

Arguments

las

An object of class LAS

epsg

integer. Unlike spTransform the EPSG code of the CRS should be preferred for LAS objects. See also epsg to understand why. If missing, CRSobj will be used instead.

CRSobj

logical. Object of class CRS or of class character, in which case it is converted to CRS.

Value

An object of class LAS with coordinates XY transformed to the new coordinate reference system.

Examples

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

head(las@data)

las <- lastransform(las, 26918)
# }

Run the code above in your browser using DataCamp Workspace