Major sections:

Saturday 30 April 2011

Jeffrey Friedl’s Geoencoding Plugin for Lightroom

If you're a Lightroom user and like to geotag your images, you've probably found yourself frustrated that there's no way to manage photos' location data natively within Lightroom.  The links to Google Maps that Lightroom provides from photos that have embedded GPS co-ordinates are nice, but you can't edit the data or do much else with them.

When I first started geoencoding a few years ago, the pick of the bunch of Mac apps that I tried was PhotoGPSEditor and that served me quite well, but it added a very slow and frustrating step to my workflow that got in the way of seeing my pictures in Lightroom quickly.  Geoencoding apps like this work by matching (or interpolating) your photos' timestamps against those in a GPS track log to determine the co-ordinates at which each photo was taken. Most standalone apps like PhotoGPSEditor then create new copies of your images with the co-ordinates baked into the new image's EXIF data.  When you're working with several hundred RAW images of 20MB+ each, reading and writing complete copies of each image takes ages.  To save some time I used to have PhotoGPSEditor read the source images from the CF card or external hard drive on which I'd brought the images home and write them to the Drobo where the images in my Lightroom catalogs live.  Unfortunately PhotoGPSEditor seemed prone to crashing if you gave it more than a few hundred images at a time, so importing the couple of thousand images I routinely accumulate on a trip was extremely tedious.  Anyway, you get the picture - enough moaning about how I used to do it!

Some time last year, while looking for something entirely unrelated, I stumbled upon Jeffrey Friedl’s Blog.  If you're a serious coder and you've ever had to wrangle regular expressions, then you'll probably recognise Jeffrey as the author of "Mastering Regular Expressions" (or "The Owl Book"as O'Reilly aficionados will know it).   Imagine my surprise when I discovered that someone whose work I knew and respected in a very different field was also the author of a wide range of Lightroom Plugins and, best of all, a brilliant geoencoding plugin!

Installation is pretty simple:

  • Download the zipped plugin from Jeffrey's site
  • Unzip and place the plugin file somewhere sensible. (I use ~/Pictures/Lightroom/Plugins/ where ~ is my Mac user folder)
  • In Lightroom, go to File > Plug-in Manager and click "Add".  Navigate to the folder where you put the plugin and click "Add Plug-in"
  • Once the plugin is installed, there's one more tweak I recommend before you leave the Plug-in Manager screen, and that's to click the "Configure Plug-in Extras menu items" button.  By default the plugin adds lots of ways to interact with your photos to Lightroom's Plug-in Extras menu, but quite a few of them aren't going to be relevant unless you happen to have taken pictures in particular parts of the world.  To reduce clutter, I'd suggest unticking any that you don't need:


All Jeffrey's Lightroom plugins are distributed as donationware.  In the case of geoencoding plugin that means you can use it forever without any cost if you really want to, but after six weeks you'll find that you're limited to working on batches of 10 photos at a time.  Given how useful the plugin is, I'm sure you'll find yourself wanting to donate well within the generous evaluation period.  The quantum of the donation is entirely up to you, so I suggest you use the plugin for a while to assess how much you're using it and how much time it saves you.  If the answers to those questions are "often" and "a lot", be sure to reflect that in the size of your donation.

Once you have the plugin installed, it's time to encode some images. Most of the time my geotagging data comes from a tracklog created by my trusty old Sony GPS-CS1, but let's start with a static example. First, select one or more pictures in Lightroom whose point of capture you know.  Now launch the plugin from File > Plug-in Extras > Geoencode....


