Description Usage Arguments Value Examples
Each polygon of the canopy that is included in one of the provided volumes is
allocated to this volume. If a polygon crosses one or several sides of a
volume and if the parameter shred
is set to TRUE
, then the
polygon is recursively shreded into smaller polygons until none of them (with
an area > epsilon
) crosses the volume sides anymore.
1 2 | splitCanopy(canopy, volumeSet, shred = TRUE, epsilon = 1e-06,
parallel = FALSE, nCores = 2)
|
canopy |
A |
volumeSet |
A |
shred |
Logical. Should an intersected polygon be shreded into smaller polygons? |
epsilon |
Minimal polygon area to take into account. |
parallel |
Logical. Parallelization activation. |
nCores |
Number of cores to use if |
A c("Canopy", "data.frame")
object containing only the
polygons that were successfully allocated to a volume.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | rangeDim <- function(can, dim) {
range(sapply(can$vertices, function(i) range(i[, dim])))
}
volumes <- makeVolumeSet(rangeDim(plants, "x"),
rangeDim(plants, "y"),
rangeDim(plants, "z"),
intervals = rep(3, 3))
# With no parallelization:
allocatedPolygons <- splitCanopy(plants, volumes, shred = TRUE)
# With parallelization (experimental feature):
allocatedPolygons <- splitCanopy(plants, volumes, shred = TRUE,
parallel = TRUE, nCores = 8)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.