lidR v2.0.0

0

Monthly downloads

0th

Percentile

Airborne LiDAR Data Manipulation and Visualization for Forestry Applications

Airborne LiDAR (Light Detection and Ranging) interface for data manipulation and visualization. Read/write 'las' and 'laz' files, computation of metrics in area based approach, point filtering, artificial point reduction, classification from geographic data, normalization, individual tree segmentation and other manipulations.

Readme


license

R package for Airborne LiDAR Data Manipulation and Visualization for Forestry Applications

The lidR package provides functions to read and write .las and .laz files, plot point clouds, compute metrics using an area-based approach, compute digital canopy models, thin lidar data, manage a catalog of datasets, automatically extract ground inventories, process a set of tiles using multicore processing, individual tree segmentation, classify data from geographic data, and provides other tools to manipulate LiDAR data in a research and development context.

  • Development of the lidR package between 2015 and 2018 was made possible thanks to the financial support of the AWARE project (NSERC CRDPJ 462973-14); grantee Prof Nicholas Coops.
  • Development of the lidR package between 2018 and 2019 was made possible thanks to the financial support of the Ministère des Forêts, de la Faune et des Parcs of Québec.

:book: Read the Wiki pages to get started with the lidR package.

Key features

Read and display a las file

In R-fashion style the function plot, based on rgl, enables the user to display, rotate and zoom a point cloud. Because rgl has limited capabilities with respect to large datasets, we also made a package PointCloudViewer with greater display capabilities.

las <- readLAS("<file.las>")
plot(las)

Compute a canopy height model

lidR has several algorithms from the literature to compute canopy height models either point-to-raster based or triangulation based. This allows testing and comparison of some methods that rely on a CHM, such as individual tree segmentation or the computation of a canopy roughness index.

las <- readLAS("<file.las>")

# Khosravipour et al. pitfree algorithm
thr <- c(0,2,5,10,15)
edg <- c(0, 1.5)
chm <- grid_canopy(las, 1, pitfree(thr, edg))

plot(chm)

Read and display a catalog of las files

lidR enables the user to manage, use and process a catalog of las files. The function catalog builds a LAScatalog object from a folder. The function plot displays this catalog on an interactive map using the mapview package (if installed).

ctg <- catalog("<folder/>")
plot(ctg, map = TRUE)

From a LAScatalog object the user can (for example) extract some regions of interest (ROI) with lasclip. Using a catalog for the extraction of the ROI guarantees fast and memory-efficient clipping. LAScatalog objects allow many other manipulations that can be done with multicore processing, where possible.

Individual tree segmentation

The lastrees function has several algorithms from the literature for individual tree segmentation, based either on the digital canopy model or on the point-cloud. Each algorithm has been coded from the source article to be as close as possible to what was written in the peer-reviewed papers. Our goal is to make published algorithms usable, testable and comparable.

las <- readLAS("<file.las>")

las <- lastrees(las, li2012())
col <- random.colors(200)
plot(las, color = "treeID", colorPalette = col)

Wall-to-wall dataset processing

Most of the lidR functions can process seamlessly a set of tiles and return a continuous output. Users can create their own methods using the LAScatalog processing engine via the catalog_apply function. Among other features the engine takes advantage of point indexation with lax files, takes care of processing tiles with a buffer and allows for processing big files that do not fit in memory.

# Load a LAScatalog instead of a LAS file
ctg <- catalog("<path/to/folder/>")

# Process it like a LAS file
chm <- grid_canopy(ctg, 2, p2r())
col <- random.colors(50)
plot(chm, col = col)

Other tools

lidR has many other tools and is a continuously improved package. If it does not exist in lidR please ask us for a new feature, and depending on the feasibility we will be glad to implement your requested feature.

Install lidR

  • The latest released version from CRAN with
install.packages("lidR")
  • The latest stable development version from github with
devtools::install_github("Jean-Romain/rlas")
devtools::install_github("Jean-Romain/lidR")

To install the package from github make sure you have a working development environment.

  • Windows: Install Rtools.exe.
  • Mac: Install Xcode from the Mac App Store.
  • Linux: Install the following libraries:
sudo apt-get install libgdal-dev libgeos++-dev libudunits2-dev libproj-dev libx11-dev libgl-dev libglu-dev libfreetype6-dev libv8-3.14-dev libcairo2-dev

Changelog

See changelogs on NEW.md

Functions in lidR

