⚠️There's a newer version (1.7.0) of this package. Take me there.

R package to read and write .las and .laz binary files used to store LiDAR data.

rlas relies on a modified version of the open source parts of LAStools. LASlib and LASzip were modified to be compatible with R. The library can therefore be compiled into R without any complaints from R CMD check. It enables users to read and write into R binary files commonly used to store LiDAR data in R both at the R level and at the C++ level.

Install rlas

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

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 R development package, usually called r-devel or r-base-dev

Read las and laz files

At the R level

lasdata   = read.las("<myfile.las>")
lasheader = read.lasheader("<myfile.las>")

At the C++ level

Linking rlas into your c++ code.

// [[Rcpp::depends(rlas)]]

#include <rlasstreamer.h>

// [[Rcpp::export]]
List readlasdata(CharacterVector ifiles, CharacterVector filter)
{
  try
  {
    RLASstreamer lasstreamer(ifiles, filter);
    lasstreamer.allocation();
  
    while(lasstreamer.read_point())
    {
      lasstreamer.write_point();
    }
  
    return lasstreamer.terminate();
  }
  catch (std::exception const& ex)
  {
    Rcerr << "Error: " << ex.what() << std::endl;
    return(List(0));
  }
}

Changelog

See changelog here

Copyright Information

rlas contains code written by both Jean-Romain Roussel and Martin Isenburg. The latter is included for technical reasons. Details below.

  • For LASlib and LASzip:
  • For rlas code enabling Martin Isenburg's code to be wrapped into R:
    • (c) 2016 Jean-Romain Roussel
    • Provided under GPL-3 license.

Copy Link

Version

Down Chevron

Install

install.packages('rlas')

Monthly Downloads

2,840

Version

1.2.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Last Published

April 13th, 2018

Functions in rlas (1.2.1)