lidR v2.0.3 (Release date: 2019-05-02)

lidR v2.0.2 (Release date: 2019-03-02)

lidR v2.0.1 (Release date: 2019-02-02)

lidR v2.0.0 (Release date: 2019-01-02)

Why versions > 2.0 are incompatible with versions 1.x.y?

The lidR package versions 1 were mainly built upon “personal R scripts” I wrote 3 years ago. These scripts were written for my own use at a time when the lidR package was much smaller (both in term of code and users). The lidR package became a relatively large framework built on top of an unstructured base so it became impossible to develop it further. Many features and functions were missing because the way lidR was built did not allow them to be written. The new release (lidR version 2) breaks the former code to build a more robust, more consistent and more scalable framework that is intended and expected to continue for years without the need to break anything more in the future.

Old binaries can still be found here for 6 months:

Overview of the main visible changes

lidR as a GIS tool

lidR versions 1 was not a GIS tool. For example, rasterization functions such as grid_metrics() or grid_canopy() returned a data.frame. Tree tops extraction with tree_detection() also returned a data.frame. Tree segmentation with lastrees() accepted RasterLayer or data.frame as input in a very inconsistent way. Moreover, the CRS of the point cloud was useless and never propagated to the outputs because outputs were not spatial objects.

lidR version 2 consistently uses Raster* and Spatial* objects everywhere. Rasterization functions such as grid_metrics() or grid_canopy() return Raster* objects. Tree tops extraction returns SpatialPointDataFrame objects. Tree segmentation methods accept SpatialPointDataFrame objects only in a consistent way across functions. The CRS of the point cloud is always propagated to the outputs. LAS objects are Spatial objects. LAScatalog objects are SpatialPolygonDataFrame objects. In short, lidR version 2 is now a GIS tool that is fully compatible with the R ecosystem.

No longer any update by reference

Several lidR functions used to update objects by reference. In lidR versions 1 the user wrote: lasnormalize(las) instead of las2 <- lasnormalize(las1). This used to make sense in R < 3.1 but now the gain is no longer as relevant because R makes shallow copies instead of deep copies.

To simplfy, let’s assume that we have a 1 GB data.frame that stores the point cloud. In R < 3.1 las2 was a copy of las1 i.e. las1 + las2 = 2GB . This is why we made functions that worked by reference that implied no copy at all. This was memory optimized but not common or traditional in R. The question of memory optimization is now less relevant since R >= 3.1. In the previous example las2 is no longer a deep copy of las1, but a shallow copy. Thus lidR now consistently uses the traditional syntax y <- f(x).

Algorithm dispatch

The frame of lidR versions 1 was designed at a time when there were fewer algorithms. The increasing number of algorithms led to inconsistent ways to dispatch algorithms. For example:

lidR version 2 comes with a flexible and scalable dispatch method that unifies all the former functions. For example, grid_canopy() is the only function to make a CHM. There is no longer the need for a second function grid_tincanopy(). grid_canopy() unifies the two functions by accepting as input an algorithm for a digital surface model:

chm = grid_canopy(las, res = 1, algo = pitfree())
chm = grid_canopy(las, res = 1, algo = p2r(0.2))

The same idea drives several other functions including lastrees, lassnags, tree_detection, grid_terrain, lasnormalize, and so on. Examples:

ttops = tree_detection(las, algo = lmf(5))
ttops = tree_detection(las, algo = lidRplugins::multichm(1,2))
lastrees(las, algo = li2012(1.5, 2))
lastrees(las, algo = watershed(chm))
lasnormalize(las, algo = tin())
lasnormalize(las, algo = knnidw(k = 10))

This allows lidR to be extended with new algorithms without any restriction either in lidR or even from third-party tools. Also, how lidR functions are used is now more consistent across the package.

LAScatalog processing engine

lidR versions 1 was designed to run algorithms on medium-sized point clouds loaded in memory but not to run algorithms over a set of files covering wide areas. In addition, lidR 1 had a poorly and inconsistently designed engine to process catalogs of las files. For example:

lidR version 2 comes with a powerful and scalable catalog processing engine. Almost all the lidR functions can be used seamlessly with either LAS or LAScatalog objects. The following chunks of code are now possible:

ctg = catalog("folfer/to/las/file")
opt_output_file(ctg) <- "folder/to/normalized/las/files/{ORIGINALFILENAME}_normalized"
new_ctg = lasnormalize(ctg, algo = tin())

Complete description of visible changes

LAS class

LAScatalog class

readLAS

lasclip

ctg = catalog(folder)
output_files(ctg) <- "path/to/a/file_{XCENTER}_{YCENTER}"
laz_compression(ctg) <- TRUE
new_ctg = lasclipCircle(ctg, xc,yc, r)

catalog_queries

lasnormalize

lasclassify

tree_detection

ctg  <- catalog(folder)
ttop <- tree_detection(ctg, lmf(5))

tree_metrics

ctg <- catalog(folder)
metrics <- tree_metrics(ctg, list(`Mean I` = mean(Intensity)))

lastrees

grid_metrics

grid_terrain

grid_canopy

grid_tincanopy

grid_hexametrics

grid_catalog

class lasmetrics

lasroi

lascolor

lasfilterdecimate

lassnags

lidr_options

Example files

plot

Coordinate reference system

New functions

Other changes that are not directly visible

lidR v1.6.1 (2018-08-21)

BUG FIXES

lidR v1.6.0 (2018-07-20)

NEW FEATURE

ENHANCEMENTS

OTHER CHANGES

BUG FIXES

lidR v1.5.1 (2018-06-14)

BUG FIXES

lidR v1.5.0 (2018-05-13)

SIGNIFICANT CHANGES

NEW FEATURES

OTHER CHANGES

BUG FIXES

lidR v1.4.2 (2018-04-19)

BUG FIXES

NEW FEATURES

lidR v1.4.1 (2018-02-01)

OTHER CHANGES

NEW FEATURES

lidR v1.4.0 (2018-01-24)

NEW FEATURES

BUG FIXES

ENHANCEMENTS

OTHER CHANGES

lidR v1.3.1 (Release date: 2017-09-20)

BUG FIXES

lidR v1.3.0 (Release date: 2017-09-16)

This version is dedicated to extending functions and processes to entire catalogs in a continuous way. Major changes are:

NEW FEATURES

OTHER CHANGES

BUG FIXES

ENHANCEMENTS

lidR v1.2.1 (Release date: 2017-06-12)

NEW FEATURES

BUG FIXES

OTHER CHANGES

lidR v1.2.0 (Release date: 2017-03-26)

NEW FEATURES

BUG FIXES

OTHER CHANGES

lidR v1.1.0 (Release date: 2017-02-05)

NEW FEATURES

OTHER CHANGES

BUG FIXES

lidR v1.0.2 (Release date: 2016-12-31)

Third submission

lidR v1.0.1 (Release date: 2016-12-30)

Second submission - rejected

lidR v1.0.0 (Release date: 201-12-16)

First submission - rejected