setTLS: (Re-)Create a 'LAS' object depending on the input's type

Description Usage Arguments Value Examples

View source: R/methods.R

Description

Reset the input's header if it is a LAS object, or generate a new LAS from a table-like input. For more information, checkout lidR::LAS.

Usage

1
setTLS(cloud, col_names = NULL)

Arguments

cloud

LAS, data.frame, matrix or similar object to be converted.

col_names

optional - character vector. Only used for table-like objects. It states the column names. If not set, only the 3 first columns will be used and assigned to the XYZ fields.

Value

LAS object.

Examples

1
2
3
cloud = matrix(runif(300, 0, 10), ncol=3)
cloud = setTLS(cloud)
summary(cloud)

Example output

Loading required package: data.table
Loading required package: magrittr
Loading required package: lidR
Loading required package: raster
Loading required package: sp

Attaching package:rasterThe following object is masked frompackage:magrittr:

    extract

The following object is masked frompackage:data.table:

    shift

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 
class        : LAS (v1.2 format 0)
memory       : 12.3 Kb 
extent       : 0.039, 9.914, 0.148, 9.962 (xmin, xmax, ymin, ymax)
coord. ref.  : NA 
area         : 87.71134 units²
points       : 100  points
density      : 1.14 points/units²
File signature:           LASF 
File source ID:           0 
Global encoding:
 - GPS Time Type: Standard GPS Time 
 - Synthetic Return Numbers: no 
 - Well Know Text: CRS is GeoTIFF 
 - Aggregate Model: false 
Project ID - GUID:        00000000-0000-0000-0000-000000000000 
Version:                  1.2
System identifier:        rlas R package 
Generating software:      rlas R package 
File creation d/y:        35/2021
header size:              227 
Offset to point data:     227 
Num. var. length record:  
Point data format:        0 
Point data record length: 20 
Num. of point records:    100 
Num. of points by return: 0 0 0 0 0 
Scale factor X Y Z:       1e-04 1e-04 1e-04 
Offset X Y Z:             0 0 0 
min X Y Z:                0.039 0.148 0.154 
max X Y Z:                9.914 9.962 9.91 
Variable length records:  void

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