Skip to contents

Returns a summary data.frame containing the tree position (X,Y-coordinates), tree height, diameter at breast height, functional diameter at breast height, diameter above buttresses, functional diameter above buttresses, projected (crown) area and (crown) volume.

Usage

summary_basic_pointcloud_metrics(
  PCs_path,
  extension = ".txt",
  dtm = NA,
  r = 5,
  crown = FALSE,
  thresholdbranch = 1.5,
  minheight = 1,
  concavity = 2,
  alpha = 1,
  buttress = FALSE,
  thresholdR2 = 0.001,
  slice_thickness = 0.06,
  thresholdbuttress = 0.001,
  maxbuttressheight = 7,
  functional = TRUE,
  concavity_fdiameter = 4,
  OUT_path = FALSE,
  plot = FALSE,
  plotcolors = c("#000000", "#808080", "#1c027a", "#08aa7c", "#fac87f")
)

Arguments

PCs_path

A character with the path to the folder that contains the tree point clouds.

extension

A character refering to the file extension of the point cloud files (default=".txt"). Can be ".txt", ".ply" or ".las". Only relevant if the tree point clouds are available.

dtm

The digital terrain model from tree_height_pc.

r

Numeric value (default=5) r which determines the range taken for the dtm from tree_height_pc. Only relevant if a dtm is provided.

crown

Logical (default=FALSE), indicates if the area and volume is calculated based on the full point clouds (crown = FALSE) or only on the crown point clouds (crown = TRUE).

thresholdbranch

Numeric value (default=1.5) from classify_crown_pc. Only relevant when crown == TRUE.

minheight

Numeric value (default=1) from classify_crown_pc. The default value is based on non-buttressed trees. Choose a higher value (e.g. 4) for buttressed trees. Only relevant when crown == TRUE.

concavity

Numeric value (default=2). Parameter of the projected_area_pc function used to calculate the projected crown area.

alpha

Numeric value (default=1). Parameter of the alpha_volume_pc function used to calculate the crown volume.

buttress

Logical (default=FALSE), indicates if the trees have buttresses (higher than breast height).

thresholdR2

Numeric value (default=0.001). Parameter of the dbh_pc function used to calculate the diameter at breast height. Only relevant if buttress == FALSE.

slice_thickness

Numeric value (default = 0.06). Parameter of the dbh_pc and dab_pc functions used to calculate the diameter at breast height and above buttresses.

thresholdbuttress

Numeric value (default=0.001). Parameter of the dab_pc function used to calculate the diameter above buttresses. Only relevant when buttress == TRUE.

maxbuttressheight

Numeric value (default=7). Parameter of the dab_pc function used to calculate the diameter above buttresses. Only relevant when buttress == TRUE.

functional

Logical (default=FALSE), indicates if the functional diameter should be calculated.

concavity_fdiameter

Numeric value (default=4) concavity for the computation of the functional diameter using a concave hull based on concaveman. This concavity value is used in the functions diameter_slice_pc, dbh_pc, dab_pc, and classify_crown_pc.

OUT_path

A character with name of the output file (including the path to the folder), where the summary csv file should be saved or logical (default=FALSE) in this case no csv file is produced.

plot

Logical (default=FALSE), indicates if summary figure for each tree point cloud is plotted. If an OUT_path is provided, the figures are saved in the OUT_path.

plotcolors

list of five colors for plotting. Only relevant when plot = TRUE. The stem points above buttresses, stem points at breast height, fitted circle, the concave hull and the estimated center are colored by the first, second, third, fourth and fifth element of this list respectively.

Value

The summary of the basic structural metrics for multiple tree point clouds as a data.frame. Includes the tree height, diameter at breast height, diameter above buttresses, projected (crown) area and (crown) volume. The summary is saved in a csv file if an output folder is provided.

Details

The tree position, tree height, diameter at breast height, functional diameter at breast height, diameter above buttresses, functional diameter above buttresses, projected (crown) area and (crown) volume are otained with tree_position_pc, tree_height_pc, dbh_pc, dab_pc, projected_area_pc and alpha_volume_pc respectively.

Examples

if (FALSE) {
# Calculate the summary with default parameters and export to csv
summary <- summary_basic_pointcloud_metrics(
  PCs_path = "path/to/folder/PCs/",
  OUT_path = "path/to/out/folder/"
)
# Calculate the summary with non-default parameter values
# recommended for buttressed trees
summary <- summary_basic_pointcloud_metrics(
  PCs_path = "path/to/folder/PCs/",
  extension = ".ply", crown = TRUE,
  minheight = 4, buttress = TRUE
)
}