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:
generic
or0
summit
or1
valley
or2
water
or3
food
or4
danger
or5
left
or6
right
or7
straight
or8
first_aid
or9
fourth_category
or10
third_category
or11
second_category
or12
first_category
or13
hors_category
or14
sprint
or15
left_fork
or16
right_fork
or17
middle_fork
or18
slight_left
or19
sharp_left
or20
slight_right
or21
sharp_right
or22
u_turn
or23
segment_start
or24
segment_end
or25
campsite
or27
aid_station
or28
rest_area
or29
general_distance
or30
service
or31
energy_gel
or32
sports_drink
or33
mile_marker
or34
checkpoint
or35
shelter
or36
meeting_spot
or37
overlook
or38
toilet
or39
shower
or40
gear
or41
sharp_curve
or42
steep_incline
or43
tunnel
or44
bridge
or45
obstacle
or46
crossing
or47
store
or48
transition
or49
navaid
or50
transport
or51
alert
or52
info
or53
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
. Thejar
should be at this placeSDK/java/FitCSVTool.jar
.