LATEST VERSION and DOWNLOAD on GitHub: https://github.com/zekitez/GpxRepairTool

Table of contents

Introduction

I started making videos with a GoPro Hero 9 and uploaded them in KinoMap but sometimes "My video isn't available in Kinomap apps, why ?". Read https://support.kinomap.com/hc/en-us/articles/360000294886-My-video-isn-t-available-in-Kinomap-apps-why- . One reason is missing in the list: The GPS data is not good enough. The GPS data is extracted with the GoPro Telemetry Extractor (Lite and free) from the GoPro video. Load this data in GpsTrackEditor and you will see that latitude+longitude are inaccurate and the elevation... is from another planet. I started to record GPS data with a Garmin Edge 830. KinoMap can handle the Garmin GPS data (.fit file). But sometimes the problem persisted: "My video isn't available in Kinomap apps, why ?". Later I realized the problem with the Garmin GPS recording happens only in dense, humid and wet forest sections. Thus the Garmin had bad signal reception !! This does NOT apply to the GoPro GPS data: its just always... not good enough. Note that I use a click-on chin mount on a Fox ProFrame helmet.

In the screenshot of the map in GpsTrackEditor, the start of the "MTB VTT from Nijverdal to Holten in the autumn" recording. The RED line is the Garmin GPS data. The ORANGE sequence of arrows is the GoPro Hero 9. The recording starts at the Parking with Gopro:29 and Garmin:43 meter elevation. The deepest point is with Gopro:-48 (...?) and Garmin:31 meter elevation. According to Google Earth its 40 and 31 meters elevation. The Gopro records GPS data at approx 18-19 Hz while the Garmin records in any recording mode at 1Hz maximum. Is the difference caused by the the GoPro Telemetry Extractor ?

GoPro and Garmin GPPS recording.

The recording procedure is always the same: first start the GPS recording with the Garmin and after a few seconds start the video recording with the GoPro. And to stop : first stop the video recording and after a few seconds stop the GPS recording. This way there is always overlap of GPS measurements for the video which should result in a more easy synchronissation of video and GPS data in Kinomap.

The Garmin .fit file is a binary file (not readable with a text editor) and contains GPS measurements at maximal 1 second intervals (minimum data: latitude, longitude, time and elevation). If your Garmin is paired with other sensors (examples: cadans, heartrate or an.. ebike) then the measurements of these sensors are also included as extensions in the .fit file. More information about .fit files can be found at Garmin's website. The Garmin Edge can record smart or at 1 sec. intervals, see the manual on how to change that.

Sometimes, in Kinomap, synchronisation of video and GPS data was difficult or Kinomap rejected the .fit file or it showed in the app flattened (no elevations) or it was not available in the app. I searched for a tool to check the .fit file and found a very nice analyses tool (freeware) in the Windows Store:"Fit File Tools". The tool analyses the loaded .fit file and reports what is wrong in the file. Select menu "Fit File" and then item "Records". The tool can represent the data in graphs and in a map. Editing data is not available in the freeware version. Using this tool I found:

Later with my own software, and another tool GpsTrackEditor, I discovered that a recording which was made in a wet dense forest but without me stopping/pauzing/halting had many 1-3 second stops (speed 0) :

References

How hard can it be to repair a .fit file ?

On the Garmin website you can find conversion tools and code but after some experimenting, a simple forward-back conversion to .csv and back to .fit, with the FitCvsTool the results where poor (even crashes). The same applies to some online tools I found.

Kinomap accepts .gpx files so if the .fit file is translated to .gpx then I am free to repair the data (very simple: with an editor). There are freeware tools that can translate GPS formats into other GPS formats, I used: GpsBabel but I also like the online tool: GpsVisulizer. GpsBabel will also display the .fit file in a map. Translating a .gpx file back to a .fit file failed. I had only crashes or bad .fit files. I assume the .gpx file misses information required for a .fit file.
There are also on line tools you could use, examples:

To view the repaired .gpx file on a map I use the tools: GpxStudio, GpsTrackEditor and VeloHero. To compare the original and repaired .gpx file I use WinMerge. GpsBabel translates .fit files recorded in smart mode to GPX 1.1 (the speed tag was removed from this format but extensions are included) and the 1 second mode to GPX 1.0 (including the speed tag but excluding extensions).

Thus the way to go is simple: use GpsBabel to convert the .fit file into a .gpx file and then run my own tool to repair the .gpx file. I wrote a program, in Purebasic, that repairs the .gpx file for me. Why PureBasic ? Its easy to program, has a build-in XML parser and functions to manipulate XML (move, delete, insert, etc), runs on Windows + Linux + MacOs, and I already had a license and used it for other tools.

The program does :

Run on Windows

its a 64 bit version. No further actions required.

Windows .exe

Run on Linux

Its a 64 bit version. You may have to install several packages before the program runs. See:
http://forums.purebasic.com/english/viewtopic.php?f=15&t=74875 . This can be a real challenge if you are not familiar with Linux. The Purebasic IDE still crashes when I try to run the app but the compiled app works fine.

Linux.

Run on MacOs

Its a 64 bit Intel version (M1 via Rosetta ?). No further actions needed.

Imac app

Back