Compass Data
A Rust library for reading, writing, and working with Compass
cave survey project files (.mak) and survey data files (.dat).
Overview
This library enables interoperation and data sharing between cave survey software by providing a complete implementation of the Compass file formats. It supports:
- Project files (
.mak): Parse and create project files that organize multiple survey data files - Survey data files (
.dat): Parse and serialize individual survey data with shots, stations, and metadata - Coordinate systems: UTM coordinates with support for 23 geodetic datums
- Rich error reporting: Detailed error messages with source locations using miette
Usage
Reading a Project File
use Project;
use PathBuf;
Reading a Survey Data File Directly
use Survey;
Serializing Survey Data
use Survey;
Key Types
| Type | Description |
|---|---|
[Project] |
A Compass project file containing references to survey data files |
[DatFile] |
A survey data file reference with its associated state |
[Survey] |
A single survey containing shots, team info, date, and parameters |
[Shot] |
A single survey shot with distance, azimuth, inclination, and LRUD |
[Datum] |
Geodetic datum (NAD27, NAD83, WGS84, etc.) |
[FileState] |
Rolling state captured when a file is encountered during parsing |
Features
serde: Enable serialization/deserialization with serdecli: Build thecompassCLI tool for inspecting project and survey files
CLI Tool
When built with the cli feature, a command-line tool is available:
# Install
# Inspect a project file
# Inspect with full survey data
# Inspect a survey data file
# Show detailed shot data
File Format Documentation
The Compass file formats are documented at:
License
Licensed under either:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.