Skip to content

Add a GPX track for the velodrome - #5

Merged
RalfLeonFasler merged 1 commit into
mainfrom
feat/velodrome-gpx
Nov 7, 2026
Merged

RalfLeonFasler merged 1 commit into
mainfrom
feat/velodrome-gpx

Conversation

@RalfLeonFasler

Copy link
Copy Markdown
Contributor

Apps that only ride GPS routes can't use routes/velodrome-250.json directly. Incyclist is the first of these. This adds a GPX track of the same route, so those apps can import it.

What's in it

  • routes/velodrome-250.gpx: OpenRadlr's 250 m oval (two 50 m straights, two semicircles, a point every ~2.5 m on the bends). It starts at 47.0 N, 8.0 E, round numbers chosen on purpose, not a real velodrome. The track is closed: the last point repeats the first.
  • tools/velodrome_gpx.py: writes the file and gives the same output byte for byte on every run. It scales the oval so the track measures 250 m within 1 mm, using the haversine formula on a 6378.1 km sphere, the radius Incyclist uses.
  • tools/validate.py: checks every routes/<id>.gpx. A route <id> must exist, the track must be the route's length within 1 cm, and on a loop it must end at its first point.
  • README: one line saying routes may come with a GPX track, and the JSON stays the authority.

Checked

  • tools/validate.py passes (with the pinned jsonschema 4.23.0). It fails as expected on a track with the closing point removed: "track is 247.501 m long, expected 250" and "the track does not end at its first point".
  • Incyclist's own GPXParser (from incyclist/services) imports the file as a 250.0005 m loop and keeps all 63 points. Its route hash is 3d74c4d2601274d54323be94319d8207. Incyclist will recognise the velodrome by that hash, so this file must not change once merged (spec 4.2).

🤖 Generated with Claude Code

Apps that only ride GPS routes, such as Incyclist, can import
routes/velodrome-250.gpx. tools/velodrome_gpx.py writes it: OpenRadlr's
250 m oval at a fixed anchor, scaled to 250 m by the haversine formula,
closed by repeating the first point. The validator checks that each GPX
track matches its route's length within 1 cm and closes on a loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RalfLeonFasler
RalfLeonFasler merged commit 9276db5 into main Nov 7, 2026
1 check passed
@RalfLeonFasler
RalfLeonFasler deleted the feat/velodrome-gpx branch November 7, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant