How martin-iflap/gpx_to_fit works
GPX → FIT is a browser-based running and hiking converter: the user loads a route, sets timing constraints and optional anchors/stops, then receives a paced FIT activity and profile. Python runs client-side through Pyodide; the core parses the route, models terrain-aware speed, fits timing between anchors, and writes FIT output. The graph also shows the optional surface lookup and the separate tuning harness. Relationships for unsampled modules are included only where the README or SOURCE INDEX supports them; the index does not establish dynamic GUI wiring.
Main entry points: pyodideBridge.js Pyodide bridge · __main__.py Tuning commands · combine.py Anchor-fitted pacing · main.js App controls
Components 25
Browser interface
- App controls
src/gpx2fit/gui/js/main.js - Pyodide bridge
src/gpx2fit/gui/js/pyodideBridge.js - Route map
src/gpx2fit/gui/js/map.js - Anchor and stop UI
src/gpx2fit/gui/js/anchorPopovers.js - Photo anchors UI
src/gpx2fit/gui/js/photoAnchors.js - Activity profile UI
src/gpx2fit/gui/js/profilePanel.js
Conversion engine
- GPX parser
src/gpx2fit/core/gpx_reader.py - Track and activity models
src/gpx2fit/core/models.py
Pacing model
- Anchor resolution
src/gpx2fit/core/pacing/anchors.py - Photo anchor resolution
src/gpx2fit/core/pacing/photo_anchors.py - Stop timing
src/gpx2fit/core/pacing/stops.py - Surface factors
src/gpx2fit/core/pacing/surface.py - Gradient model
src/gpx2fit/core/pacing/gradient.py - Curve selection
src/gpx2fit/core/pacing/curve_selection.py - Anchor-fitted pacing
src/gpx2fit/core/pacing/combine.py
Activity output
- FIT writer
src/gpx2fit/core/fit_writer.py - Profile data
src/gpx2fit/core/activity_profile.py
Model calibration
- Tuning commands
tuning/__main__.py - Recorded FIT reader
tuning/fit_reader.py - Activity preparation
tuning/prepare.py - Parameterized model
tuning/model.py - Pacing comparison
tuning/compare.py - Parameter search
tuning/fit.py
Other components
- Route user
- Valhalla routing
Connections 28
- Route user → App controls: sets route and timing
README.md - App controls → Pyodide bridge: requests parse and convert
src/gpx2fit/gui/js/main.js - Pyodide bridge → GPX parser: loads Python conversion
README.md - App controls → Route map: initializes map
src/gpx2fit/gui/js/main.js - App controls → Activity profile UI: initializes profile
src/gpx2fit/gui/js/main.js - Anchor and stop UI → Pyodide bridge: uses conversion bridge
src/gpx2fit/gui/js/anchorPopovers.js - Photo anchors UI → Pyodide bridge: resolves photos
src/gpx2fit/gui/js/pyodideBridge.js - GPX parser → Track and activity models: builds track
src/gpx2fit/core/gpx_reader.py - Pyodide bridge → Photo anchor resolution: resolves photo times
src/gpx2fit/gui/js/pyodideBridge.js - Photo anchor resolution → Anchor resolution: uses anchor resolution
src/gpx2fit/core/pacing/photo_anchors.py - Stop timing → Anchor resolution: creates stop anchors
src/gpx2fit/core/pacing/stops.py - Pyodide bridge → Stop timing: passes stop inputs
README.md - Valhalla routing → Surface factors: provides route surface data
README.md - Surface factors → Anchor-fitted pacing: adjusts leg speed
README.md - Gradient model → Curve selection: supplies terrain gradients
src/gpx2fit/core/pacing/curve_selection.py - Curve selection → Anchor-fitted pacing: selects speed shape
src/gpx2fit/core/pacing/combine.py - Anchor resolution → Anchor-fitted pacing: provides timing constraints
README.md - Anchor-fitted pacing → FIT writer: produces timed track
README.md - Anchor-fitted pacing → Profile data: produces profile data
README.md - Profile data → Activity profile UI: renders activity profile
README.md - Route user → Tuning commands: runs calibration
README.md - Tuning commands → Recorded FIT reader: reads recorded activities
tuning/__main__.py - Tuning commands → Activity preparation: prepares corpus
tuning/__main__.py - Tuning commands → Pacing comparison: runs comparisons
tuning/__main__.py - Tuning commands → Parameter search: fits pacing constants
tuning/__main__.py - Pacing comparison → Parameterized model: scores model output
tuning/compare.py - Parameter search → Parameterized model: searches model parameters
tuning/fit.py - Activity preparation → Recorded FIT reader: uses decoded activity
tuning/prepare.py