I've been looking into geotagging my photos and finally got around to purchasing a GPS logger. Initially, I just wanted a script to automate the merging of the latitude and longitude from the GPS log into each image's EXIF information, after which, I'd just import the images into Aperture as normal. But then I found out that even more useful would be to reverse geocode the images. This would mean the the IPTC fields for city, state and country would be automatically populated, saving me from the task of manually entering each in Aperture.
Well, HoudahGeo does it better and more elegantly than any other software out there. After downloading a demo and reading Brett Gross' write-up on Aperture and houdahGeo I was sold.
The one glitch is that HoudahGeo saves both the city and the state into the IPTC city field, separated by a comma and a space, e.g., Great River, New York. I sent an email to the developers and was told that the next version, 1.5, would have this fix. Until then, I've whipped up an Automator workflow with a bit of bash scripting that calls exiftool that splits the IPTC metadata properly and will work with cities and states with any characters, including spaces, but not commas. Here's the guts to the Split IPTC City And State Automator Script:
# This automator workflow is licensed under the GPL, v2
for f in "$@"
do
CITYSTATE=`exiftool -City -s -s -s $f`
CITY=${CITYSTATE%,*}
STATE=${CITYSTATE#*, }
exiftool -overwrite_original -City="$CITY" -Province-State="$STATE" $f
done
So my workflow is now:
- Copy photos from memory card to temporary directory on my harddrive along with GPS log
- Use HoudahGeo to tag each image with longitude, latitude and altitude, along with the city/state and country
- Save the GPS log away in case I need it later
- Run the Automator script on the images to fix the city/state issue (installing it as a Finder plugin is recommended)
- Import the images into Aperture