Applies to macOS Ventura through macOS 27

The short answer: matching photos to a GPS track compares two clocks. The track’s clock is the satellites’: exact, and in UTC. The camera’s clock is whatever somebody set it to, in a time zone it usually doesn’t record. When the result is wrong, look at how it is wrong, because the size of the error names the cause. Nothing matches, or everything is hours along the track: the time zone. Everything is consistently a street or a bend out: the camera clock was fast or slow. Right in the morning, wrong later: the clock was changed during the trip. Some photos get nothing: the recording has a hole. Nothing matches on any setting: the wrong file, the wrong day, or a route that has no times in it at all.

A disclosure: I’m the developer of Media Location Tagger, a Mac location editor that matches photos to GPX tracks. Each section below gives the fix for Lightroom Classic and ExifTool first.

Three boundary checks:

Read the symptom first

What you see Most likely cause Section
“No matching photos”, or nothing is tagged Time zone; or the wrong day’s track 1, 6
Every photo is far along the track from where it was taken, by the same amount Time zone (a whole number of hours) 1
Every photo is a little before or after where it was taken Camera clock fast or slow 2
One camera is right and the other isn’t Two cameras, two clocks 3
Right at the start of the trip, wrong later Clock changed on the way, or daylight saving 4
Most photos match, some get no position Gaps in the recording 5
The track shows on the map but no photo ever matches A route without times 7

One test separates the first two rows from the rest: pick a photo you can place from memory, and see how far along the track it landed. On foot, an hour is several kilometres; a clock error of a few minutes is a few hundred metres.

1. No matching photos, or everything hours out: the time zone

A GPX file stores every point in UTC. A camera stores the local time on its clock, and most cameras don’t store which zone that was. So the software has to assume one. Lightroom and ExifTool assume the zone your Mac is set to now. That is right when you photographed at home with a correctly set camera, and wrong in the two most common travel cases:

  • You travelled and set the camera to local time. Back home, the Mac is in another zone.
  • You travelled and left the camera on home time. Now the camera disagrees with the place.

If the assumed time falls outside the hours the track covers, nothing matches. If it falls inside, every photo is tagged, confidently, at the place you were some hours earlier or later.

Lightroom Classic. When Auto-Tag reports no matching photos even though the dates agree, this is nearly always the reason. Choose Map ▸ Tracklog ▸ Set Time Zone Offset and move the slider until the photos’ time range falls inside the track’s. The offset is the difference between the camera’s zone and the Mac’s, in hours.

ExifTool. Say the zone explicitly instead of letting it assume one:

# the camera clock was on utc+2 (central european summer time)
exiftool -geotag track.gpx '-geotime<${DateTimeOriginal}+02:00' /path/to/folder

Media Location Tagger. Each camera has a time zone you can see and change in the sidebar’s Cameras tab; the Mac’s own zone is never applied silently. When the photos miss the track by a whole number of hours, the time strip under the map says so and offers a Shift, which corrects the camera’s zone and leaves its clock alone. Check a photo you recognise afterwards.

Some cameras do write a zone into each file. If that setting was wrong on the camera, the software believes it. In Media Location Tagger, tick Ignore the time zone in the files in the camera’s card and choose the right one.

2. Photos land a little before or after where they were taken: the camera clock

The zone is right, the photos are on the track, and each one sits where you were a few minutes earlier or later. On a walk that is the wrong side of the square; from a train it is the next village. The error is the same for every photo from that camera, which is what makes it fixable from a single reference.

Find the error. You need one photo for which you know either the place or the true time:

  • A place. A photo of something that can only have been taken at one spot you passed: a bridge, a summit sign, a station platform. Not the café where you sat for an hour, because the track has the same position for many different times there.
  • A time. A photo of your phone’s clock, a station clock, anything that shows the true time. Worth taking once per trip for this reason.

Lightroom Classic has no setting for minutes. Shift the capture times first with Metadata ▸ Edit Capture Time, then run Auto-Tag again. Note that this changes the capture time Lightroom shows and, once saved, the time in the files.

ExifTool takes the error as -geosync. The sign is the part people get wrong: it is what you add to the camera time to get the true time, so a camera that was fast gets a negative value.

# camera clock 4 minutes 20 seconds fast
exiftool -geotag track.gpx -geosync=-4:20 '-geotime<${DateTimeOriginal}+02:00' /path/to/folder

