-
abc authored725b315e
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metrics.R
\name{cloudTreeMetrics}
\alias{cloudTreeMetrics}
\title{Computation of tree metrics}
\usage{
cloudTreeMetrics(llasn, XY, plot.radius, res = 0.5,
func = stdTreeMetrics, ...)
}
\arguments{
\item{llasn}{list of LAS objects (from lidR package)}
\item{XY}{a dataframe or matrix with XY coordinates of plot centers}
\item{plot.radius}{numeric. plot radius in same unit as coordinates of LAS objects}
\item{res}{numeric. resolution of canopy height model computed with \code{\link{points2DSM}} before tree segmentation}
\item{func}{a function to be applied to the attributes of extracted trees (return from internal call to treeExtraction function to compute plot level metrics}
\item{...}{other parameters to be passed to \code{\link{treeSegmentation}}}
}
\value{
a dataframe with tree metrics in columns corresponding to LAS objects of the list (lines)
}
\description{
This function performs tree detection in each of LAS objects contained in a list and then computes summary statistics based on compute tree metrics for list of LAS objects (should be normalized clouds, with buffer around area of interest).
- calls the tree detection and extraction functions on each object
- remove the detected trees located outside of the regions of interest defined by their centers and radius
- computes summary statistics of remaining detected trees.
}
\examples{
data(laschablais3)
# extract three point clouds from LAS object
llas <- list()
llas[["A"]] <- lidR::lasclipCircle(laschablais3, 974350, 6581680, 10)
llas[["B"]] <- lidR::lasclipCircle(laschablais3, 974390, 6581680, 10)
llas[["C"]] <- lidR::lasclipCircle(laschablais3, 974350, 6581640, 10)
# normalize point clouds
llas <- lapply(llas, function(x) {lidR::lasnormalize(x, lidR::tin())})
# compute tree metrics
cloudTreeMetrics(llas,
cbind(c(974350, 974390, 974350), c(6581680, 6581680, 6581640)),
10, res=0.5)
# compute metrics with user-defined function
# number of detected trees between 20 and 30 meters and their mean height
user.func <- function(x, area.ha=NA)
{
dummy <- x$h[which(x$h>10 & x$h<20)]
data.frame(Tree.between.20.30=length(dummy)/area.ha, Tree.meanH=mean(dummy))
}
cloudTreeMetrics(llas, cbind(c(974350, 974390, 974350), c(6581680, 6581680, 6581640)), 10, res=0.5, func=user.func)
}
\seealso{
\code{\link{treeSegmentation}}, \code{\link{treeExtraction}}, \code{\link{stdTreeMetrics}}
}