One of the really great things about storing photographs digitally is the ability to embed all sorts of information about the image in “metadata” within the file. When I shot film, I carried a notebook around with me that I tried to record exposure settings in (I was usually too lazy); I wanted to be able to learn from experience by looking at the settings I used to take a particular image. Digital cameras have trivialised this process, as they embed the exposure settings within each photograph.
But digital metadata is able to store much more than just the camera settings. In particular, it is becomming increasingly common to store location information (collected automatically by GPS). This is not so much to remind the photographer where they took the photo (most of us are pretty good at remembering that with reasonable precision), but it allows entirely new methods of displaying and browsing sets of photos.
Over the last few months I have experimented with various data acquisition and image display techniques for geo-tagging. This is a growing field, and so I’m sure there’s a lot more for me to learn. However, here are my findings and a quick demonstration of the results.
Some newer cameras connect directly to GPS devices (or have them built in!) so that the geographic position information is saved directly to each image as it is recorded. I do not have this luxury.
Instead, I collect the GPS information separately. If I carry my little Garmin Geko 201 GPS receiver with me, I can know my geographic coordinates when I take a photo. Also, it can record my trail (as I’ve done on previously for certain trips) in a tracklog which can be uploaded to my computer.
The simplest case is when I know the geographic coordinates that a photo was taken from. I could write down the coordinates from the GPS, or simply take a photo of its display. To embed these coordinates in a photo once its on my computer, I have found the geoexif script from here to work well. For example, I run
./geoexif.py --latitude -35.6279 --longitude 150.3213 *.jpg
to tag all the jpg files in that directory with a certain latitude and longitude.
This works well if a lot of photos were taken from the same point, but there is an even easier way!
GPS tracklogs are simply a list of positions with a timestamp. Digital cameras also record (within each image) the time that a photo was taken. Conceptually, it is straightforward to find the time an image was taken, then search along the points in the GPS tracklog for that time and find the position information.
Many software tools exist to perform this interpolation task, but I have found gpsPhoto.pl from here to work really well. For a GPS tracklog on my computer in gpx format, I run
~/scripts/gpsPhoto.pl --gpsfile <filename>.gpx --overwrite-geotagged --timeoffset -39600 --maxtimediff 7200 --dir ./
to tag all jpg files in the current directory. This even embeds altitude data!
The “timeoffset” option gives my timezone (I’m in GMT+11 so the gps is 11 hours behind the jpg timestamps, converted to seconds). The “maxtimediff” here is 2 hours, and this option means that if I set up camp and turned my GPS receiver off but still took photos for 2 hours they would get approximately correct geotags.
Geo-display and Geo-browsing
Flickr, the popular photo sharing site, has a very good “Map display” for browsing geotagged images. Even better, with jpg files geotagged in the metadata as I’ve described, Flickr can automatically import the geo-information when you upload photos.
The really fun bit is browsing other people’s photos from similar locations to your own, to see what they noticed. Here is an example of exploring my Flickr Map – and you’ll notice that in Canberra Flickr uses OpenStreetMap!
The Flickr map is heaps of fun for browsing your own and other people’s photos geographically, but I wanted to find a good way to embed a map-browsable photo album here in my own website. Here is a demonstration of the idea from this article (I had to use gpsVisualiser to convert the gpx to a kmz file). The images and tracklog are from a daywalk up to Blue Lake that I did during the SNSW Big Camp at Jindabyne a few weeks ago.