Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/artificial_stand.R
Create an artificial forest stand of a given area using tree point clouds.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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.
1 2 3 4 5 6 7 8 9 10 | #' #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.