TheGeekery

The Usual Tech Ramblings

GPS Data, and Photography

Usually when I do any walking around with my camera, I usually carry my GPS device in my backpack. This allows me to track how far I walked, as well as marking where I took pictures. On a recent trip to the Dallas Zoo, I forgot to transfer my GPS data to my computer before I transferred my photos, and my images were not tagged with the geolocation data.

Part of my transfer process uses a program called Downloader Pro by BreezeSys. This program has the ability to look at GPX files1, match the time stamp, and tag the images while they are being transferred. Because I forgot to transfer the GPS information, this step was missed in the image transfer. Doing some looking around, I found several utilities that allowed me to tag the jpg files, but not the NEF RAW files. This would mean I’d have to tag them after I’d tweaked them.

That’s when I stumbled across exiftool. exiftool is written by Phil Harvey and is labelled as being a “platform independent perl library…for reading, writing and editing meta information in a wide variety of files”. One of the things I was looking for was for the tool being able to write to the XMP sidecar files to keep the main file untouched, exiftool tool handles that. It is also capable of reading gpx files, and geotagging files too. The other handy feature is the ability to shift the time matching, for example my camera clock was an hour off my GPS timestamps, meaning that a simple timestamp match would be impossible.

exiftool -k -o %f.xmp -xmp:geotag=c:\garmin\zoo_20101031.gpz -geosync=+3600 *.nef

The above is the command I ended up stringing together, and it breaks down like this:

  • -k = pause before closing
  • -o %f.xmp = Output files should be {original name}.xmp
  • -xmp:geotag=c:\garmin\zoo_20101031.gpz = This tells exiftool to geotag the xmp files using the zoo_20101031.gpz file as the source of the geo-location data
  • -geosync=+3600 = This tells exiftool to shift the creation time on the photos by 3600 seconds (1 hour).
  • *.nef = process all the NEF files in the directory

When it finished processing the directory, there were a collection of .xmp side car files, each containing the GPS information for the images. Opening one of the .xmp files in notepad, the data looked like this…

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.2-c004 1.136881, 2010/06/10-18:11:35">
 <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <rdf:description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/">
   <exif:gpslatitude>32,44.4245N</exif:gpslatitude>
   <exif:gpslongitude>96,48.9554W</exif:gpslongitude>
   <exif:gpstimestamp>17:38:14Z</exif:gpstimestamp>
  </rdf:description>
 </rdf:rdf>
</x:xmpmeta>

Now when the images are converted to JPG file (after doing my other processing), the information is carried forward. When you’ve done that, it allows programs to plot the images on maps. For example, Flickr allows you to play images on a map, like here, or Google allows you to create KMZ files with the images embedded too. Doing this allows you to also discover what other people have taken in the same area.

Do you guys geotag your photographs? What’s your favourite location to take pictures?

Edit: Fixed -geotag argument as Phil suggested, I typoed while copying it.

  1. Files that contain a GPS track log. 

Comments