Thoughts of a geek

4 October 2014

Geotagging photos with Google Location History

Filed under: Computers — Tags: , , , — qwandor @ 12:14 pm

When I take photos on my Nexus 5, it automatically geotags them, which is great. However, when I am on holiday, I often use a proper camera with a bigger sensor and lens as it can produce better results. The disadvantage of this is that it does not have a GPS so cannot geotag the photos I take. Fortunately, I have Google Location History enabled on my phone, which records my location periodically. I use digiKam to manage my photos, which has a feature to correlate photos with a GPS track by timestamp. Here is how I use this to geotag my photos:

  1. Enable location reporting and location history on phone. In Android this is under Settings→Location→Google Location Reporting.
  2. Ensure camera clock is correct.
  3. Take photos.
  4. Go to the Google Location history web interface, select the relevant days, and click Export to KML.
  5. Convert the KML file to GPX with this GPS Visualizer tool. Unfortunately the converter has a bug: the KML file has a timezone of UTC-7:00 for all timestamps, but the converter ignores this and treats them all as UTC. We will have to compensate for this in the next step…
  6. Select the relevant photos in digiKam, and click Image→Geo-location from the menu. Load the GPX file you downloaded in the previous step. To compensate for the bug mentioned above, you will need to set the camera time zone option to 7 hours ahead of the actual timezone your camera was set to. So if you were taking photos in UTC+2:00, then set it to UTC+9:00.
  7. Click Correlate. Check that your photo geo-locations look correct. If they look wrong, ensure that you got the timezone right. If they look right but some are missing, try enabling the Interpolate option.
  8. Apply and Close. Done!
Advertisements

Blog at WordPress.com.