lasmetrics

0th

Percentile

Compute metrics for a cloud of points

lasmetrics 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:

Usage
lasmetrics(obj, func)
Arguments
obj

An object of class LAS

func

The function to be applied to a cloud of points. Function must return a list (see example)

Value

It returns a list containing the metrics

See Also

grid_metrics stdmetrics entropy VCI LAD

Aliases
  • lasmetrics
Examples
# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
lidar = readLAS(LASfile)

lasmetrics(lidar, max(Z))
lasmetrics(lidar, mean(ScanAngle))

# 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 = lasmetrics(lidar, myMetrics(Z, Intensity))

# Predefined metrics
lasmetrics(lidar, .stdmetrics)
# }
Documentation reproduced from package lidR, version 2.0.0, License: GPL-3

Community examples

Looks like there are no examples yet.