tlsTransform: Simple operations on point cloud objects

Description Usage Arguments Value XYZ Manipulation Examples

Description

Apply transformations to the XYZ axes of a point cloud.

Usage

1
2
3
4
5
6
tlsTransform(
  las,
  xyz = c("X", "Y", "Z"),
  bring_to_origin = FALSE,
  rotate = FALSE
)

Arguments

las

LAS object.

xyz

character vector of length 3 - LAS' columns to be reassigned as XYZ, respectively. Use minus signs to mirror an axis' coordinates - more details in the sections below.

bring_to_origin

logical - force point cloud origin to match c(0,0,0)? If TRUE, clears the header of the LAS object.

rotate

logical - rotate the point cloud to align the ground points horizontally (as in tlsRotate)?

Value

LAS object.

XYZ Manipulation

The xyz argument can take a few different forms. It is useful for shifting axes positions in a point cloud or to mirror an axis' coordinates. All axes characters can be entered in lower or uppercase and also be preceded by a minus sign ('-') to reverse its coordinates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
file = system.file("extdata", "pine.laz", package="TreeLS")
tls = readTLS(file)
bbox(tls)
range(tls$Z)

### swap the Y and Z axes
zy = tlsTransform(tls, c('x', 'z', 'y'))
bbox(zy)
range(zy$Z)

### return an upside down point cloud
ud = tlsTransform(tls, c('x', 'y', '-z'))
bbox(ud)
range(ud$Z)
plot(zy)

### mirror all axes, then set the point cloud's starting point as the origin
rv = tlsTransform(tls, c('-x', '-y', '-z'), bring_to_origin=TRUE)
bbox(rv)
range(rv$Z)

TreeLS documentation built on Aug. 26, 2020, 5:14 p.m.