Sunday, August 20, 2006

Georeferencing photos on a Mac

Not long ago I managed to georeference some of my photos using GPS measurements. Before I forget how I did this, here are some notes on the process. The key piece of software is GPSPhotoLinker, written by Jeffrey Early. After downloading and installing this nice little program, the next step is to get the GPS tracks from the GPS unit. For some reason, GPSPhotoLinker did not do this for me; so I downloaded GPSBabel, connected my Garmin Vista Cx to the iMac, and saved the tracks in GPX format. [GPSBabel is the same utility that is used inside GPSPhotoLinker]. I tried to open the GPX file in GPSPhotoLinker, but it did not work. The problem was that some of the tracks on the GPS unit were actually saved -- and saving tracks on a Garmin GPS unit (and maybe on other units as well, I don't know) results in losing the time stamp from each datapoint. GPSPhotoLinker apparently is not able to just ignore this part of the GPX file; the only solution was that I manually deleted all the saved tracks from the GPX file. After that, everything went pretty smoothly. GPSPhotoLinker finds the GPS points that are the closest in time to the time stamp of the photograph and writes the latitude and longitude into the EXIF header of the jpeg file. You can choose between 'snapping' photo locations to the nearest GPS datapoint or to interpolate between two points to find the best estimate for the place where the photo was taken. It is important, of course, to record a fairly large number of GPS points when you are taking the pictures.

Once I had the photos tagged with the geographic coordinates, I had two options to display them in the context of a map: either relying on Smugmug, the photo-hosting web service that I use, or on a cool iPhoto plugin called iPhotoToGoogleEarth. With Smugmug, both Google Maps and Google Earth can be used to look at the photos; the drawback is that the displayed pictures are small and you have to go go back to the Smugmug page to see the photos in a reasonable size. The iPhoto plugin generates a kmz file that can be opened with Google Earth and includes all the photos in a reasonable size, that, of course, can be adjusted by the user). The advantage is that you do not have to leave Google Earth in order to look at the photos.

Here is my first try at doing the gereferencing, as shown by Smugmug in Google Maps. It is not a bad idea after all to have a GPS unit handy when you are traveling and taking photos.

PS. In addition to the saved tracks, the other thing that GPSPhotoLinker does not like in the GPX file is the part of the header that refers to the geographic bounds of the file, e.g., "bounds minlat="-51.725563835" minlon ="-98.491744157" maxlat="43.777740654" maxlon="131.500083692"". You have to delete that in order for GPSPhotoLinker to read the file.

PS 2. There is always more to learn. I thought that the ideal workflow for georeferencing photos would be to (1) do the tagging in GPSPhotoLinker, (2) import the photos to iPhoto, (3) export the ones I want to post on the web, and (4) put them on Smugmug. It turns out this does not work well; all the photos I took in California (and were correctly labeled by GPSPhotolinker) ended up in Kamchatka. The point is that the georeferencing must be done (or redone) after the photos are exported from iPhoto.
 
Copyright 2009 Hindered Settling. Powered by Blogger Blogger Templates create by Deluxe Templates. Sponsored by: Website Templates | Premium Themes. Distributed by: blog template