Skip to contents

Delaunay triangulation. Can be used to build a DTM, a CHM, normalize a point cloud, or any other application. This stage is typically used as an intermediate process without an output file. This stage does not modify the point cloud.

Usage

triangulate(max_edge = 0, filter = "", ofile = "", use_attribute = "Z")

Arguments

max_edge

numeric. Maximum edge length of a triangle in the Delaunay triangulation. If a triangle has an edge length greater than this value, it will be removed. If max_edge = 0, no trimming is done (see examples).

filter

the 'filter' argument allows filtering of the point-cloud to work with points of interest. The available filters are those from LASlib and can be found by running filter_usage. For a given stage when a filter is applied, only the points that meet the criteria are processes. The most common strings are "-keep_first", "-keep_class 2", "drop_z_below 2". For more details see filters.

ofile

character. Full outputs are always stored on disk. If ofile = "" then the stage will not store the result on disk and will return nothing. It will however hold partial output results temporarily in memory. This is useful for stage that are only intermediate stage.

use_attribute

character. By default the triangulation is performed on the coordinate Z. Can also be the name of an extra bytes attribute such as 'HAG' if it exists. Can also be 'Intensity'.

Examples

f <- system.file("extdata", "Topography.las", package="lasR")
read <- reader_las()
tri1 <- triangulate(25, filter = keep_ground(), ofile = tempgpkg())
filter <- "-keep_last -keep_random_fraction 0.1"
tri2 <- triangulate(filter = filter, ofile = tempgpkg())
pipeline <- read + tri1 + tri2
ans <- exec(pipeline, on = f)
#plot(ans[[1]])
#plot(ans[[2]])