How to automatically/automagically geotag your photos (using Open Source stuffs) — Updated a bit

A while ago I asked some dudes on Zooomr if they had any recommendations for magical geotagging photos taken on your camera, and the responses were useful but not quite what I was expecting.

Somewhat naively I had assumed that a solution for automatically tagging photos as you took them already existed, but it doesn’t (as far as I can tell). That is to say there is no device that you can attach to your camera which tags your photos as you take them.

All of the solutions I have seen will record the GPS location as you take them around and then use software to line up the time stamps of your photos with the time stamps taken at regular intervals by the GPS device.

This might sound slightly annoying, but acceptable. Except if you’re me and you only have OSX and Linux based computers (i.e. the software isn’t going to work). Another problem with this is that these devices cost around £70 ($140) which seems an awful lot for something that doesn’t really do anything too special.

So, what’s the solution? Well I’m glad you asked :)

In my opinion the best solution to this problem is to use the following ‘tool-chain’:

Camera >> Images on Computer >> GPS Track from GPS device >> Small amount of code to ‘munge’ GPS locations into images using timestamps >> Upload!!

So there are probably three variables in this, which I’ll go through in sequence:

  1. GPS device
    This is the actual hardware device that records where you are. What you really need is a GPS device that will record a ‘track’ this is basically a list of GPS locations recorded either at time based or distance based intervals. Pretty much all GPS devices do this by default (i.e. you turn them on and they start doing it automatically), except the in-car GPS as where you have been is not important to them. Also you need to make sure it’s got some kind of data cable attachment so you get the data back out :)

    I personally have a Garmin eTrex Venture Hc. This little baby costs about £120 ($240), it’s a bit more than the base models but is also perfect for all the walking that I do and has an exciting colour screen :)

    The main benefit of the Venture range is that the receiving module is hyper sensitive, which means that it can get a signal when it’s in my camera bag :D. Cheaper models are available (i.e. Garmin Geko) and they just have smaller LCD screens but perform the basic track task just as well.

    Also the Garmin modules are supported by GPSBabel which is what we need to talk about next.

  2. GPS importing software
    [GPSBabel GPSBabel GPSBabel]. That’s pretty much all you need to know. Or on OSX you can use [LoadMyTracks].

    What these bits of code do is import your track and save it as an GPX file (which is just an XML file that conforms to the GPX schema).

  3. ‘Munge-ing’ software
    I got 90% of the way to writing this by using Perl ExifTool (like Zooomr does) and Perl GPX before I noticed that some clever SOB had already done it – introducing [gpsPhoto] [gps2Photo]!!

    What this little badger does is take your photos timestamps, match them with the timestamps of the locations in your GPS track and insert GPS EXIF data accordingly aka geotag them.

PHEW! I _know_ it sounds complex, but I promise it really isn’t, importing tracks is easy, running gps2Photo is easy. The only bits you need to remember is to turn on your GPS device when you’re out shooting and to roughly sync the time on your camera with the time on the GPS unit!!