I have done a couple of long distance swims with my Garmin Swim 2 and am frustrated by the inaccuracy in recorded distance which is always about 20-25% short. This weekend I swam a 12km race but the watch reported that I had done 9900m!
I downloaded the .FIT file from the watch and wrote some Python code to check what was going on.
I extracted all the GPS data recorded on the route and was astonished to discover that when I calculate the sum of the distance of all the points it was almost perfectly accurate at 11.7km but when the accumulated distance covered according to the watch was only 9984m.
The problem is that when the watch syncs to Garmin Connect or to Strava or whatever, it is reporting the 9984m distance which is completely wrong and this then messes with other stats like pace/100m etc.
It is extremely annoying since it is now clear that the watch GPS is functioning perfectly and this should be an easy fix.
Here is the code if anyone wants to check the same:
import fitparse
from geopy.distance import geodesic
# Load the FIT file
fitfile = fitparse.FitFile(r"PATH TO YOUR .FIT FILE")
# Extract latitude and longitude data points
lat_lon_points = []
for record in fitfile.get_messages("record"):
if record.get_value('position_lat') and record.get_value('position_long'):
lat = record.get_value('position_lat') * (180 / 2**31)
lon = record.get_value('position_long') * (180 / 2**31)
lat_lon_points.append((lat, lon))
# Calculate the total distance based on lat,lon points
total_distance = 0.0
for i in range(1, len(lat_lon_points)):
total_distance += geodesic(lat_lon_points[i-1], lat_lon_points[i]).meters
print (f"Total distance measured by GPS: {total_distance/1000}")
# Sum the measured distance recorded in each message['record']
measured_distance = []
for record in fitfile.get_messages("record"):
if record.get_value('distance'):
measured_distance.append(record.get_value('distance'))
# measured_distance += record.get_value('distance')
print (f"Distance reported by the watch: {measured_distance[-1]}")