summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-03 08:25:07 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-03 08:25:07 +0200
commit9707f9ad09db935af7d06b5de08bc52de13ba6a7 (patch)
tree34bcd01e5eda302a8730bf0817d5dd7e82186359 /README.md
parentf06a10982ab9d5aaa7d31cea31964431fa75f253 (diff)
feat: Detect mountain pass crossings, name climbs after passes, render ride charts
- osmpass: extract mountain_pass=yes nodes from an OSM PBF, enrich centcols passes with OSM coordinates, resumable -fetch-osm download - mountain_pass: DetectCrossings for a ride, MatchClimb to name a climb after the pass it tops - ride: expose Points(), add Climb.Top() and Climb.Name - chart: -chart renders elevation profile with climb bands and pass markers - commands: -fetch-osm, -extract-osm, -import-cached, -enrich
Diffstat (limited to 'README.md')
-rw-r--r--README.md19
1 files changed, 18 insertions, 1 deletions
diff --git a/README.md b/README.md
index 97c022e..06af5d3 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@ A Go toolkit for analyzing cycling rides from GPX exports: parse rides, detect c
- **Difficulty score (Cotacol)** — scores any ride or climb by splitting it into 100 m segments and summing `0.1 km × slope²` per segment
- **Similar-climb matching** — finds the same climb across rides by matching start/end coordinates, so times can be compared
- **Mountain pass download** — imports French mountain passes from centcols.org into a SQLite database
+- **Pass crossing detection** — enriches passes with OSM coordinates, flags which passes a ride crosses, and names each climb after the pass it tops (e.g. "Col de Castellaras")
- **Plots** — renders elevation and score-profile charts as PNG
## Getting started
@@ -29,6 +30,18 @@ go build -o biking_home .
# Run the climb-similarity and difficulty-score demo on the example rides
./biking_home -demo
+# Import cached department CSVs (debug_department_06.csv, 13.csv) into the DB
+./biking_home -import-cached
+
+# Extract mountain passes from a France OSM PBF into the DB
+./biking_home -extract-osm /path/to/france-latest.osm.pbf
+
+# Backfill OSM coordinates onto passes (needs -extract-osm run first)
+./biking_home -enrich
+
+# Render an elevation chart with climb highlights and pass markers
+./biking_home -chart examples/2023-06-17.AlpesVerdonTour.gpx
+
# Profile the demo with Go's CPU profiler
./biking_home -demo -cpuprofile /tmp/cpu.prof
```
@@ -39,6 +52,10 @@ go build -o biking_home .
| --- | --- | --- |
| `-download` | Download mountain passes into the database | `false` |
| `-resume` | Skip departments already cached on disk | `false` |
+| `-import-cached` | Import cached department CSVs into the database | `false` |
+| `-extract-osm` | Extract mountain passes from a France OSM PBF | `""` |
+| `-enrich` | Backfill OSM coordinates onto passes | `false` |
+| `-chart` | Render an elevation chart (climbs + passes) for a GPX file | `""` |
| `-demo` | Run the climb-similarity demo | `false` |
| `-cpuprofile` | Write a CPU profile to file | `""` |
@@ -47,6 +64,7 @@ go build -o biking_home .
- Go 1.23; SQLite via `mattn/go-sqlite3`; charts via `gonum.org/v1/plot`
- `ride` — GPX parsing, climb detection, difficulty scores (KOM + Cotacol), similarity index
- `mountain_pass` — centcols.org department CSV download into SQLite, with disk caching and retries
+- `osmpass` — OSM PBF extraction (`mountain_pass=yes` nodes) and pass coordinate enrichment
- **Notable choices** — the difficulty score follows the Cotacol method: the ride is split into fixed 100 m segments and each scores `distance_km × slope²`, so steep sections weigh exponentially more than long flat ones
## Development
@@ -60,7 +78,6 @@ go test ./...
- Compute estimated power
- Export data from Strava / Garmin (GPX, TCX, FIT)
-- Auto-detect when a mountain pass is crossed
- Plot speed and slope per segment, colored by heart rate
- Persist the chosen climb variant across activities
- Handle historical data