Import existing data
This page is about data that already exists somewhere else: maps your club has georeferenced over the years, courses planned in other software, a whole archive on a RouteGadget server. Rather than recreating it by hand, you can move it into Checkpoint with a script against the API.
What the API gives you
Section titled “What the API gives you”Everything the app does, a script can do too, with the same account and the same permissions. For an import, the useful parts are:
- Clubs —
POST /api/clubscreates the club the imported maps and courses will belong to. - Maps —
POST /api/mapsuploads a map image together with the latitude and longitude of its four corners, which is all Checkpoint needs to lay it over the terrain. A map can also start without an image and be georeferenced later withPUT /api/maps/{id}/georeference. - Courses —
POST /api/coursescreates a course on a map from its controls’ coordinates. If your courses are already in IOF XML (v2 or v3) or MapRun KML,POST /api/courses/importreads the file and returns the controls, ready to save.
Every parameter is in the OpenAPI browser. Mind the limit of 100 requests a minute: pace a large import rather than retrying on 429.
Samples
Section titled “Samples”Working examples are in Checkpoint-io/Checkpoint-Samples on GitHub. They’re released under CC0, so copy and adapt them freely.
RouteGadget: every georeferenced map and its courses
Section titled “RouteGadget: every georeferenced map and its courses”Import/RouteGadget/import-routegadget.mjs takes every
georeferenced map on a RouteGadget server, with the courses of every event
held on it, and recreates them in a new club on Checkpoint:
- It reads the server’s list of maps and events.
- It turns each map’s georeference into the real-world position of the image’s four corners, and each course’s controls from positions on the image into latitude and longitude.
- It creates the club, uploads each map, and creates its courses.
Maps that aren’t georeferenced are skipped: without real-world coordinates there’s nothing to place on the terrain.
To run it, set the constants at the top of the file — your Checkpoint email and password, a name for the new club, and your RouteGadget server’s addresses (the sample points at one of British Orienteering’s) — then, with Node.js 20 or later:
node import-routegadget.mjsIt paces its own requests to stay under the rate limit, so a large archive takes a while.
Only import maps and courses you have the right to publish. A map belongs to the club or mapper who made it, whether or not it sits on a public server.
Collaborate
Section titled “Collaborate”Written an importer for another tool — OCAD, Purple Pen, Condes, Livelox, your club’s own archive? Contributions to the samples repository are welcome: open a pull request, and it will help the next club making the same move.
If an import needs something the API doesn’t do yet, or you’d like a hand with a migration, tell us on the Import board of the feedback page.