Media Location Tagger works the error out from the reference. Select the one photo whose place you know, click Set Clock from Map… in the Cameras tab, and click the spot on the track where it was taken. The status line names the correction, for example clock set 4 min 20 s fast, and all of that camera’s proposed positions move at once. If you know the true time instead, use Sync Clock… and type it. A phone photo that already has coordinates can serve as the landmark: select the camera photo, right-click the phone photo’s marker and choose Item Was Taken Here. Then hover over a second photo from later in the day to confirm that the correction holds.

The map zoomed in on a town centre: a green pin marks the corner where the selected photo of a mural painter was taken, and the photo's proposed position sits two blocks further east along the track

A clock error on the map: the photo was taken at the green pin, and the track match puts it two blocks away, where I was four minutes later.

The Sync Clock dialog for the Leica D-Lux 8: the photo's camera time 14:07:28, a True time field set to 14:03:08, and the line it runs 4 min 21 s fast; photo times are moved back by that

Typing the true time of one photo is enough to work out the error.

The same map after the correction: the photo's marker sits on the green pin, and the status line reads Leica D-Lux 8 clock set 4 min 21 s fast, 10 positions moved

After the correction, every photo from that camera has moved by the same amount.

3. One camera is right and the other isn’t

Two cameras have two clocks, and they are never wrong by the same amount. A single offset for the whole folder fixes one and breaks the other.

In Lightroom and ExifTool, run the match once per camera: filter or sort by camera model, and give each batch its own offset. Media Location Tagger separates the cameras itself, by make, model and serial number, and gives each its own clock and its own row on the time strip. A correction to one never moves the other’s photos.

4. Right at the start, wrong later: the clock changed during the trip

If the first days match and the later ones are off by exactly an hour, somebody adjusted the camera at a border, or daylight saving began or ended and the camera, which doesn’t adjust itself, stayed where it was. If the later photos are off by some odd number of minutes, the clock was corrected by hand on the day someone noticed it was wrong.

Either way there are two periods with two different errors. In Lightroom and ExifTool, split the photos at the change and match each part with its own offset. In Media Location Tagger, select the first photo taken after the change, choose Insert Clock Change Before Selected Item in the Cameras tab, and set the clock again from a photo in the later part; only the photos from that point on move. When a daylight-saving change falls inside the trip, the camera’s card says so and asks whether the camera was adjusted.

5. Some photos won’t match: gaps in the recording

The logger started late, lost the sky in a gorge or a museum, or ran out of battery at four in the afternoon. Photos taken in those holes have no recorded position near them in time.

What the tools do with them differs, and matters:

  • ExifTool interpolates between two points up to 30 minutes apart, and takes the nearest point for photos up to 30 minutes outside the recording. Beyond that it leaves the photo untagged with a warning. Both limits can be changed (-api GeoMaxIntSecs=…, -api GeoMaxExtSecs=…).
  • Media Location Tagger uses the same 30-minute defaults, adjustable in the Matching tab, and shows the outcome per photo in the Match column: Interpolated, Nearest fix, In gap, Before track. Photos without a position are collected under Items Needing Review.

Resist widening the limits to make every photo match. A straight line across a two-hour hole puts photos in places you never were, and they look exactly as trustworthy as the real ones. Place the handful by hand: in Media Location Tagger, drop a pin, select the photos from the review list, right-click the pin and choose Apply Pin Location to Selected Items.

The time strip with a hole in the recording bar and the note 3 items in a 1 h 44 min gap; in the file list one photo reads In gap and two read Nearest fix with the distance in minutes

A recording with a hole of an hour and three quarters: one photo is “In gap”, and the two near its edges take the nearest recorded point and are marked for review.

6. The wrong track, the wrong day, overlapping recordings

  • Wrong day. Check the track’s date. A GPX file’s name often carries the export date, not the recording date; the first <time> in the file is the truth, and it is in UTC, so an evening walk in California is already the next day inside the file.
  • Wrong activity. An export of last week’s ride matches nothing, or, worse, matches photos to the same time of day on another route if the dates were ever ignored.
  • Overlapping recordings. A watch and a phone both recorded the afternoon, and they disagree by the width of a street. Pick one. In Media Location Tagger the track higher in the GPS Tracks list wins where two overlap; drag to reorder, or untick Use to leave a track out.

7. GPX route vs track: a route has no times

