https://github.com/pdal/rust
This is a mirror of `georust/pdal`, where work is being done under the GeoRust organization. Please submit PRs and Issues there. 👍
https://github.com/pdal/rust
geospatial pdal point-cloud
Last synced: 7 days ago
JSON representation
This is a mirror of `georust/pdal`, where work is being done under the GeoRust organization. Please submit PRs and Issues there. 👍
- Host: GitHub
- URL: https://github.com/pdal/rust
- Owner: PDAL
- License: mit
- Created: 2024-04-12T15:21:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-12T15:39:34.000Z (about 1 year ago)
- Last Synced: 2025-05-07T20:18:45.311Z (7 days ago)
- Topics: geospatial, pdal, point-cloud
- Language: Rust
- Homepage: https://github.com/georust/pdal
- Size: 695 KB
- Stars: 4
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# PDAL Bindings for Rust
This crate provides Rust bindings for the [PDAL](https://pdal.io) library.
THIS IS A WORK IN PROGRESS. The API is not stable (nor complete) and is subject to change.
Contributions welcome! Please open an issue or PR if you have any feedback or would like to contribute.
Come discuss the project with other GeoRust contributors at our [Discord server](https://discord.gg/Fp2aape).## Minimalist Example
```rust, no_run
use pdal::Pipeline;
use pdal_sys::core::DimTypeId;
use std::error::Error;fn main() -> Result<(), Box> {
// get filename from args
let filename = std::env::args().nth(1).expect("missing filename argument");
let pipeline_json = format!(
r#"
{{
"pipeline": [
{{
"type": "readers.las",
"filename": "{filename}"
}},
{{
"type": "writers.null"
}}
]
}}
"#
);let pipeline = Pipeline::new(pipeline_json)?;
let results = pipeline.execute()?;let views = results.point_views()?;
let view = views.first().ok_or("no point view")?;
for pid in view.point_ids().take(3) {
let x = view.point_value_as::(DimTypeId::X, pid)?;
let y = view.point_value_as::(DimTypeId::Y, pid)?;
let z = view.point_value_as::(DimTypeId::Z, pid)?;
println!("{}: ({}, {}, {})", pid, x, y, z);
}Ok(())
}
```