View source: R/artificial_stand.R
artificial_stand | R Documentation |
Create an artificial forest stand of a given area using tree point clouds.
artificial_stand( files, n.trees, dimension, coordinates = NULL, sample = TRUE, replace = TRUE, overlap = NULL, rotation = TRUE, degrees = NULL, n_attempts = 100, progress = TRUE, plot = TRUE, ... )
files |
A |
n.trees |
A positive |
dimension |
A positive |
coordinates |
A |
sample |
Logical. If |
replace |
Logical. If |
overlap |
A positive |
rotation |
Logical. If |
degrees |
A positive |
n_attempts |
A positive |
progress |
Logical, if |
plot |
Logical. If |
... |
Parameters passed to |
When coordinates = NULL
, artifical_stand
adds, in sequence,
random coordinates to each files
in the future stand based on the
crown area overlap
. That is, first a tree from files
is
randomly located within the stand dimention
, then a second tree from
files
will be located in the future stand based on the crown area
overlap
from the previous tree, and so on. If during the random
location a given tree does not meet the requirements of overlap
, new
random coordinates will be provided until the requirements are met.
Since artificial_stand
will try to add tree to the stand until the
requirements are met, this could lead to an infinite loop if the stand
dimention
is small or if the trees on files
are large or many
n.trees
. Therefore, the use of n_attempts
is recommended to avoid
this scenario.
A list
which contain a data.table
(Trees) with the information of the point clouds used and their current coordinates in the stand, and another data.table
with that compile all the point clouds used.
J. Antonio Guzmán Q.
voxels_counting
#' #Import an example point cloud path <- system.file("extdata", "pc_tree.txt", package = "rTLS") #Creates a stand of 4 trees with 10% of overlap files <- rep(path, 4) artificial_stand(files, n.trees = 4, dimension = c(15, 15), overlap = 10) #Creates a stand of 4 trees with their locations location <- data.table(X = c(5, 10, 10, 5), Y = c(5, 5, 10, 10)) artificial_stand(files, n.trees = 4, dimension = c(15, 15), coordinates = location)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.