Pixel 6a Stores the Wrong GPS in Images: an Analysis (Shallow Thoughts)

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Mon, 20 Nov 2023

Pixel 6a Stores the Wrong GPS in Images: an Analysis

[Map of GPS from Pixel 6a photos compared with actual positions]

I've been relying more on my phone for photos I take while hiking, rather than carry a separate camera. The Pixel 6a takes reasonably good photos, if you can put up with the wildly excessive processing Google's camera app does whether you want it or not.

That opens the possibility of GPS tagging photos, so I'd have a good record of where on the trail each photo was taken.

But as it turns out: no. It seems the GPS coordinates the Pixel's camera app records in photos is always wrong, by a significant amount. And, weirdly, this doesn't seem to be something anyone's talking about on the web ... or am I just using the wrong search terms?

And before you ask: yes, the phone's GPS was enabled and locked on for all these photos. Although I keep my GPS off by default, for power saving and privacy reasons, I always turn it on during hikes so I can record a track log.

The GPS in my track logs is spot on. If you plot both the track log and the photo GPS on the same map, as in the screenshot here, you see the GPS from the photos isn't anywhere near the track log I recorded, nor (in most cases) is it anywhere near a trail.

I've been meaning to analyze the problem in more detail, and finally found some time.

(Aside: today's 30 Day Map Challenge topic is "Outdoors", and since this concerns coordinates on hikes, let's call it an entry.)

Analyzing the Data

First I needed some data. I flipped through recent photos and picked a handful of shots where I can pin down exactly where I was standing. I recorded the GPS coordinates in each photo, using jhead photo.jpg | grep 'GPS L' (after confirming that jhead and exiftool both report the same coordinates). Then I determined the actual coordinates for that photo by right-clicking in PyTopo. (Yes, I double-checked with several other apps to make sure I wasn't being thrown off by a bug in PyTopo's coordinate handling.) I included some photos from local hikes, plus a few from a recent trip.

Then I wrote a Python script to analyze the points and plot them on a Folium map as well as printing out the distance and bearing differences. I wondered if I would see some sort of consistency, like "they're all .5 miles to the northeast" or something.

You can see the script here: pixel_photo_comparison.py.

Inconclusive Results

[Map of GPS from Pixel 6a photos compared with actual positions]

Alas, I saw no such consistency. In nine samples, the distances between where I was actually standing and where the Pixel says the photo was taken ranged from 0.14 miles to 0.87 miles, and the bearings seemed completely random. On the map here (click on it to see a larger version), blue circles indicate actual positions, while red squares are coordinates from the photo.

[a late tarantula at Bandelier] One question that flummoxed me for a while was from some tarantula photos I took near the Bandelier Visitor Center (the southernmost blue point on the map above, near the pale blue house icon indicating the Visitor Center). The blue dot indicates where I was actually standing while taking photos; but where is its associated red square for the photo's GPS?

It took a while to figure that out: for all the tarantula photos I shot that day, the Pixel saved GPS coordinates that were exactly the same as the (also wrong) GPS it saved for Tyuyoni Overlook, the blue circle/red square pair just a little to the northwest. That made me briefly wonder whether the camera was just caching old coordinates and not updating them; but the Tyuyoni hike was on June 5 while the Frijoles Canyon hike when we saw the tarantula was October 25, and there were many, many hikes and photos between those two. So it must just be a coincidence.

Here's the list of the points I've compared so far, sorted by distance, along with the bearing (direction) from the real point to where the photo's GPS claims it was:

Above Clayton Lake Dinosaur Trackway: 0.135 miles to the WSW (236°)
Tyuyoni Overlook: 0.160 miles to the SW (227°)
Tarantula near Bandelier Visitor Center: 0.501 miles to the NW (307°)
Trail down to Capulin Volcano crater vent: 0.540 miles to the SSE (167°)
Raton Goat Hill: 0.634 miles to the ESE (111°)
Frijoles upper crossing: 0.767 miles to the ENE (66°)
Kimberly Overlook: 0.790 miles to the SSE (148°)
Foot of Potrero Falls: 0.798 miles to the NE (52°)
Stable Mesa top of death climb: 0.869 miles to the WSW (244°)

So this analysis hasn't solved anything. There's no consistency to how far off the Pixel's hallucinated coordinates will be, or in which direction.

Even weirder, I downloaded a couple of other highly rated photo apps, and found that they also store bogus GPS coordinates. Maybe that means that all photo apps call the same Android API to save GPS coordinates? (I wish I could use one of the other apps anyway, to get around that excessive processing Google's app does; but none of the other apps can access the Pixel's three lenses, only the default lens, so they're not a substitute for the built-in camera app.)

It's a shame. GPS tagging of photos sounds like it would be quite a useful feature, especially while hiking. I wish the Pixel could actually do that, instead of making up random coordinates.

Tags: , , , , , , ,
[ 19:09 Nov 20, 2023    More mapping | permalink to this entry | ]

Comments via Disqus:

blog comments powered by Disqus