Learn R Programming

CspStandSegmentation (version 0.1.2)

plot_inventory: Function to plot the inventory results into a lidR 3d plot of the point cloud

Description

Function to plot the inventory results into a lidR 3d plot of the point cloud

Usage

plot_inventory(plot, inventory, col = NA, cex = 1.5, label_col = "white")

Value

the plot with the inventory results

Arguments

plot

lidR 3d plot

inventory

data.frame with the inventory results

col

color of the spheres

cex

numeric size of the labels

label_col

character color of the labels

Examples

Run this code
# \donttest{
# read example data
file = system.file("extdata", "beech.las", package="CspStandSegmentation")
las = lidR::readTLSLAS(file)

# find tree positions as starting points for segmentation
map <- CspStandSegmentation::find_base_coordinates_raster(las)

# segment trees
segmented <- las |>
  CspStandSegmentation::add_geometry(n_cores = 2) |>
  CspStandSegmentation::csp_cost_segmentation(map, 1, N_cores = 2)

# perform inventory
inventory <- CspStandSegmentation::forest_inventory(segmented, n_cores = 2)

# plot the results
if (FALSE) {
x <- lidR::plot(segmented, color = "TreeID")
plot_inventory(x, inventory)
}
# }

Run the code above in your browser using DataLab