Home

Awesome

Github licence

lidRviewer

This is a point cloud viewer for R. The primary goal of this package is to serve as an alternative backend for displaying point clouds in the lidR package, replacing rgl.

While rgl is a powerful package, it has some limitations when it comes to handling large point clouds. The lidRviewer package is designed to efficiently display arbitrarily large in-memory point clouds, with tested cases including over 880 million points.

Advantages of lidRviewer:

Drawbacks:

Installation

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

MacOS

brew install sdl2 mesa mesa-glu

Usage

library(lidR)
library(lidRviewer)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
view(las)
# Close the view to continue working in your R session

Technical details

lidRviewer is based on Markus Schultz thesis with some adaptation and variation. One of the main difference is that Potree spatially indexes the point cloud in dedicated and optimized files on-disk file for an out-of-core rendering. lidRviewer on its side creates a nested octree on-the-fly on an in-memory data.frame without modifying the original data (not sorting, no data layout optimization).