How crrel/las-rs works
Project type and purpose
• This is a Rust library (crate) called “las-rs” for reading and writing ASPRS LAS/LAZ LiDAR files. It exposes a simple API (Reader, Writer, Header, Point etc.) so other Rust code can parse or emit LAS data.
File structure
• Top-level files:
• Cargo.toml, rustfmt.toml – crate configuration
• benches/, examples/, tests/ – performance benches, usage samples, and test suites (not part of the runtime architecture)
• src/ subdirectories (the core library):
• reader.rs, writer.rs – high-level I/O interfaces
• header/ – builder and data‐structure definitions for the LAS file header
• raw/ – low-level parsing/unparsing of binary streams (header, VLRs, points)
• compression/ – LASzip compression/decompression support
• point/ – high-level point data (classification, format variants, scan direction)
• vlr.rs – variable length record definitions
• utils.rs, transform.rs, vector.rs – supporting math and utilities
• error.rs – unified error definitions
README
• Confirms that the crate’s goal is native Rust support for LAS/LAZ formats.
Detailed architectural elements to capture
• The separation between high-level API (Reader, Writer) and low-level binary handling (raw folder).
• The VLR (variable length record) subsystem as part of header processing.
• The transformation utilities that may be applied to point coordinates.
• Error handling flow (modules signaling errors back to the API).