Crate coursepointer

Source
Expand description

CoursePointer is a CLI tool and library for computing Garmin FIT courses and course points from routes and waypoints.

This crate helps waypoints (such as from a GPX file) appear in Up Ahead on compatible devices, like Fenix watches and Edge bicycle computers.

See the repo’s README for details about how this works and the problem it solves.

§Binary

The coursepointer binary takes as input a GPX file containing a single route or track, and outputs a Garmin FIT course file in which those of the GPX’s waypoints that are within a threshold distance of the route/track have been converted to FIT course points. Also see README for more information about using the binary.

§Library

The library crate contains the bulk of the binary’s logic. It builds on top of GeographicLib to compute the interception points and course distances of waypoints near routes or tracks, then encodes this all as a FIT course.

It also provides, in the course module, lower-lever builders to compose courses and course points out of routes and waypoints programmatically.

§Feature flags

  • cli enables the additional dependencies needed by the CLI. This needs to be explicitly enabled if installing the CLI with cargo install.

  • rayon enables computing course points in parallel using rayon. This improves the binary’s runtime significantly in stress tests, and at least doesn’t hurt in more typical cases, on my machine. Enabled by default.

  • full-geolib causes cxx_build to build all GeographicLib sources instead of a hand-picked subset. This is mainly useful when experimenting with new FFI additions, otherwise it simply slows the build down.

Modules§

course
Types for composing courses that contain course points

Structs§

ConversionInfo
Summarizes the result of converting GPX into a FIT course
CourseFile
A write-only Garmin FIT course file
Degree
Angular degree
FitCourseOptions
Options for writing a FIT course
GeoPoint
A point on the surface of the WGS84 ellipsoid

Enums§

CoursePointType
Course point types
CoursePointerError
An error in a high-level library operation
FitEncodeError
An error when encoding to FIT
Sport
Sport types

Constants§

DEG
Angular degree

Functions§

convert_gpx_to_fit
Convert GPX into a FIT course file
read_gpx
Read a GPX file into a CourseSet
write_fit_course
Write a single Course into a GPX course file

Type Aliases§

Result