How to Geotag Photos
Geotagging – the process of assigning geographic location metadata (latitude and longitude coordinates) to a photographs – is becoming increasingly popular. These metadata can be read by various programs that are used to display images, and capable of using the data to display maps of where a photo was taken, or to locate other photographs from the same location.
My HTC Desire smart-phone has a built-in GSM unit. It runs the Android operating system. There are several free geotagging apps available for Android, but the best I've found is Geotagger by Federico Paolinelli. Here is a brief note about how to geotag photos with the help of this app.
Your Android smart-phone already have a built-in camera, but the Geotagger app is actually mainly for geotagging the photographs you take with your other camera. Geotagger just records the data and exports it to a suitable format. Binding those data to your photos is done on your PC.
For the record: My smart-phone is a HTC Desire and my PC is running Linux, so to able to reproduce what I describe here exactly, you probably need to be on those platforms. If you have experience with geotagging photographs using the Geotagger app on a different platform, please add tips for those that use this platform in the comment field below.
1. Geotagger Overview
Geotagger is very simple to use. After downloading it from Android Market, you can start using it without doing any configuration. But just for the record, I'll discuss the options available.
When you press the menu
- Positions: Display a list of recorded positions.
- Picture Ranges: Display a list of recorded picture ranges.
- Export to sd: Export recorded positions to SD card. File format is gpx or xml, depending upon Geotagger mode (see below).
- Clean all: Delete all recorded positions.
- Settings: Display configuration menu.
To configure Geotagger, press menu→settings.
The settings has three options. The first two: “Enable Gps” and “Enable Cell Location” do what you expect. They define the sources where Geotagger gets its location data, and you usually want to have both checked.
The third option is called “Geotagger Mode” and lets you select between two ways to geotag your pictures using Geotagger:
- Position and time: This mode records the position along with a time-stamp when you press the Add Position button. In this mode the app will produce a file named geotagger[time-stamp].gpx, in the standard gpx format.
- Ranges: This mode let you associate a range of picture numbers to a specific position. It lets you edit the picture range numbers to match the numbering system in your camera before you press the Store Picture Range With Position button. In this modem the app will produce a file named geotagger[time-stamp].xml. See below about using this file.
(The [time-stamp] part of the file name is replaced with an actual time-stamp.)
The Position and time-mode is the simplest to use. It mimics how most stand-alone geotagging devices works. It produces a standard gpx file (a tagged collection of all recorded positions and associated time-stamps) that almost any gpx binding program will understand. Here's an example of the content of the gpx file.
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <gpx> <wpt lat="59.9429" lon="10.7161"> <ele>0</ele> <name>Position-Wed Sep 29 20:09</name> <time>2010-09-29T20:09:40Z</time> </wpt> </gpx>
The Ranges mode let you associate a range of picture numbers with a single location. If you stay put at one specific location for some time, you just need to to record the location and the range of pictures you've snapped just before you leave. Here's an example of the content of the xml file.
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <ranges> <range from="9123" to="9126" latitude="59.9429" longitude="10.7161" altitude="0" /> </ranges>
As you can see, both are well-formed XML-files.
Before you start a photo shoot, make sure you synchronise the real time clock on your camera with the clock on your phone. Make also sure that you set both clocks to the same timezone. It is always nice to have your photos tagged with the correct time-stamp, and if you are going to use the Position and time mode, the time-stamp will be used to identify what images to tag with what location data set.
While most handheld GPS devices can be set up to automatically track your position (also called a way-point) every few seconds, Geotagger will only record a way-point when you tell it to. This is usually adequate, just remember to record your position whenever you take a picture. If you are travelling very fast, you should record your position just before and just after you've shot a picture, to be able to interpolate the position at the actual time the picture was taken.
Geotagger manages its own location data sources. As already noted, you control those under menu→settings. This means that you do not have to enable the use of GPS satellites under Location in the phone's main settings menu to be able to use GPS satellites. However, doing so may speed up the process of getting satellite data, at the expense of battery life.
When recording location data, you need to pay attention to a line labelled Gps Status near the top of the screen. If it is red, location data is not available, and it will not be possible to add a position. I've found that my HTC Desire seems to be sensitive to position. If my body is between the GPS satelite and the phone, location data is unavailable. Turning around 180° is all that is needed to make Gps Status turn green.
When the Gps Status turns green, you can record the position by tapping Add Position or Store Picture Range With Position (depending upon Geotagger Mode). The latter also let you set the “From” and “To” range to match the picture number on your camera.
3. Transfer Files
When returning for a photo shoot with location data for the pictures taken recorded by Geotagger, you need to transfer both the images and the location data to a PC in order to merge them.
You transfer the images by whatever means you normally use for this.
To transfer the location data, you first need to export them to a file. You do this in Geotagger by selecting menu→Export to sd. The output file is named geotagger[time-stamp].gpx or geotagger[time-stamp].xml and it is stored on the phone's SD-card. For some reason, exporting to SD fails if the phone is connected to the PC, so do this before you connect the phone to the PC.
The next step is to transfer the files from the SD-card to the PC. You do this by connecting the phone to the PC by means of an USB cable, and tapping mount as Disk drive and Done. The phone's SD-card will now appear as a removable disk on your computer, and you can use drag & drop to transfer the Geotagger file to your PC.
If you use Geotagger in the Position and time mode, there exists a lot of programs to bind a gpx file to picture files.
The author of Geotagger uses the free GPSPhotolinker for Mac OS X, so I assume that will work.
The program I use to bind the position and time data in the gpx file to photographs is the free ExifTool by Phil Harvey. This powerful Perl library and stand alone-application runs on most platforms, including Linux, MS Windows and Mac OS X. I use it on Red Hat Linux.
If my location data is on a file named geotagger20100929-2025.gpx, the following example show how to use exiftool to bind all locations in this file to all 46 jpg images in the current directory:
$ exiftool -geotag=geotagger20100929-2025.gpx *.jpg 46 image files updated
ExifTool will bind an image to the location with the closest match between the EXIF time-stamp (DateTimeOriginal) and the gpx time-stamp. If there is no exact mach, ExifTool will look for time-stamps 30 minutes before and later, and if there are way-points recorded both before and after the EXIF time-stamp, ExifTool will use linear interpolation between these way-points to determine the GPS position at the time of the image.
If there is no exact match between the image time-stamp, and the time-stamp embedded in the gpx file, ExifTool will sets the value of EXIF-tag GPSTimeStamp to show the time of DateTimeOriginal (i.e. not the time-stamp embedded in the gpx file).
If ExifTool don't find any gpx timestamps to bind to the file, it will give notification through an error message.
For a more detailed description of exiftool and all the possible options, see: Geotagging with ExifTool.
If, instead of the Position and time mode you want to use the Ranges mode, you need a program that understands this format. The author of the Geotagger Android app has created a Geotagger desktop program (in python) that understands this file format. To get this program, you need to download the Geotagger source files. This python program does not run on my computer. It seems to depend on an specific run-time environment, but how to set this up this environment is not documented.
5. Making Use of GPS Tags
After binding the GPS data to an image, they show up like this in the EXIF (as displayed by ExifTool). They also show up as expected in Adobe Bridge.
GPSVersionID : 188.8.131.52 GPSLatitudeRef : North GPSLongitudeRef : East GPSTimeStamp : 09:33:54 GPSDateStamp : 2010:07:01 GPSDateTime : 2010:07:01 09:33:54Z GPSLatitude : 59 deg 56' 34.44" N GPSLongitude : 10 deg 42' 57.96" E GPSPosition : 59 deg 56' 34.44" N, 10 deg 42' 57.96" E
Note that for privacy reasons, many photo sharing sites do not make use of GPS location data by default. Here is how to enable the use of GPS location data on some popular photo sharing sites:
- Flickr: Go to your Privacy & Permissions settings and enable: Import EXIF location data. If you have already uploaded photos with this option turned off, you have to upload them again. Flickr will not update existing photos in your account with EXIF location data.
- iPhoto: Go to Preferences → Web and enable: Include location information for published photos.
- Picasa: Go to Settings → Privacy and Permissions → Locations and check both boxes.