lasr

Fast and Pipable Airborne LiDAR Data Tools

https://github.com/r-lidar/lasr

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.7%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Fast and Pipable Airborne LiDAR Data Tools

Basic Info
Statistics
  • Stars: 33
  • Watchers: 2
  • Forks: 4
  • Open Issues: 12
  • Releases: 1
Created over 2 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog Funding License

README.md

lasR

license Lifecycle:Maturing R-CMD-check Codecov test coverage

Fast Airborne LiDAR Data Processing

The lasr library (pronounced "laser") is a C++ library for large scale airborne point cloud processing with C++, R an Python APIs. It enables the creation and execution of complex processing pipelines on massive lidar data. It can read and write .las, .laz and .pcd files, compute metrics using an area-based approach, generate digital canopy models, segment individual trees, decimate point data, and process collections of files using multicore processing strategies.

lasr offers a range of tools to process massive volumes of lidar data efficiently in a production environment using either the C++ API, the R API (lasR package) or the Python API (pylasr package).

💵 Sponsor lasr. It is free and open source, but requires time and effort to develop and maintain.

Documentation

The most comprehensive source of documentation is the R package lasR documentation,
as lasr is primarily an R package. Even Python users should start with the R tutorial, while the examples are written in R, the tutorial is more about the general concepts than about coding.

APIs

R API

There is no current plan to release lasR on CRAN. Instead, it is hosted on r-universe:

r install.packages('lasR', repos = 'https://r-lidar.r-universe.dev')

Since lasR is not available on CRAN, users cannot rely on the CRAN versioning system or the RStudio update button to get the latest version. Instead, when lasR is loaded with library(lasR), an internal routine checks for the latest version and notifies the user if an update is available. This approach allows for more frequent updates, ensuring users have access to the newest features and bug fixes without waiting for a formal release cycle.

```r library(lasR)

> lasR 0.1.3 is now available. You are using 0.1.1

> install.packages('lasR', repos = 'https://r-lidar.r-universe.dev')

```

Python API

pylasr is the Python API for lasr, providing a clean, Pythonic interface to the high-performance C++ library for processing large-scale LiDAR point clouds.

Prerequisites

  • Python 3.9+
  • C++17 compatible compiler
  • GDAL (>= 2.2.3), GEOS (>= 3.4.0), PROJ (>= 4.9.3)

Build from source

bash git clone https://github.com/r-lidar/lasR.git cd lasR/python pip install -e .

Pre-built packages will be available on PyPI in the future. For now, please build from source.

C++ API

To use lasr in a C++ program, it must be linked to gdal and proj. Other dependencies are provided in the vendor directory. Tools available to the public are given in api.h.

Examples

Below is a simple example of a pipeline that classifies and removed outliers before to produce a Digital Surface Model and a Digital Terrain Model from a folder containing airborne LiDAR point clouds. For more examples see the tutorial.

R

r library(lasR) folder = "/folder/of/laz/tiles/" pipeline = classify_with_sor() + delete_noise() + chm(1) + dtm(1) exec(pipeline, on = folder, ncores = 16, progress = TRUE)

Python

```py import pylasr folder = "/folder/of/laz/tiles/" pipeline = (pylasr.classifywithsor() + pylasr.deletepoints(["Classification == 18"]) + pylasr.chmpipeline(1, "chm.tif") + pylasr.dtm_pipeline(1, "dtm.tif"))

pipeline.setprogress(True) pipeline.setconcurrentfilesstrategy(16) result = pipeline.execute(folder) ```

C++

The C++ API is significantly more complex to use. The R and Python APIs aim to provide high-level interfaces in high-level languages, making usages simpler and more user-friendly. The low-level C++ API was never intended for standalone use; instead, it serves as a bridge for building other high-level APIs.

```cpp

include "api.h"

using namespace api;

std::string on = "/folder/of/laz/tiles/"

// platform independent tmp files std::filesystem::path tempdir = std::filesystem::tempdirectorypath(); std::filesystem::path tempdsm = tempdir / "dsm.tif"; std::filesystem::path tempdtm = temp_dir / "dtm.tif";

Pipeline tri = triangulate(0, {"Classification %in% 2 9"}); Pipeline dtm = rasterizetriangulation(tri.getstages().front().getuid(), 1, tempdtm.string());

Pipeline p; p += classifywithsor(); p += deletepoints({"Classification == 18"}); p += rasterize(1, 1, {"max"}, {""}, tempdsm.string()); p += tri; p += dtm;

p.setfiles(on); p.setconcurrentfilesstrategy(8); p.set_progress(false);

std::string file = p.write_json();

return execute(file); ```

Main Differences with lidR

The following benchmark compares the time and RAM usage of lasR (R API) and lidR for producing a Digital Terrain Model (DTM), a Canopy Height Model (CHM), and a raster containing two metrics derived from elevation (Z) and intensity. The test was conducted on 120 million points stored in 4 LAZ files. For more details, check out the benchmark vignette.

  • Pipelines: lasR introduces pipelines to optimally chain multiple operations on a point cloud, a feature not available in lidR.
  • Algorithm Efficiency: lasR uses more powerful algorithms designed for speed and efficiency.
  • Language and Performance: Entirely written in C/C++, lasR has no R code except for the API interface. This makes it highly optimized for performance.
  • Memory Usage: Unlike lidR, which loads the point cloud into an R data.frame, lasR stores point clouds in a C++ structure that is not exposed to the user, minimizing memory usage.
  • Dependencies: lasR has a single strong dependency on gdal. If sf and terra are installed, the user experience is enhanced, but they are not mandatory.

