Skip to main content

Crate fit2gpx

Crate fit2gpx 

Source
Expand description

fit2gpx

A simple, yet powerful fit to gpx converter, capable of adding elevation while conversion from HGT DTM data.

Uses rayon for multithreaded execution.

§Usage

use fit2gpx::Fit;

fn main() {
    // read into memory
    let mut fit = Fit::from_file("rundumadum.fit").unwrap();
    // add elevation, requires `./N48E016.hgt`
    // fit.add_elev_read(".", false).unwrap();
    // silly modification
    fit.track_segment.points.iter_mut().for_each(|p| {
        if let Some(ele) = &mut p.elevation {
            *ele += 3000.;
        } else {
            p.elevation = Some(4000.);
        }
    });

    let out_path = std::path::PathBuf::from("rundumadum_elevation.gpx");
    fit.save_to_gpx(&out_path).unwrap();
    assert!(out_path.exists());
    // cleanup
    std::fs::remove_file(out_path).unwrap();
}

Re-exports§

pub use fit::Fit;

Modules§

elevation
fit

Type Aliases§

Res
universal Result, but not sendable