Skip to content

Commit

Permalink
fix: use srtm
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeromos Kovacs committed Jul 16, 2024
1 parent bf9fd6b commit d60a762
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 59 deletions.
55 changes: 54 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

authors = ["Jeromos Kovács <iitsnotme214@proton.me>"]
description = ".fit to .gpx converter"
keywords = ["garmin", "fit", "cli"]
keywords = ["garmin", "fit", "cli", "gpx"]
categories = ["command-line-interface"]
repository = "https://github.com/jeromeschmied/fit2gpx-rs"
license = "MIT"
Expand All @@ -17,5 +17,6 @@ clap = { version = "4.5.8", features = ["derive"] }
fit_file = "0.6.0"
geo-types = "0.7.13"
gpx = "0.10.0"
srtm = { version = "0.1.1", path = "../srtm" }
rayon = "1.10.0"
srtm = { git = "https://github.com/jeromeschmied/srtm", version = "0.2.1" }
time = { version = "0.3.36", default-features = false }
51 changes: 46 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,67 @@
# fit2gpx-rs

## Installation

- have [Rust](https://rustup.rs)

- with `cargo` from [crates.io](https://crates.io): `cargo install fit2gpx`
- with `cargo` from [github](https://github.com/jeromeschmied): `cargo install --git "https://github.com/jeromeschmied/fit2gpx-rs"`

- with `cargo` and `git` from [github](https://github.com/jeromeschmied):

```sh
git clone --depth 1 "https://github.com/jeromeschmied/fit2gpx-rs"
cd fit2gpx-rs
cargo install --locked --path .
```

## Usage

see `fit2gpx --help`

let's say you want to convert `a_lovely_evening_walk.fit` to `a_lovely_evening_walk.gpx`
in that case, you'd do the following
`fit2gpx a_lovely_evening_walk.fit`
if you also want to add elevation data, as the `.fit` file didn't contain any, follow [these steps](#how-to-add-elevation-data)

## Purpose

This is a simple Rust library and binary for converting .FIT files to .GPX files.
A **_faster_** alternative to [fit2gpx](https://github.com/dodo-saba/fit2gpx)
A **_faster_** alternative to the great [**_fit2gpx_**](https://github.com/dodo-saba/fit2gpx)

- [FIT](https://developer.garmin.com/fit/overview/) is a GIS data file format used by Garmin GPS sport devices and Garmin software
- [GPX](https://docs.fileformat.com/gis/gpx/) is an XML based format for GPS tracks.

## Is it any good?

Yes.

## Why another one

- it's about 80 times as fast (single file, no elevation added)
- it can add elevation data (though it isn't very precise)
- it's way faster with multi-file execution too
- it can add elevation data
- it's fun

## Why not this one
## How to add elevation data

- it doesn't support strava bulk-export stuff
- first of all, have srtm data: `.hgt` files downloaded
one reliable source is [Sonny's collection](https://sonny.4lima.de/), it's only for Europe though
- then unzip everything, place all of the `.hgt` files to a single directory
- set `$ELEV_DATA_DIR` to that very directory or pass `--elev_data_dir ~/my_elevation_data_dir`
- pass the `--add_altitude | -a` flag to `fit2gpx`

## Why might this one not be the right choice

- it doesn't support strava bulk-export stuff: unzipping `.gz` files,
which you can do in the shell with 1 command

## Direct dependencies

- [coordinate-altitude](https://github.com/jeromeschmied/coordinate-altitude)
<!-- - [coordinate-altitude](https://github.com/jeromeschmied/coordinate-altitude) -->

- [srtm](https://github.com/jeromeschmied/srtm)
- [fit_file](https://crates.io/crates/fit_file)
- [gpx](https://crates.io/crates/gpx)
- [clap](https://crates.io/crates/clap)
- [rayon](https://crates.io/crates/rayon)
Loading

0 comments on commit d60a762

Please sign in to comment.