For more details, see the relevant vignette.

Copyright Information

lasr is free and open source and relies on other free and open source tools.

  • For lasr:
    • © 2023-2025 Jean-Romain Roussel
    • Licence: GPL-3
  • For lasR (R bindings):
    • © 2023-2025 Jean-Romain Roussel
    • Licence: GPL-3
  • For pylasr (Python bindings):
    • © 2025 Alexey Grigoryev
    • Licence: GPL-3
  • For LASlib and LASzip:
    • © 2007-2021 Martin Isenburg - http://rapidlasso.com
    • Licence: LGPL (modified to be R-compliant by Jean-Romain Roussel)
    • See the dedicated readme for more details about the modifications made and alternative linking.
  • For chm_prep:
  • For json parser:
    • Lohmann, N. (2023). JSON for Modern C++ (Version 3.11.3) [Computer software]. https://github.com/nlohmann
    • Licence: MIT
  • For delaunator:
  • For Eigen:
    • Guennebaud, Gaël and Jacob, Benoît and others
    • Eigen: A C++ linear algebra library http://eigen.tuxfamily.org
    • Licence: MPL2
  • For Cloth Simulation Filter (CSF)
    • © 2017 State Key Laboratory of Remote Sensing Science, Institute of Remote Sensing Science and Engineering, Beijing Normal University
    • Licence: Apache
    • W. Zhang, J. Qi, P. Wan, H. Wang, D. Xie, X. Wang, and G. Yan, “An Easy-to-Use Airborne LiDAR Data Filtering Method Based on Cloth Simulation,” Remote Sens., vol. 8, no. 6, p. 501, 2016.

About

lasr is developed openly by r-lidar.

The initial development of lasr was made possible through the financial support of Laval University. To continue the development of this free software, we now offer consulting, programming, and training services. For more information, please visit our website.

Install dependencies on GNU/Linux

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable sudo apt-get update sudo apt-get install libgdal-dev libgeos-dev libproj-dev

Owner

  • Name: R lidar
  • Login: r-lidar
  • Kind: organization

R + lidar

GitHub Events

Total
  • Create event: 10
  • Issues event: 76
  • Watch event: 34
  • Delete event: 2
  • Member event: 1
  • Issue comment event: 193
  • Public event: 1
  • Push event: 217
  • Pull request review event: 38
  • Pull request review comment event: 44
  • Pull request event: 28
  • Fork event: 5
Last Year
  • Create event: 10
  • Issues event: 76
  • Watch event: 34
  • Delete event: 2
  • Member event: 1
  • Issue comment event: 193
  • Public event: 1
  • Push event: 217
  • Pull request review event: 38
  • Pull request review comment event: 44
  • Pull request event: 28
  • Fork event: 5

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 925
  • Total Committers: 3
  • Avg Commits per committer: 308.333
  • Development Distribution Score (DDS): 0.032
Past Year
  • Commits: 301
  • Committers: 3
  • Avg Commits per committer: 100.333
  • Development Distribution Score (DDS): 0.1
Top Committers
Name Email Commits
Jean-Romain j****1@u****a 895
ksemchh k****h@v****m 26
Alex Grigoryev a****v@g****m 4
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 126
  • Total pull requests: 25
  • Average time to close issues: 4 days
  • Average time to close pull requests: 3 days
  • Total issue authors: 24
  • Total pull request authors: 3
  • Average comments per issue: 2.42
  • Average comments per pull request: 2.24
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 56
  • Pull requests: 23
  • Average time to close issues: 4 days
  • Average time to close pull requests: 4 days
  • Issue authors: 17
  • Pull request authors: 3
  • Average comments per issue: 2.5
  • Average comments per pull request: 2.35
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • wiesehahn (58)
  • Jean-Romain (24)
  • jmmonnet (4)
  • kalinowskapatrycja (4)
  • eikeschott (4)
  • georgewoolsey (4)
  • summitbri (3)
  • agrigoriev (2)
  • kadyb (2)
  • FloFranz (2)
  • ksemchh (2)
  • wildintellect (2)
  • samuelgrubinger (2)
  • FevetS (2)
  • harryseely (2)
Pull Request Authors
  • ksemchh (9)
  • agrigoriev (8)
  • Jean-Romain (8)
Top Labels
Issue Labels
bug (31) enhancement (13) Feature request (10) documentation (8) question (6) Python (3) multithreading (2) devel (2) wontfix (1)
Pull Request Labels

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v3 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R >= 3.6.0 depends
  • methods * imports
  • utils * imports
  • knitr * suggests
  • rmarkdown * suggests
  • sf * suggests
  • terra * suggests
  • testthat >= 3.0.0 suggests