Geotagging Tools

These GPS scripts are not super user friendly and there may be better tools for this out there – but they do the job just fine for me and they might be useful for others so I’m making them freely available here. Remember always to back up your images before using these scripts. I will not be responsible for any data loss!

If you want to check out the results of these scripts I have a flickr set with all my geotagged images. All except a handful were tagged using my scripts. All the scripts are written in my favourite script language: Ruby. They should run on anything Ruby runs on but I have only tried them on Mac OS X.

The geotagging script requires the gps data in the gpx format. Your gps software may already support this. If not you can use gpsbabel for converting your track logs. It is a great tool that also does a lot of other useful things if you want to create maps from your gps logs etc.

The scripts require the following tools to work:

exiv2 – command line tool for reading/writing EXIF tags.

ExifTool – another command line tool similar to exiv2. Written in Perl.

The scripts started out by using the exiv2 tool but I later changed some them to use ExifTool instead because I thought it handled Canon CRW files better. That turned out not to be true – the problem was not the tool but the file format…

Scripts:

gpstag.rb – does the actual image tagging. It reads the timestamp from the image and after doing a time zone adjustment finds the closest point in your gps tracklog file. Optionally it also queries a server for city and country information (this can be a little slow). It writes EXIF GPS tags and the city/country information is written as IPTC tags.A Google-maps url is also written as an image comment. Can be quite handy on sites like Flickr that uses Yahoo maps which I find inferior to Google maps.

The script only handles files ending with jpg, crw or cr2 (Yes, I’m a Canon guy :) . So if you have a camera that generates files with other extensions you need to fix the script.

infograb.rb – grabs GPS info from images and stores the information in a single file. Can be used to retag images that have lost their tags (ex. because the got re-exported from a raw-converter).

googlemap.rb – script that extract GPS info from an image file and opens Google maps for the extracted location.

Download the scripts here: GPS Tools. (11-sep-2007)

Enjoy!

One Response to “Geotagging Tools”

  1. [...] I finally managed to clean up my geotagging tools! Read more and download them here [...]

Leave a Reply