In the Static Location tab of the plugin you have a number of options for entering the location.  You could enter it manually, cut and paste it from somewhere or use the great Google Earth integration provided by the plugin.  For maximum accuracy, start by clicking the "Show Crosshair Target in Google Earth" button which will add a temporary overlay in Google Earth.  Simply position your Google Earth viewport so that the centre target is at your desired position, then return to Lightroom and click the really cool "Import Location from Google Earth" button (which works fine for me in Google Earth 5.2.x despite Jeffrey's disclaimer in the dialog).  That pulls in the location from Google Earth, and does a reverse lookup to arrive at a description of the location too:

If it's a location you're likely to re-use (like home, where it's pretty pointless to fire up a GPS logger whenever you shoot) the you can save the location as a preset to easily call it up again in future.

Before you proceed, you'll probably also want to configure the map URL that gets added to the metadata.  You can choose your preferred map provider (Google, Yahoo, Bing in various languages), the style (map, satellite, hybrid, etc) and which extra layers to include (Wikipedia, Panaramio etc).  Disappointingly, though, you can't control the default zoom level of the map you link to.   I often find myself having to zoom in when I've clicked through.

The plugin maintains the geoencoding data as "shadow data" within Lightroom and doesn't write it back to original files by default, but I generally like to have the data in Lightroom's native GPS data fields too.  Unfortunately the plugin architecture means you have to take a slightly roundabout route to achieve that. As explained in the "Write Back" tab of the plugin dialog, you have to start by writing the geodata to the original files and then read it back into Lightroom.  I'd imagine that if you're using DNG files then that's a slow and painful process akin to the standalone encoding I used to endure, but since I keep my images in their original RAW format, we're only talking about writing & reading tiny XMP sidecar files, which is more than quick enough for me.  Note that if you have existing XMP sidecar files, but they're out of sync with changes you've made in Lightroom, you should manually sync them before you get the plugin to add geodata to them.  I always set my catalog preferences so that metadata changes are automatically written to the XMP files, so I don't risk losing them.  If you're confident that your sidecars are up to date and know that you want your geodata written to them, you'll probably want to tick the box on the "Write Back" tab to enable automatic writeback during the encoding process:


Right!  With all of that done, you're ready to return to the "Static Location" tab and click "Geoencode Images and Write Image Files".  If you want the geodata back in its native Lightroom fields, now's the time to invoke Lightroom's "Read Metdata from File" command as described in the picture of the dialog above.

If you're getting your GPS data from a tracklog, then it's just a case of pointing the plugin to the file, setting your timezone & camera clock offset if necessary, and deciding on the fuzziness to allow.  As long as your interval between tracklog points is smaller than the fuzziness value, pictures taken between two tracklog points at different locations will have their positions interpolated from the neighbouring tracklog points. If, however, your logger lost signal at some point and so there aren't any usable points within the fuzziness interval from the timestamp of a photo, the plugin will skip those photos and tell you  about them in its simple error log.

One of the features I really appreciate is that Jeffrey's plugin isn't limited to using GPX tracklog files.  If your logger produces output in any of the myriad formats understood by GPSBabel then you can have the plugin convert files on the fly for you so you never have to do any conversions.  My Sony logger produces NMEA-formatted files stored with a .log exenstion.  To tell the plugin how to deal with that, start by clicking on the "Config..." button on the "Tracklog" tab.  First, tell the plugin where to find the gpsbabel binary.  (If you're using a recent edition of GPSBabelFE on the Mac you'll need to drill down below the main package in your Applications folder to Contents/MacOS/gpsbabel.)  Once the plugin has tested your GPSBabel binary you can then tell it, for example, that .log files should be interpreted as NMEA files by passing GPSBabel the argument -i "nmea".

OK - that's it for now.  This has turned into a longer and more time-consuming post than I imagined.  I actually started out thinking I'd add a post about the seascape shoot I did with David & Shem on Monday, but then I realised I hadn't geoencoded those pictures yet and one thing led to another.  The seascape post will hopefully follow soon!  In the meantime, I hope this one proves useful for someone.  If it does, please leave feedback!






Read more ...

Sunday 24 April 2011

Fun with Chocolate Easter Bunnies

Our family's version of recurring Easter classic
After this morning's Easter egg hunt, the kids & I decided to make our own version of the classic picture that crops up every year.  TinEye currently finds 517 matches for the what passes as the original, but it's hard to tell where it originated.  I think our version is ever so slightly more kiddie-friendly.  Incidentally, TinEye says no one has reposted our version yet.  Come on - what are you waiting for!
Read more ...

The first post

Alright.  Enough procrastinating already. I've been threatening to start a blog since before the phrase was coined and never got around to it.  But, hey, it's only been 17 years since I built my first web site back in the postgrad lab of what was then UND - I doubt anyone's been holding their breath. So, what should you expect here?  I can't be sure of course, but I expect I'll be posting an eclectic mix of things that interest me, principally focused on tech, gadgets, photography and life in general. I hope some of it proves useful, even if only to me! :)
Read more ...