Name Description
area Surface covered by a LAS* object.
entropy Normalized Shannon diversity index
LAD Leaf area density
LAS-class An S4 class to represent a .las or .laz file
catalog_options_tools Get or set LAScatalog processing engine options
LASheader Create a LASheader object
grid_density Map the pulse or point density
VCI Vertical Complexity Index
grid_hexametrics Area-Based Approach in hexagonal cells.
homogenize Point Cloud Decimation Algorithm
epsg Get or set epsg code of a LAS* object
grid_canopy Digital Surface Model
gap_fraction_profile Gap fraction profile
catalog_retile Retile a LAScatalog
lasfilterdecimate Decimate a LAS object
lasfilters Predefined filters
lasfiltersurfacepoints Filter the surface points
lasfilterduplicates Filter duplicated points
is.empty Test if a LAS object is empty
lassnags Snag classification
lastrees Individual tree segmentation
lasvoxelize Voxelize a point cloud
plot.lasmetrics3d Plot voxelized LiDAR data
plot Plot a LAS* object
lastransform Datum transformation for LAS objects
p2r Digital Surface Model Algorithm
extent,LAS-method Extent
lasclip Clip LiDAR points
print Summary and Print for LAS* objects
pitfree Digital Surface Model Algorithm
set.colors Automatic colorization
silva2016 Individual Tree Segmentation Algorithm
watershed Individual Tree Segmentation Algorithm
random Point Cloud Decimation Algorithm
wing2015 Snags Segmentation Algorithm
grid_metrics Area-Based Approach
lasaddattribute Add attributes into a LAS object
grid_metrics3d Voxelize the space and compute metrics for each voxel
writeLAS Write a .las or .laz file
lasground Classify points as 'ground' or 'not ground'
lasfilter Return points with matching conditions
lascheck Inspect a LAS object
laspulse Retrieve individual pulses, flightlines or scanlines
lasmergespatial Merge a point cloud with a source of spatial data
LAScatalog-class An S4 class to represent a catalog of .las or .laz files
LASheader-class An S4 class to represent the header of .las or .laz files
plot_3d Add a spatial object to a point cloud scene
pmf Ground Segmentation Algorithm
lasmetrics Compute metrics for a cloud of points
as.spatial Transform a LAS* object into an sp object
catalog_apply LAScatalog processing engine
stdmetrics Predefined standard metrics functions
li2012 Individual Tree Segmentation Algorithm
catalog_intersect Subset a LAScatalog with a Spatial* object
knnidw Spatial Interpolation Algorithm
lidrpalettes Palettes
$<-,LAS-method Inherited but modified methods from sp
catalog Create an object of class LAScatalog
rumple_index Rumple index of roughness
tin Spatial Interpolation Algorithm
kriging Spatial Interpolation Algorithm
lmf Individual Tree Detection Algorithm
csf Ground Segmentation Algorithm
dalponte2016 Individual Tree Segmentation Algorithm
grid_terrain Digital Terrain Model
manual Individual Tree Detection Algorithm
highest Point Cloud Decimation Algorithm
lasnormalize Remove the topography from a point cloud
tree_metrics Compute metrics for each tree
lassmooth Smooth a point cloud
rbind.LAS Merge LAS objects
util_makeZhangParam Parameters for progressive morphological filter
readLAS Read .las or .laz files
tree_detection Individual tree detection
tree_hulls Compute the hull of each tree.
dsmtin Digital Surface Model Algorithm
as.list.LASheader Transform to a list
No Results!

Vignettes of lidR

Name
lidR-LAS-class.Rmd
lidR-LAScatalog-class.Rmd
lidR-catalog-apply-examples.Rmd
lidR-computation-speed-LAScatalog.Rmd
No Results!

Last month downloads

Details

Type Package
Date 2019-01-01
URL https://github.com/Jean-Romain/lidR
BugReports https://github.com/Jean-Romain/lidR/issues
License GPL-3
LazyData true
RoxygenNote 6.1.1
LinkingTo BH,Rcpp
Encoding UTF-8
ByteCompile true
VignetteBuilder knitr
biocViews
Collate 'LASmethods-generic.r' 'Class-LASheader.r' 'Class-LAS.r' 'Class-LAScatalog.r' 'Class-LAScluster.r' 'LASmethods-LAS.r' 'LASmethods-LAScatalog.r' 'LASmethods-LAScluster.r' 'LASmethods-LASheader.r' 'RcppExports.R' 'algo_digital_surface_model.r' 'algo_ground_segmentation.r' 'algo_points_decimation.r' 'algo_snags_segmentation.r' 'algo_spatial_interpolations.r' 'algo_tree_detection.R' 'algo_tree_segmentation.r' 'catalog_apply.r' 'catalog_fakerun.r' 'catalog_index.r' 'catalog_intersect.r' 'catalog_laxindex.r' 'catalog_makecluster.r' 'catalog_retile.r' 'catalog_select.r' 'clusters_apply.r' 'grid_canopy.r' 'grid_density.r' 'grid_hexametrics.r' 'grid_metrics.r' 'grid_metrics3d.r' 'grid_terrain.r' 'io_readLAS.r' 'io_writeANY.r' 'io_writeLAS.r' 'lascheck.r' 'lasclip.r' 'lasfilter.r' 'lasfilterdecimate.r' 'lasfilterduplicates.r' 'lasfiltersurfacepoints.r' 'lasground.r' 'lasindentify.r' 'lasmergelas.r' 'lasmergespatial.r' 'lasmetrics.r' 'lasnormalize.r' 'lasroi.r' 'lassmooth.r' 'lassnags.r' 'lastransform.r' 'lastrees.r' 'lasupdateheader.r' 'lasvoxelize.r' 'plot.s3.r' 'tree_detection.r' 'tree_hulls.r' 'tree_metrics.r' 'utils_assertive.r' 'utils_catalog_options.r' 'utils_colors.r' 'utils_define_constant.R' 'utils_geometry.r' 'utils_is.r' 'utils_match_chm_and_seeds.r' 'utils_metrics.r' 'utils_misc.r' 'utils_typecast.r' 'zzz.r'
NeedsCompilation yes
Packaged 2019-01-02 09:05:35 UTC; jr
Repository CRAN
Date/Publication 2019-01-02 09:40:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/lidR)](http://www.rdocumentation.org/packages/lidR)