How to geotag photos from a GPX file in Lightroom Classic, ExifTool and digiKam
To geotag photos from a GPX file, load the track into a tool that compares each photo's capture time with the time stamps in the track and writes the matching coordinates into the photo. Lightroom Classic does this in the Map module, ExifTool with -geotag, digiKam with its GPS Correlator. Getting the time offset right is the key step.
Before you start
Track-based geotagging works for any camera that records a capture time, which is every digital camera. You need three things:
- Photos with their original capture time. The tools read
DateTimeOriginalfrom the EXIF data, so work on the original files or raw files, not exports that stripped metadata. - A GPX track that covers the same period. It can come from a phone app, a hiking watch or a dedicated logger. If you are unsure what is inside the file, see what a GPX file is.
- The difference between your camera clock and real time. The easiest way to know it: at the start of the walk, photograph your phone's clock with the camera. Later you compare the time on the screen with the photo's capture time.
Work on a copy of a few test photos first. All three tools change file metadata, and it is quicker to fix an offset on ten files than on a thousand.
The time offset: why matches fail
Almost every failed geotag comes down to time. GPS tracks store time in UTC. Most cameras store capture time as plain local clock time with no time zone attached. The software therefore has to guess the zone, and it usually assumes the time zone of your computer. If you shot in Lisbon and edit in New York, every photo lands hours away from its true position on the track, or does not match at all.
There are two separate corrections, and it helps to keep them apart:
- Time zone: the whole-hour (sometimes half-hour) difference between the camera's local time and UTC, including daylight saving time.
- Clock error: the minutes or seconds by which the camera clock is simply wrong. Camera clocks drift, and many people never reset them after a trip.
For a walking photographer, a clock error of one minute moves a photo by roughly the distance you walk in a minute, so it matters even when the time zone is right. The background is covered in how to geotag photos; below is how each tool handles it.
Lightroom Classic: Map module tracklog
Lightroom Classic can load a track log in GPX format and tag photos in the current selection whose capture times fall within it.
- Open the Map module. Select the folder or collection that holds the photos from the walk.
- Load the track. Choose Map > Tracklog > Load Tracklog and pick the GPX file. The route appears on the map.
- Select the photos. In the Filmstrip, select the photos you want to tag.
- Fix the offset if needed. Choose Map > Tracklog > Set Tracklog Time Offset. The dialog shows the capture-time range of the selected photos next to the time range of the track. Move the Offset slider (hours and minutes) until the two ranges overlap, then click OK.
- Tag. Choose Map > Tracklog > Auto-Tag Selected Photos. The photos appear as markers along the route.
- Write to the files. Lightroom Classic stores the coordinates in its catalog. If other apps need to see them, save metadata to the files (Metadata > Save Metadata to File in the Library module).
Older tutorials call the offset command "Set Time Zone Offset"; current versions of Lightroom Classic label it Set Tracklog Time Offset. Adobe describes both commands in its Map module help.
ExifTool: geotag from the command line
ExifTool is free, runs on Windows, macOS and Linux, and reads GPX along with many other log formats. Its geotagging is driven by a few options, all documented on the ExifTool geotagging page.
Basic command
exiftool -geotag walk.gpx ~/Photos/2026-10-03
This reads each photo's DateTimeOriginal, assumes it is in your computer's local time zone, converts it to UTC and interpolates a position between the two nearest track points. ExifTool writes GPS tags into EXIF and keeps a backup of each changed file with _original appended to the name.
Photos taken in a different time zone
Tell ExifTool which zone the camera clock was set to by building the geotag time yourself. On macOS and Linux, use single quotes so the shell leaves the $ alone:
exiftool -geotag walk.gpx '-geotime<${DateTimeOriginal}+01:00' ~/Photos/lisbon
Camera clock was wrong
Use -geosync with the difference between GPS time and camera time. The value is positive if the GPS time was ahead of the camera clock. If the camera was 25 seconds slow:
exiftool -geotag walk.gpx -geosync=+25 ~/Photos/2026-10-03
A single number is read as seconds; you can also write MM:SS or HH:MM:SS. If you photographed a clock, you can also pass the time shown on screen together with that image (-geosync="[email protected]") and let ExifTool work out the offset; the Time Synchronization tip in the documentation shows how to handle the time zones.
Useful extras
- Several tracks:
-geotag "tracks/*.gpx"(keep the quotes). - Interpolation limits: by default ExifTool interpolates across gaps of up to 1800 seconds between track points and still tags photos taken up to 1800 seconds before or after the track. Tighten it with
-api GeoMaxIntSecs=120and-api GeoMaxExtSecs=120if you would rather leave a photo untagged than guess. - Diagnostics: add
-v2to see how many points were loaded, the track start and end in UTC, and the UTC time ExifTool computed for each image. - Undo:
exiftool -geotag= photo.jpgremoves the GPS tags again.
digiKam: Geolocation Editor and GPS Correlator
digiKam is a free, open-source photo manager for Windows, macOS and Linux. Its correlator gives you explicit control over time zone, clock offset and interpolation.
- Open the editor. Select the photos in the main view and press
Ctrl+Shift+Gto open the Geolocation Editor. - Switch to the GPS Correlator tab in the right sidebar and click Load GPX File. You can load more than one track; each gets its own color on the map.
- Set Camera Time Zone. Choose Same As System if you shot in your home time zone, or Manual and pick the UTC difference if you were elsewhere.
- Set Offset of pictures to correct a camera clock that was a few minutes or seconds off.
- Choose the matching method. Match directly takes the nearest track point within a maximum gap in seconds. Interpolate calculates a position between the two nearest points, which suits tracks recorded at intervals of 30 seconds or more.
- Click Correlate, review the markers on the map, then click Apply at the bottom of the editor to write the coordinates to the files and the digiKam database.
The time zone and offset settings only affect matching; they do not change the capture times stored in your photos. The digiKam manual describes every option in the correlator.
Which tool to use
| Tool | Cost | Track formats | Time correction | Best for |
|---|---|---|---|---|
| Lightroom Classic | Adobe subscription | GPX | Set Tracklog Time Offset (hours and minutes) | Photographers already using a Lightroom catalog |
| ExifTool | Free | GPX, KML, NMEA, FIT and more | Time zone in -geotime, clock error with -geosync, to the second | Batches, scripts and precise control |
| digiKam | Free, open source | GPX | Camera Time Zone plus Offset of pictures | A free graphical tool with a map preview |
If you only want the free route, digiKam is the gentler start and ExifTool is the most precise. For other ways to add location, including manual placement on a map, see how to geotag photos.
Check the results
Do not trust a geotag run until you have looked at it on a map:
- Look for a photo you remember clearly, such as a landmark, and check it sits in the right place.
- Photos bunched at the start or end of the track usually mean the capture times fall just outside the track, so the tool used the nearest end point. Check the time zone.
- Photos consistently a short way behind or ahead along the route point to a clock error of a few minutes.
- Nothing tagged at all usually means a time zone error larger than the tool's gap limit, or a track from a different day.
Once the test set is right, run the same settings on the rest of the shoot from that camera.
Questions
- Why does Lightroom Classic not auto-tag my photos from a GPX file?
- Usually the capture times of the selected photos do not fall inside the track's time range because of a time zone or camera clock difference. Use Map > Tracklog > Set Tracklog Time Offset until the photo and track time ranges overlap, then run Auto-Tag Selected Photos again.
- What is the free way to geotag photos with a GPX file?
- ExifTool and digiKam are both free. ExifTool works from the command line with the -geotag option, while digiKam offers a graphical GPS Correlator with a map preview.
- What does -geosync do in ExifTool?
- It applies a time correction between the camera clock and GPS time before matching. The value is positive if GPS time was ahead of the camera clock, so -geosync=+25 fixes a camera that was 25 seconds slow.
- Does geotagging with a GPX file change my photos?
- It adds GPS tags to the metadata; the image itself is untouched. ExifTool keeps a backup copy by default, and Lightroom Classic keeps coordinates in its catalog until you save metadata to the files.
Record the route of your next photo walk
ShutterRoute logs a GPS track on your iPhone or Android phone while you shoot, even offline. Export it as GPX and geotag your photos at home — no account needed.
Get the app