This function integrates both, the normalize
and tree.detection.single.scan
or tree.detection.multi.scan
functions, generating the same ‘Output Files’ as indicated for these, and it returs the same ‘Value’ as described for tree.detection.single.scan
or tree.detection.multi.scan
respectively. However, this function is designed for working with several plots, producing a list of all scans considered automatically from LAS files.
tree.detection.several.plots(las.list, id.list = NULL, file = NULL, scan.approach = "single",
pcd.red = NULL, normalized = NULL,
center.coord = NULL,
x.side = NULL, y.side = NULL,
max.dist = NULL, min.height = NULL, max.height = 50,
algorithm.dtm = "knnidw", res.dtm = 0.2,
csf = list(cloth_resolution = 0.5),
intensity = NULL, RGB = NULL, voxel_size = NULL,
single.tree = NULL,
dbh.min = 4, dbh.max = 200, h.min = 1.3,
ncr.threshold = 0.1,
tls.resolution = NULL, tls.precision = NULL,
density.reduction = 2,
stem.section = c(0.7, 3.5), stem.range = NULL, breaks = NULL,
slice = 0.1, understory = NULL, bark.roughness = 1,
den.type = 1, d.top = NULL,
plot.attributes = NULL, plot = NULL,
dir.data = NULL, save.result = TRUE, dir.result = NULL)
Data frame with the same description and format as tree.detection.single.scan
and tree.detection.multi.scan
‘Values’. In this case, the id
of plots will be encoded with correlative numbers from 1 to n, where n is the number of LAS files included in files
argument, and file
column will be encoded as id
, but including .las extension.
Character vector containing the names of all LAS files for analysis and belonging to TLS point cloud, including .las extension (see ‘Examples’)
Optional vector with plots identification encoded as character string or numeric. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, the plots will be encoded with correlative numbers from 1 to n plots.
Optional vector containing files name identification encoded as character string or numeric value. If it is null, file will be encoded as id
by default.
Character parameter indicating TLS single-scan (‘single’) or TLS multi-scan approach or SLAM point clouds (‘multi’) approaches. If this argument is not specified by the user, it will be set to ‘multi’ approach.
Optional argument to indicate if point cloud density must be reduced to detect trees.
Optional argument to establish as TRUE
when point cloud is already normalized.
Planimetric x and y center coordinate of the plots. They has to be introduced as a data frame object with the following columns names: 'id', 'x' and 'y'. They represent plot id, and center coordinates respectively.
x-side (m) of the plot when the plot is square or rectangular.
y-side (m) of the plot when the plot is square or rectangular.
Optional maximum horizontal distance (m) considered from the plot centre. All points farther than max.dist
will be discarded after the normalization process. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, all points will be used in processing, with max.dist
representing the farthest point.
Optional minimum height (m) considered from ground level. All points below min.height
will be discarded after the normalization process. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, all points will be used in processing, with min.height
representing the lowest point.
Optional maximum height (m) considered from ground level. All points above max.height
will be discarded after the normalization process. If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, all points will be used in processing, with max.height
representing the highest point.
Algorithm used to generate the digital terrain model (DTM) from the TLS point cloud. There are two posible options based on spatial interpolation: ‘tin’ and ‘knnidw’ (see ‘Details’). If this argument is not specified by the user, it will be set to ‘knnidw’ algorithm.
Numeric parameter. Resolution of the DTM generated to normalize point cloud (see ‘Details’). If this argument is not specified by the user, it will be set to 0.2 m.
List containing parameters of CSF algorithm:
cloth_resolution
: by default 0.5.
Logical parameter useful when point clouds have intensity values. It may be useful in some internal process to filter data.
Logical parameter useful when point clouds are colorized, thus including values of RGB colors. It is based on the Green Leaf Algorithm (GLA) (see ‘Details’).
Defines the size of the 3D grid cells used for downsampling.
Optional argument to indicate if there is only one tree.
Optional minimum dbh (cm) considered for detecting trees. By default it will be set at 4 cm.
Optional maximum dbh (cm) considered for detecting trees. By default it will be set at 200 cm.
Optional minimum h (m) considered for detecting trees. By default it will be set at 1.3 m.
Local surface variation (also known as normal change rate, NCR). By default it will be set as 0.1. For better understanding of this argument see ‘Details’.
List containing parameters of TLS resolution. This can be defined by the angle aperture:
horizontal.angle
: horizontal angle aperture (degrees).
vertical.angle
: vertical angle aperture (degrees).
point.dist
: distance (mm) between two consecutive points.
tls.dist
: distance (m) from TLS at which two consecutive points are separated by point.dist
.
If this argument is not specified by the user, it will be set to NULL by default and, as a consequence the function will stop giving an error message.
Optional argument indicating the average point cloud precision in cm.
Density reduction intensity.
Section free of noise (shurb, branches, etc.) considered to detect trees. If not specified, an automatic internal algorithm will be applied (see ‘Details’).
Height above ground level (m) of slices considered for detecting trees. By default it will be considered all possible sections from 0.1 m to maximum height by 0.3 m intervals (+/- 5 cm).
Section considered to estimate straightness tree attributes.
Slice width considered for detecting trees. By default it will be considered as 0.1 m.
Optional argument to indicate if there is dense understory vegetation.
Bark roughness established in 3 degrees (1 < 2 < 3). By default it will be considered as 2.
Numeric argument indicating the dendrometic type used to estimate volumen when there are not sections enough to fit a taper equation. Dendrometrics types available are the following: cylinder = 0, paraboloid = 1 (by default), cone = 2 and neiloid = 3.
Top stem diameter (cm) considered to estimate commercial timber volume.
Data frame with attributes at plot level. It must contain a column named id
(character string or numeric value) with encoding coinciding with that used in id
argument of normalize
for identifying plots. If there are strata, another column named ‘stratum’ (numeric) will be required for other functionalities of FORTLS (see, for instance, estimation.plot.size
or metrics.variables
). If this argument is not specified by the user, it will be set to NULL by default and, as a consequence, the function will not add these possible plot attributes.
Optional logical which indicates whether or not the normalized point cloud will be plot. If this argument is not specified by the user, it will be set to TRUE
by default and, as consequence, the normalized point cloud will be plot.
Optional character string naming the absolute path of the directory where LAS files containing TLS point clouds are located. .Platform$file.sep
must be used as the path separator in dir.dat
. If this argument is not specified by the user, it will be set to NULL
by default and, as consequence, the current working directory of the R process will be assigned to dir.dat
during the execution.
Optional logical which indicates whether or not the output files described in ‘Output Files’ section should be saved in the dir.result
. If this argument is not specified by the user, it will be set to TRUE
by default and, as a consequence, the output files will be saved.
Optional character string naming the absolute path of an existing directory where files described in ‘Output Files’ section will be saved. .Platform$file.sep
must be used as the path separator in dir.result
. If this argument is not specified by the user, and save.result
is TRUE
, it will be set to NULL
by default and, as a consequence, the current working directory of the R process will be assigned to dir.result
during the execution.
At the end of the tree detection process, if the save.result
argument is TRUE
, the function will save both, the reduced point clouds as TXT files encoded according to file
column of ‘Value’; and the data frame with the tree list described in ‘Value’ as CSV file (see normalize
and tree.detection.single.scan
or tree.detection.multi.scan
‘Output files’). All outputs are written without row names in the dir.result
directory using vroom_write function from vroom package.
Juan Alberto Molina-Valero and Adela Martínez-Calvo.
See normalize
, tree.detection.single.scan
and tree.detection.multi.scan
for further details.
normalize
, tree.detection.single.scan
,tree.detection.multi.scan
, distance.sampling
, estimation.plot.size
, simulations
, metrics.variables
.
# \donttest{
# Establishment of working directories (optional)
# By default here we propose the current working directory of the R process
dir.data <- getwd()
dir.result <- getwd()
# Loading example data (LAZ files) to dir.data
download.file(
"www.dropbox.com/scl/fi/hzzrt0a39crdy6uvcj9el/PinusSylve1.laz?rlkey=svpwvorkm8889fgbnj14ns1f2&dl=1",
destfile = file.path(dir.data, "PinusSylvestris1.laz"),
mode = "wb")
download.file(
"www.dropbox.com/scl/fi/zeszze31jh5m1g4o3ns1o/PinusSylve2.laz?rlkey=wx72bi6ggdc7wedwgzupekp9k&dl=1",
destfile = file.path(dir.data, "PinusSylvestris2.laz"),
mode = "wb")
# Obtaining a vector with names of LAZ files located in dir.data
files <- list.files(pattern = "laz$", path = dir.data)
# Tree detection (TLS single-scan aproach)
id <- c("PinusSylvestris1", "PinusSylvestris2")
center.coord <- data.frame(id = id,
x = rep(0, length(id)),
y = rep(0, length(id)))
tree.tls <- tree.detection.several.plots(las.list =
c("PinusSylvestris1.laz",
"PinusSylvestris2.laz"),
id = id,
tls.resolution = list(point.dist = 7.67, tls.dist = 10),
plot = TRUE)
# }
Run the code above in your browser using DataLab