A GPX file can hold three different things, and they look alike on a map:

  • Waypoints (<wpt>): individual named places.
  • A route (<rte>): an ordered list of points to navigate to. A plan.
  • A track (<trk>): a list of points you actually were at, each normally with the time it was recorded. A history.

Photo matching needs a track with times. A route never has them. A track can lack them too: some services strip the times when you export somebody else’s activity or a “course”, and a track drawn in a planning tool never had any. To check, open the file in a text editor and look for <time> lines inside the <trkpt> entries.

If they’re missing:

  • Export again from the source, as a recorded activity and not as a course or route. This is the fix nine times out of ten.
  • Don’t add invented times in order to match photos. Tools that add timestamps to a GPX file spread them evenly along the line at a speed you choose. That is useful for uploading a route to a fitness service, and useless here: the photos would be placed where an imaginary walker at constant speed would have been.
  • Use the line as a guide. A route still shows where you went. Media Location Tagger draws it on the map and says that it can’t place photos by time; you place them with pins along it.

If the wrong positions are already in the files

If you tagged first and noticed afterwards, the files now carry coordinates that are wrong by the same error as the match.

  • ExifTool kept _original copies unless you passed -overwrite_original. Restore them with exiftool -restore_original /path/to/folder, or remove the positions with -gps:all=.
  • Lightroom: if you haven’t saved metadata to the files, the error is only in the catalogue; correct the offset and auto-tag again.
  • Media Location Tagger: correct the clock or the zone, and the affected photos are listed as needing an update; Update Track Positions rewrites them. GPS Tracks ▸ Revert Track Positions and ⌘Z put the files back as they were before the apply.

For coordinates that are wrong for other reasons, see fix the wrong location on photos.

Reading the clock is not rewriting it

Everything above tells the matching software how to read the camera’s clock. It does not change the capture time stored in your photos, with the one exception noted for Lightroom’s Edit Capture Time. A camera that was four minutes fast still says so in every file after a correct geotag.

Usually that’s fine: four minutes doesn’t disturb anything. A camera that was on the wrong zone or the wrong day is different, because the photos then sort wrongly next to the phone’s. That is a separate job, with its own guides: change the date a photo was taken for a wrong clock, fix time zone offsets across cameras for zones. Do the geotagging first or second, as you like, but tell the geotagging tool about the change if you correct the times in between.

Common pitfalls

  • Fixing a time zone problem with a clock offset. An offset of exactly one or two hours is a zone, or daylight saving. Treat it as one and the next trip with that camera works too.
  • Using a long stop as the reference. The track has one position for the whole lunch.
  • Checking only the first photo. Check one from the last day as well.
  • Widening the gap limits until everything matches. See section 5.
  • Getting the -geosync sign backwards. Camera fast, value negative.
  • Trusting the file name for the date. Open the file and read the first <time>.

FAQ

Why does Lightroom say there are no matching photos for my tracklog? The capture times, read in your Mac’s current time zone, fall outside the hours the track covers. Set the difference with Map ▸ Tracklog ▸ Set Time Zone Offset. If the dates don’t overlap at all, you have the wrong day’s track.

Why are my geotagged photos all in the wrong place by the same distance? The camera clock was fast or slow, so each photo was matched to where you were a few minutes earlier or later. Find the error from one photo you can place, and apply it to that camera.

How do I find out how wrong my camera’s clock was? From a photo that shows a clock, or from a photo taken at a spot you can identify on the track: the track’s time at that spot minus the photo’s time is the error.

What is the difference between a GPX route and a GPX track? A route is a plan: points to navigate to, without times. A track is a recording: points you were at, with the time of each. Only a track with times can place photos.

Can I add timestamps to a GPX route so that my photos match? You can, but the times would be invented, so the positions would be too. Export the recorded activity instead, or place the photos by hand along the route.

The GPS logger stopped halfway. What happens to the rest of the photos? They get no position from the track. Place them by hand; don’t stretch the matching limits to cover the hole.

Does correcting the clock for geotagging change my photos’ dates? Not in ExifTool or Media Location Tagger: the correction is only used for matching. Lightroom’s Edit Capture Time does change the capture time.

Do I have to set the time zone for every trip? For every trip where the camera’s zone differs from the one your software assumes. Media Location Tagger remembers each camera’s clock and offers it as a preset when that camera’s photos appear again.


Frank Reiff is the developer of Media Location Tagger, A Better Finder Attributes and A Better Finder Rename, Mac file-management utilities in continuous development since 1996. Get in touch with a track that still won’t match.