Wraps @garmin/fitsdk to emit FIT Course files from GPX, the binary format Wahoo's POST /v1/routes API requires. Server-side only — the ~1 MB SDK never ships to the planner browser bundle. Round-trip tests use fit-file-parser as an independent oracle and assert lat/lon parity within 1e-4 deg and altitude within 0.5 m across short flat, alpine, multi-day, and single-point fixtures. Updates design.md decision #1: the original hand-rolled-encoder plan was justified largely by ESM friction in the Garmin SDK, but as of v21.202.0 the SDK is pure ESM with zero deps. Wrapping it saves us ~400 LOC of binary plumbing and ongoing maintenance against future FIT spec updates. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
16 lines
861 B
XML
16 lines
861 B
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<gpx version="1.1" creator="trails.cool" xmlns="http://www.topografix.com/GPX/1/1">
|
|
<metadata><name>Alpine climb</name></metadata>
|
|
<trk><trkseg>
|
|
<trkpt lat="46.5000" lon="11.3000"><ele>800.0</ele></trkpt>
|
|
<trkpt lat="46.5050" lon="11.3050"><ele>950.5</ele></trkpt>
|
|
<trkpt lat="46.5100" lon="11.3100"><ele>1100.2</ele></trkpt>
|
|
<trkpt lat="46.5150" lon="11.3150"><ele>1280.7</ele></trkpt>
|
|
<trkpt lat="46.5200" lon="11.3200"><ele>1450.0</ele></trkpt>
|
|
<trkpt lat="46.5250" lon="11.3250"><ele>1620.3</ele></trkpt>
|
|
<trkpt lat="46.5300" lon="11.3300"><ele>1800.0</ele></trkpt>
|
|
<trkpt lat="46.5350" lon="11.3350"><ele>1750.0</ele></trkpt>
|
|
<trkpt lat="46.5400" lon="11.3400"><ele>1600.0</ele></trkpt>
|
|
<trkpt lat="46.5450" lon="11.3450"><ele>1400.0</ele></trkpt>
|
|
</trkseg></trk>
|
|
</gpx>
|