LAS-Library-Matlab

This aims to be a library for efficient reading, writing and extracting LAS files (LIDAR data) in Matlab
73 Downloads
Updated 20 Oct 2023

LAS-Library-Matlab

This aims to be a library for reading, writing and extracting LAS files (LIDAR data) in Matlab


Features

  • Read LAS-Files containing LIDAR data into a lasdata style structure
  • Supports LAS-Files up to minor version 4 (LAS Specification 1.4 - R15 to be specific)
  • Supports Point Data Record Formats 0 to 10
  • Supports (extended) Variable Length Records
  • Flexible options to read LAS-File header, header and VLRs, only point coordinates and intensities, or all of the data
  • LAS Reader and Writer implemented in C++ and compiled to mex for faster processing (use SSD for best results)
  • De- and encoding of bit fields within header
  • De- and encoding of bit fields within point data records
  • Special emphasis on de- and encoding and manipulation of extra bytes attached to point data records
  • Library avoids newer built-in matlab functions to maximize compatibility with older revisions
  • Contains example scripts and data to show how the library can be used
  • Contains utility functions, like a fast multithreaded point in polygon function

How to Build

  • All Matlab scripts can be used as is.
  • This repository already contains compiled LAS-File reader and writer, as well as the compiled point in polygon function.
  • To compile them yourself for your platform and matlab version use the provided build scripts:
 ...src/build_readLasFile.m
 ...src/build_writeLasFile.m
 ...src/build_isPointInPolygon.m
  • If you lack support of the Interleaved Complex API then set 'UseInterleavedComplexAPI' to 'false'.
  • The mex-function should be compiled to /lib/mex
  • Tested and working C++ compilers are MSVC 2019 and latest MinGW-w64. Matlab Version for build was 2019b
  • For more information on mex-functions follow this link (https://www.mathworks.com/help/matlab/ref/mex.html)

Credits

The general structure and handling of the LAS data within Matlab follows the lasdata
class by Teemu Kumpumäki.
This started out as an extension of the lasdata utility but became its own thing in the process.
At this point this library does not use any code from said lasdata class but instead was created from scratch.
The writer is compatible with lasdata objects because they are so similar.
Thanks to Teemu Kumpumäki for being an inspiration and for providing a great tool for reading and writing LAS files.


License

This library is released under the MIT license


Plans for the Future

  • Create a fast C++ LAS-Writer: Finished
  • Support decoding of all variable length records predefined within LAS Specification 1.4 R15:
    Unlikely, due to how dynamic some VLRs are
  • Support external waveform data

Cite As

Patrick K (2024). LAS-Library-Matlab (https://github.com/CarawaySeed42/LAS-Library-Matlab/releases/tag/v1.4), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2019b
Compatible with R2011b and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.4.0.0

See release notes for this release on GitHub: https://github.com/CarawaySeed42/LAS-Library-Matlab/releases/tag/v1.4

1.3.0.0

See release notes for this release on GitHub: https://github.com/CarawaySeed42/LAS-Library-Matlab/releases/tag/v1.3

1.2.1.0

See release notes for this release on GitHub: https://github.com/CarawaySeed42/LAS-Library-Matlab/releases/tag/v1.2.1

1.1.0.0

See release notes for this release on GitHub: https://github.com/CarawaySeed42/LAS-Library-Matlab/releases/tag/v1.1

1.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.