Geotagging photos in Darktable and/or Digikam using Garmin .fit files

I’ve captured some photos while simultaneously recording the track in a Garmin .fit file. Now I’d like to geotag all the photos using those tracks. As Darktable needs .gpx files, I tried to convert the .fit files using the following small script. This fails however. Does anybody know how to correctly geotag photos in Darktable from .fit files?

#!/bin/zsh

for file in ./*.fit; do

echo $file;

gpsbabel -i garmin_fit -f "$file" -o gpx -F "$file.gpx"

done

This however fails: Darktable reports that no photos match the generated gpx file. The tracks each span an entire day, so it would surprise me were any difference between time zones be the problem. The generated gpx files open without a hitch in map apps.

EDIT
Got it working, at least partially. Some photos are geotagged correctly (e.g. a photo taken at a specific viewpoint, is marked exactly at that point). But a whole lot are not geotagged at all, I presume because they fall between waypoints recorded. Is it possible to use something like interpolation to get all photos geotagged?

Thanks a lot!

1 Like

Which time zone does the .fit file use? Maybe you need to adjust the timestamps by an hour or two. Digikam has an option to compensate for such a difference.

Thank you for your reply! It works now partially, I added this to the first post.

Don’t know about darktable, but digiKam can do this as well.

I’ve create some years ago the Lua script geoToolbox and @wpferguson improved the script even more. Perheps this is usefull for you: