Area-Based Approach in hexagonal cells.
Computes a series of descriptive statistics for a LiDAR dataset within hexagonal cells.
This function is identical to grid_metrics but with hexagonal cells instead of
square pixels. After all, we conduct circular plot inventories and we map models on pixel-based maps.
hexbin_metrics
provides the opportunity to test something else. Refer to grid_metrics
for more information.
hexbin_metrics(las, func, res = 20)
las |
An object of class |
func |
formula. An expression to be applied to each hexagonal cell. |
res |
numeric. To be consistent with grid_metrics, the square of |
A hexbin object from package hexbin
or a list
of
hexbin
objects if several metrics are returned.
Other metrics:
cloud_metrics()
,
grid_metrics()
,
point_metrics()
,
tree_metrics()
,
voxel_metrics()
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR") lidar = readLAS(LASfile,filter = "-keep_random_fraction 0.5") col = grDevices::colorRampPalette(c("blue", "cyan2", "yellow", "red")) # Maximum elevation with a resolution of 8 m hm = hexbin_metrics(lidar, ~max(Z), 8) hexbin::plot(hm, colramp = col, main = "Max Z") # Mean height with a resolution of 20 m hm = hexbin_metrics(lidar, ~mean(Z), 20) hexbin::plot(hm, colramp = col, main = "Mean Z") # 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 = hexbin_metrics(lidar, ~myMetrics(Z, Intensity), 10) hexbin::plot(metrics$zwimean, colramp = col, main = "zwimean") #hexbin::plot(metrics$zimean, colramp = col, main = "zimean") #hexbin::plot(metrics$zsqmean, colramp = col, main = "zsqmean")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.