lidR v3.0.4


Monthly downloads



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.



license R build status Codecov test coverage

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.

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

To cite the package use citation() from within R:


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>")

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))


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 <- readLAScatalog("<folder/>")
plot(ctg, map = TRUE)

From a LAScatalog object the user can (for example) extract some regions of interest (ROI) with clip_roi(). 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 segment_trees() 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 <- segment_trees(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 <- readLAScatalog("<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.


lidR is developed openly at Laval University.

Install lidR

# The latest released version from CRAN with

# The latest stable development version from github with

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:
# Ubuntu
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev libgeos++-dev libudunits2-dev libproj-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libnode-dev libxt-dev libfftw3-dev

# Fedora
sudo dnf install gdal-devel geos-devel udunits2-devel proj-devel mesa-libGL-devel mesa-libGLU-devel freetype-devel libjpeg-turbo-devel v8-devel


See changelogs on

Functions in lidR

Name Description
VCI Vertical Complexity Index
LAD Leaf area density
area Surface covered by a LAS* object
LASheader-class An S4 class to represent the header of .las or .laz files
Roussel2020 Sensor tracking algorithm
LAS-class An S4 class to represent a .las or .laz file
Gatziolis2019 Sensor tracking algorithm
add_attribute Add attributes into a LAS object
LASheader Create a LASheader object
LAScatalog-class An S4 class to represent a catalog of .las or .laz files
catalog_select Select LAS files manually from a LAScatalog
decimate_points Decimate a LAS object
delineate_crowns Compute the hull of each tree.
classify_ground Classify points as 'ground' or 'not ground'
dalponte2016 Individual Tree Segmentation Algorithm
catalog_makechunks Subdivide a LAScatalog into chunks
catalog_intersect Subset a LAScatalog with a Spatial* object
csf Ground Segmentation Algorithm
as.spatial Transform a LAS* object into an sp object
as.list.LASheader Transform to a list
deprecated Deprecated functions in lidR
gap_fraction_profile Gap fraction profile
grid_canopy Digital Surface Model
highest Point Cloud Decimation Algorithm
knnidw Spatial Interpolation Algorithm
lidrpalettes Palettes
homogenize Point Cloud Decimation Algorithm
lmf Individual Tree Detection Algorithm
dsmtin Digital Surface Model Algorithm
filter_surfacepoints Filter the surface points
filters Predefined point of interest filters
retrieve_pulses Retrieve individual pulses, flightlines or scanlines
asprs ASPRS LAS Classification
catalog_apply LAScatalog processing engine
clip Clip points in regions of interest
catalog_options_tools Get or set LAScatalog processing engine options
catalog_retile Retile a LAScatalog
find_localmaxima Local Maximum Filter
cloud_metrics Compute metrics for a cloud of points
find_trees Individual tree detection
las_rescale Rescale and reoffset a LAS object
las_check Inspect a LAS object
is A set of boolean tests on objects
lidR-LAScatalog-drivers LAScatalog drivers
li2012 Individual Tree Segmentation Algorithm
grid_density Map the pulse or point density
kriging Spatial Interpolation Algorithm
plot.lasmetrics3d Plot voxelized LiDAR data
plot Plot a LAS* object
manual Individual Tree Detection Algorithm
merge_spatial Merge a point cloud with a source of spatial data
grid_metrics Area-Based Approach
grid_terrain Digital Terrain Model
set_lidr_threads Set or get number of threads that lidR should use
extent,LAS-method Extent
entropy Normalized Shannon diversity index
filter_duplicates Filter duplicated points
plot_3d Add a spatial object to a point cloud scene
filter_poi Filter points of interest with matching conditions
normalize_intensity Normalize intensity
hexbin_metrics Area-Based Approach in hexagonal cells.
normalize_height Remove the topography from a point cloud
p2r Digital Surface Model Algorithm
pitfree Digital Surface Model Algorithm
projection Get or set the projection of a LAS* object
point_metrics Point-based metrics
lidR-package lidR: airborne LiDAR for forestry applications
readLASheader Read a .las or .laz file header
lidR-parallelism Parallel computation in lidR
rbind.LAS Merge LAS objects
random Point Cloud Decimation Algorithm
range_correction Intensity normalization algorithm
$<-,LAS-method Inherited but modified methods from sp
rumple_index Rumple index of roughness
shape_detection Algorithms for shape detection of the local point neighborhood
print Summary and Print for LAS* objects
readLAScatalog Create an object of class LAScatalog
readLAS Read .las or .laz files
readMSLAS Read multispectral .las or .laz files
pmf Ground Segmentation Algorithm
wing2015 Snags Segmentation Algorithm
segment_snags Snag classification
segment_shapes Estimation of the shape of the points neighborhood
stdmetrics Predefined standard metrics functions
tin Spatial Interpolation Algorithm
set.colors Automatic colorization
segment_trees Individual tree segmentation
util_makeZhangParam Parameters for progressive morphological filter
voxel_metrics Voxelize the space and compute metrics for each voxel
writeLAS Write a .las or .laz file
voxelize_points Voxelize a point cloud
silva2016 Individual Tree Segmentation Algorithm
smooth_height Smooth a point cloud
watershed Individual Tree Segmentation Algorithm
tree_metrics Compute metrics for each tree
track_sensor Reconstruct the trajectory of the LiDAR sensor using multiple returns
No Results!

Vignettes of lidR

No Results!

Last month downloads


Type Package
Date 2020-10-09
License GPL-3
LazyData true
RoxygenNote 7.1.1
LinkingTo BH (>= 1.72.0),Rcpp,RcppArmadillo
Encoding UTF-8
ByteCompile true
VignetteBuilder knitr
Collate 'Class-LASheader.R' 'Class-LAS.R' 'Class-LAScatalog.R' 'Class-LAScluster.R' 'RcppExports.R' 'add_attribute.R' 'algorithm-dec.R' 'algorithm-dsm.R' 'algorithm-gnd.R' 'algorithm-itd.R' 'algorithm-its.R' 'algorithm-noi.R' 'algorithm-shp.R' 'algorithm-snag.R' 'algorithm-spi.R' 'algorithm-trk.R' 'catalog_apply.R' 'catalog_fakerun.R' 'catalog_index.R' 'catalog_intersect.R' 'catalog_laxindex.R' 'catalog_makecluster.R' 'catalog_merge_results.R' 'catalog_overlaps.R' 'catalog_retile.R' 'catalog_select.R' 'classify_ground.R' 'clip_roi.R' 'cloud_metrics.R' 'clusters_apply.R' 'decimate_points.R' 'delineate_crowns.R' 'deprecated.R' 'doc-drivers.R' 'doc-lidR.R' 'doc-parallelism.R' 'filter_duplicates.R' 'filter_poi.R' 'filter_roi.R' 'filter_surfacepoints.R' 'find_localmaxima.R' 'find_trees.R' 'generate_las.R' 'grid_canopy.R' 'grid_density.R' 'grid_metrics.R' 'grid_terrain.R' 'hexbin_metrics.R' 'io_readLAS.R' 'io_readLAScatalog.R' 'io_readMSLAS.R' 'io_writeANY.R' 'io_writeLAS.R' 'las_check.R' 'las_tools.R' 'merge_las.R' 'merge_spatial.R' 'methods-LAS.R' 'methods-LAScatalog.R' 'methods-LAScluster.R' 'methods-LASheader.R' 'normalize_height.R' 'normalize_intensity.R' 'plot.R' 'plot.s3.R' 'point_metrics.R' 'print.R' 'projection.R' 'retrieve_info.R' 'segment_shapes.R' 'segment_snags.R' 'segment_trees.R' 'sensor_tracking.R' 'smooth_height.R' 'tree_metrics.R' 'utils_assertive.R' 'utils_catalog_options.R' 'utils_colors.R' 'utils_define_constant.R' 'utils_delaunay.R' 'utils_geometry.R' 'utils_is.R' 'utils_metrics.R' 'utils_misc.R' 'utils_raster.R' 'utils_threads.R' 'utils_typecast.R' 'voxel_metrics.R' 'voxelize_points.R' 'zzz.R'
NeedsCompilation yes
Packaged 2020-10-10 15:37:43 UTC; jr
Repository CRAN
Date/Publication 2020-10-10 21:40:03 UTC

Include our badge in your README