Learn R Programming

lidR (version 1.4.2)

grid_density: Map the pulse or point density

Description

Creates a pulse density map using a LiDAR point cloud. This function is an alias for grid_metrics(obj, f, res) with f = length(unique(pulseID))/res^2)

Usage

grid_density(x, res = 4, filter = "")

Arguments

x

An object of class LAS or a catalog (see section "Use with a LAScatalog")

res

numeric. The size of a grid cell in LiDAR data coordinates units. Default is 4 = 16 square meters.

filter

character. Streaming filter while reading the files (see readLAS). If x is a LAScatalog the function readLAS is called internally. The user cannot manipulate the lidar data directly but can use streaming filters instead.

Value

Returns a data.table of class lasmetrics which enables easier plotting and RasterLayer casting.

Use with a <code>LAScatalog</code>

When the parameter x is a LAScatalog the function processes the entire dataset in a continuous way using a multicore process. Parallel computing is set by default to the number of core available in the computer. The user can modify the global options using the function catalog_options. lidR support .lax files. Computation speed will be signifcantly improved with a spatial index.

See Also

grid_metrics

Examples

Run this code
# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
lidar = readLAS(LASfile)

lidar %>% grid_density(5) %>% plot
lidar %>% grid_density(10) %>% plot
# }

Run the code above in your browser using DataLab