https://github.com/evetion/LASindex.jl
Pure Julia reader of lasindex .lax files
https://github.com/evetion/LASindex.jl
geospatial julia lasio lastools lax lidar point-cloud
Last synced: 4 days ago
JSON representation
Pure Julia reader of lasindex .lax files
- Host: GitHub
- URL: https://github.com/evetion/LASindex.jl
- Owner: evetion
- License: mit
- Created: 2017-06-09T13:52:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T22:10:38.000Z (over 5 years ago)
- Last Synced: 2025-08-02T10:04:13.287Z (4 months ago)
- Topics: geospatial, julia, lasio, lastools, lax, lidar, point-cloud
- Language: Julia
- Size: 24.4 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Geospatial - LASindex.jl - Pure Julia reader of lasindex .lax files. (Julia)
- awesome-gis - LASindex.jl - Pure Julia reader of lasindex .lax files. (Geospatial Library / Julia)
README
[](https://travis-ci.org/evetion/LASindex.jl)
[](https://ci.appveyor.com/project/evetion/lasindex-jl)
[](https://codecov.io/gh/evetion/LASindex.jl)
# LASindex.jl
Pure Julia reader of lasindex .lax files.
Translates the .lax file to a quadtree from the RegionTrees package and provides a bounding box intersect method to retrieve a vector of ranges.
```julia
julia> using LASindex
julia> using FileIO
julia> laxfile = joinpath("sample", "Palm Beach Post Hurricane.lax");
julia> qt = load(laxfile)
INFO: Processed Palm Beach Post Hurricane.lax with 1924631 points.
Cell: RegionTrees.HyperRectangle{2,Float64}([955000.0, 885000.0], [32000.0, 32000.0])
julia> using StaticArrays
julia> bbox = SVector(955000.0, 985002.0, 885000.0, 988800.0);
julia> r = LASindex.intersect(qt, bbox)
1-element Array{UnitRange{Integer},1}:
1:1924631
```
The resulting ranges can be used in combination with LasIO or LazIO to stream a small subset of a (larger than memory) dataset.
```julia
using LasIO
header, points = load("Palm Beach Post Hurricane.las", mmap=true)
intersected_points = points[LASindex.intersect(qt, bbox)]
```
Note that all points inside the bounding box are given, but not all points given are inside the bounding box. In other words, because of how `lasindex` groups ranges together, some ranges will include points outside the bounding box.
### Background
LAX files are quadtree indexes used by the LASTools suite [1] if present. You can generate them with `lasindex -i *.laz`[2]. There's a good introduction to lasindex here [3].
- [1] https://rapidlasso.com/lastools/
- [2] https://github.com/LAStools/LAStools/blob/master/bin/lasindex_README.txt
- [3] https://www.youtube.com/watch?v=FMcBywhPgdg
### Future
I'd rather use Cxx to call the lasindex c++ code directly,
but at the moment the Cxx package is harder to install on Windows
than compiling the lastools shared library itself.
An example how to interface with lastools directly is provided in example/cxx.jl