How to use the functions
Source:vignettes/how-to-use-the-functions.Rmd
how-to-use-the-functions.Rmd
About
This package provides some helper functions to conveniently change or
extract metadata from laz files. It makes use of the lidR
and lasR
packages.
Plot extent
Use the function plot_extent()
to plot the bounding
boxes of all laz files in the folder on top of an interactive map (using
the mapview
package).
f <- system.file("extdata", package="managelidar")
plot_extent(f)
Get density
Use the function get_density()
to extract the
approximate pulse density (first/last-return only) of laz files. For
this function only the header from lasfiles is read and density is
calculated from the bounding box of the data file and the number of
first-returns. This does not take into account if parts of the bounding
box is missing data, and hence this density does not reflect the density
as it is calculates by e.g. lidR
. However, it is much
faster because it does not read the entire file and density should be
approximately the same if the entire bounding box has point data.
f <- system.file("extdata", package="managelidar")
get_density(f)
#> filename npoints npulses area
#> 1 3dm_32_547_5724_1_ni_20240327.laz 2936 2606 309656.1 [m^2]
#> 2 3dm_32_547_5725_1_ni_20240327.laz 3369 1340 347095.0 [m^2]
#> 3 3dm_32_548_5724_1_ni_20240327.laz 10000 3426 988760.1 [m^2]
#> 4 3dm_32_548_5725_1_ni_20240327.laz 10000 4247 987443.7 [m^2]
#> pointdensity pulsedensity
#> 1 0.009481486 [1/m^2] 0.008415787 [1/m^2]
#> 2 0.009706277 [1/m^2] 0.003860615 [1/m^2]
#> 3 0.010113677 [1/m^2] 0.003464946 [1/m^2]
#> 4 0.010127160 [1/m^2] 0.004301005 [1/m^2]