
Last chance! 50% off unlimited learning
Sale ends in
cloud_metrics
computes a series of user-defined descriptive statistics for a LiDAR dataset.
See grid_metrics to compute metrics on a grid. Basically there are
no predefined metrics. Users must write their own functions to create metrics (see example).
The following existing functions can serve as a guide to help users compute their own metrics:
cloud_metrics(las, func)
An object of class LAS
formula. An expression to be applied to the point cloud (see example)
It returns a list
containing the metrics
grid_metrics stdmetrics entropy VCI LAD
Other metrics:
grid_metrics()
,
hexbin_metrics()
,
point_metrics()
,
tree_metrics()
,
voxel_metrics()
# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
lidar = readLAS(LASfile)
cloud_metrics(lidar, ~max(Z))
cloud_metrics(lidar, ~mean(Intensity))
# Define your own new metrics
myMetrics = function(z, i)
{
metrics = list(
zwimean = sum(z*i)/sum(i), # Mean elevation weighted by intensities
zimean = mean(z*i), # Mean products of z by intensity
zsqmean = sqrt(mean(z^2)) # Quadratic mean
)
return(metrics)
}
metrics = cloud_metrics(lidar, ~myMetrics(Z, Intensity))
# Predefined metrics
cloud_metrics(lidar, .stdmetrics)
# }
Run the code above in your browser using DataLab