This is a small Python application that adds time information to a GPX file in order for it to be accepted by a GARMIN Edge 800 GPS.
With the time informations missing the GPX files are rejected by the Edge 800.
The time informations are computed based on the distance between 2 consecutive points. The height is currently not taken in to account so this is just a rough estimate. However, speed information can be added to the command line to make the time information more representative.
The application uses:
- xml.etree.ElementTree to manipulate de GPX data
- argparse to parse the argument given in the command line
>$ ./convGPX.py -h
usage: convGPX.py [-h] [--speed SPEED] inputfile outputfile
Convert a GPX file without time information to a GPX understandable by Garmin GPS
positional arguments:
inputfile name of the input file
outputfile name of the output file
optional arguments:
-h, --help show this help message and exit
--speed SPEED Speed in km/h (default: 5.0)
During the operation, the application displays for each point
- a number (starting from 0)
- the distance to the previous point
- the time to travel from the previous point
- the cumulated distance from point 0
- the time value that will be inserted in the GPX file (the application gives point 0 the current time)
This application works as I want it to and it covers my needs perfectly. If you have similar needs, don't hesitate to use it, but don't expect me to change it to cover a particular need. You can also copy it and modify it to personalize it as long as you keep the license.