This script converts a given gpx file to fit files.
For each track in the gpx file a separate fit file is created.
The created fit files are a course files.
The script creates fit files supporting the
"Up Ahead" or "POIs along a route" feature.
If you don't want to use this feature use --no-waypoints to disable course points.
By default, waypoints are snapped to the track.
Doing this ensures that "Up Ahead" works as intended.
If you don't want to snap waypoints to the track use --no-snap.
If you want to exclude waypoints far away from the track, use --max-snap-distance.
By default, only waypoints closer than 100 meters are snapped.
The script supports icons for the course points.
Assign your GPX Waypoint a type or sym tags.
The script first checks the type tag and then the sym tag, so you can have different value in them.
Supported types are:
genericor0summitor1valleyor2wateror3foodor4dangeror5leftor6rightor7straightor8first_aidor9fourth_categoryor10third_categoryor11second_categoryor12first_categoryor13hors_categoryor14sprintor15left_forkor16right_forkor17middle_forkor18slight_leftor19sharp_leftor20slight_rightor21sharp_rightor22u_turnor23segment_startor24segment_endor25campsiteor27aid_stationor28rest_areaor29general_distanceor30serviceor31energy_gelor32sports_drinkor33mile_markeror34checkpointor35shelteror36meeting_spotor37overlookor38toiletor39showeror40gearor41sharp_curveor42steep_inclineor43tunnelor44bridgeor45obstacleor46crossingor47storeor48transitionor49navaidor50transportor51alertor52infoor53
You can define the sport type using the --sport-type flag.
By default, hiking (17) is used.
fit files are binary files.
The python sdk does not support encoding files (only decoding).
This script
- prepares all data,
- saves the data as csv and
- then uses a Java tool from the SDK called FitCSVTool to convert the csv file to a fit file. That means you have to download the SDK and have a Java JRE installed.
When your track has is a roundtrip with a shared started and beginning (or any other segment you plan to
walk more than once) and you have a waypoint onto this segment, then the waypoint will only be included
once.
There is a workaround, but it may not be feasible for everybody: Split the track in multiple tracks,
because then the waypoint will be added to all relevant fit files.
- python (obviously)
- java (not obvious, see above)
- gpxpy
- Fit SDK
- Download,
- extract and
- move the folder to the root folder of this repo.
- Rename the folder to
SDK. Thejarshould be at this placeSDK/java/FitCSVTool.jar.