2 unstable releases
Uses new Rust 2024
| new 0.2.0 | May 23, 2026 |
|---|---|
| 0.1.0 | May 23, 2026 |
#6 in #las
30KB
719 lines
voxelize
Voxelize LAS/LAZ point clouds into a downsampled output where each point is a voxel center.
Published on crates.io as voxelaz.
CLI
voxelize --input <path> --output <path> --voxel-size <meters> [--counts-as-intensity] [--include-classification <codes>]
--input— input LAS/LAZ path (required).--output— output LAS/LAZ path (required).--voxel-size— edge length of each voxel in meters (required).--counts-as-intensity— store per-voxel input point counts and write them to LAS intensity (default: presence-only; intensity stays 0).--include-classification— comma-separated classification codes to keep (default: all).
Library
use voxelaz::{ClassificationFilter, VoxelizeConfig, VoxelizeError};
let config = VoxelizeConfig {
voxel_size: 0.5,
classification_filter: ClassificationFilter::all(),
counts_as_intensity: false,
};
match voxelaz::voxelize(input, output, &config) {
Ok(()) => {}
Err(VoxelizeError::InvalidVoxelSize) => { /* ... */ }
Err(e) => return Err(e.into()),
}
Fallible APIs return voxelaz::Result<T> (Result<T, VoxelizeError>). LAS I/O failures surface as VoxelizeError::Las. The CLI binary still reports errors via anyhow; library callers can use ? with anyhow::Result because VoxelizeError implements std::error::Error.
VoxelizeConfig::new(voxel_size) sets classification_filter to all codes and counts_as_intensity to false.
Dependencies
~2.8–4MB
~68K SLoC