Skip to content

Repository files navigation

Rustigc

CI

An IGC toolbox for aviation sports written in Rust.

Components

rustigc/
├── rustigc/             - Core Rust library
├── rustigc-py/          - Python bindings
├── rustigc-wasm/        - WASM bindings
├── rustigc-tools/       - CLI tools
└── rustigc-test-data/   - Shared IGC test files and their scoring references

Features

  • ✅ Parse IGC files to structured records (RawLog)
    • ✅ Extract position fixes (lat/lon/altitude/time) into tracklog (Log)
    • ✅ Access flight metadata (pilot, glider, date, recorder info)
    • ✅ Roundtrip parse/write valid IGC
    • ⏳ Extension support:
      • LOD/LAD: Coordinate higher precision
      • TDS: Sub-second time division
  • ✅ Flight scoring: see dedicated documentation
    • Generic scoring over a configurable number of turnpoints
    • Optimized for fast searches
    • Supports XContest, FFVL's CFD, and more
  • ✅ Python bindings with numpy support
  • ✅ WASM bindings
  • ✅ GeoJSON export
  • ✅ CLI tools
  • 🏗️ Takeoff/landing detection (currently basic - average speed ~15km/h)
  • ⏳ Flight dynamics smoothing
  • ⏳ Flight phases identification

Quick Start

Rust Library

use rustigc::Log;

let content = std::fs::read("flight.igc")?;
let log = Log::new(&content)?;

println!("Pilot: {}", log.headers["PLT"].text);
println!("Fixes: {}", log.track.len());

See rustigc/README.md

Python

from rustigc_py import Log

log = Log.from_file("flight.igc")

print(f"Pilot: {log.pilot_name}")
print(f"Glider: {log.glider_type}")
print(f"Fixes: {len(log.track)}")

# Flight sections
flight = log.flights().longest
print(f"Takeoff: {flight.takeoff}")
print(f"Landing: {flight.landing}")

See rustigc-py/README.md

TypeScript

import { readFileSync } from "node:fs";
import { Log } from "rustigc-wasm";

const igc = readFileSync("flight.igc");
const log = new Log(igc);

console.log(log.header("PLT"), log.fix_count);
console.log(log.score("xcontest"));

See rustigc-wasm/README.md, which covers instantiating the wasm first.

CLI tool

rustigc-xc-score --league xcontest < flight.igc

See rustigc-tools/README.md

Build

# Build all components
cargo build --release

# Run tests
cargo test

# Build Python bindings
cd rustigc-py
pip install maturin
maturin develop

Status: Alpha

rustigc is still very early in its development cycle. It is a pet project I'm using to learn Rust. I'm still exploring everything Rust has to offer, so there is a good chance some things in there are not done correctly or could be improved. Public APIs are likely to change.

However, rustigc is tested on thousands of tracklogs, accounting for many oddities found in the real world.

If you have a tracklog that does not parse or score correctly, please open an issue and share the tracklog.

Credit

The following sources have been extremely helpful in building rustigc so far:

License

  • GPL-2.0-or-later WITH Classpath-exception-2.0 for the library and its bindings
  • GPL-2.0-or-later for rustigc-tools

The Classpath exception means linking against the library or its bindings — statically or dynamically, from Rust, Python, JavaScript, or any other language — does not require your own code to be GPL-licensed. Only modifications to rustigc itself stay under the GPL. See LICENSE for the full text.

About

A fast IGC toolbox

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages