Visit Dennis M Wright's column >>

DENNIS M WRIGHTHome Page

Incertum ex Certis
Add To Watchlist
Articles Posted: 132; Links Seeded: 601
Member Since: 1/2006Last Seen: 2/09/2010

How to geotag your photos if you are a DSLR user

Venice, Japan

ATP stand-alone geologger

advertisement

There are masses of geotagged photos in cyberspace nowadays, by which I mean jpegs with location information (latitude, longitude) included in the embedded EXIF data. It's all thanks to the popularity of the iPhone with its camera, built-in GPS unit and ready connection to the Internet. Social networking sites and interaction with on-line map services such as Google Maps all help to fuel the fun.

The geotag bonanza is not limited to iPhone users. Modern Windows Mobile phones and other platforms all have the same capability, if not the surrounding hype. And we are starting to see GPS units incorporated into point and shoot cameras, for example the Nikon Coolpix P6000 which geotags pictures automatically before they ever leave the camera.

But what about DSLR users? When do we get in-camera GPS? And why would we want it?

I for one don't see it as a gimmick. For people who take a lot of photos on their travels it can be hard to keep track of exactly where you took every photo. It's not as if the Eiffel Tower will be in every shot. For example, I took the picture (top right) on a Far East cruise two years ago. I shot this from the deck of the ship as it was making its way from Nagasaki to Osaka, meandering around the Japanese islands.

I was fascinated and bemused by the unexpected sight of a mock-up of Venice. I'd love to know what it was all about and where this was. But I don't have the details of the route the ship took, so my chances of finding out are probably slim.

GPS-enabling DSLRs would be such an obviously useful thing, but as of today there are none. The closest we have come to it is Nikon's GP-1. This is a stand-alone GPS unit which attaches to the hot-shoe of the D90 D3, D300, and D700 cameras and adds automatic geotagging of photos. Nothing at all yet for Canon, Sony et al. So what to do?

Purpose-built geologging devices

Well there are dedicated devices for geologging, that is keeping a log of your geographical position by taking regular GPS readings and writing them to a file, along with a corresponding timestamp. The idea is you later use suitable software to match the photos to the location data, by reference to their respective timestamps, and the EXIF data updated to include the geotag. There are also fancy geologging devices which accept an SD card with your photos on it and add the geotags automatically. But such wonders do not come cheap. This one from ATP (see picture) is about $90 and is aimed more at point & shoot users. Many DSLRs require Compact Flash or (in case of Sony) Memory Stick rather than SD.

Windows Mobile phone used as geologging device

I wondered whether I could do the whole thing for free by using the GPS unit built into my Windows Mobile phone, instead of buying a dedicated geologger. My phone (HTC TyTN II) certainly includes GPS in the spec, but did not come with any satellite navigation software and I had never bothered with any, so the GPS unit had probably never even had juice through it. Still, maybe it had not totally atrophied from months of being ignored.

I hit upon a free application, GPSToday, which is essentially a clone of the Google map application for mobile phones. Crucially it has a geologging function. You can set it going and, as you walk around, every 30 seconds it writes your location to a file. You can change the frequency of readings or let it vary it "intelligently". I guess that means it takes more readings when you are moving about more.

This sounded desperately promising, so I installed it and got it working. It works perfectly, happily latches onto legions of satellites when you are out and about, and on request records your travels in a text file (I elected to call it geolog.txt) in the following format:

time,latitude,longitude,altitude (feet),speed (mph),heading
06-16-2009 17:14:48,34.361445,21.317156,440,0,0
06-16-2009 17:14:59,34.361486,21.317144,407,0,0
06-16-2009 17:15:10,34.361502,21.317144,404,0,0
...

That's the first snag. It's just a flat file, not in any recognised format for location data such as GPX or NMEA. How could I expect it to be recognised by any suitable photo geotagging software? GPSToday assure us that a future version will output in GPX format, but for now we're stuck with the existing non-standard format.

Getting the location data in a recognised format

Enter GPSBabel, a free software application that translates location information between a myriad of formats (including all the proprietary SATNAV manufacturer systems) and even "custom" formats such as the one used by GPSToday. Mind you, it is hardly straightforward. You have to use the "xcsv" mode and create a "style file" to tell GPSBabel how to interpret the non-standard location data.

This is how I did it. I created a folder on my C: drive called GPSBabel and in there put all the files downloaded from the GPSBabel site. I also copied the location data file geolog.txt from my phone to the GPSBabel folder. I then created a text file called GPSToday.txt, in the same folder, into which I inserted the folowing text:

# Format: GPStoday

DESCRIPTION GPStoday
EXTENSION txt

#
# FILE LAYOUT DEFINITIIONS:
# FIELD_DELIMITER COMMA
RECORD_DELIMITER NEWLINE

PROLOGUE time,latitude,longitude,altitude (feet),speed (mph),heading
IFIELD ISO_TIME,"","%s" # time
IFIELD LAT_DECIMAL, "", "%f" # Latitude
IFIELD LON_DECIMAL, "", "%f" # Longitude
IFIELD ALT_FEET,"","%.0f" # altitude
PATH_SPEED_MPH,"","%.1f" # speed
PATH_COURSE,"","%f" # heading

I saved it and changed the extension to .style so the file became GPSToday.style.

Now I should explain that I did not arrive at that style file at the first attempt. Most of it wasn't too bad but the time field setting was a nightmare. I tried just about all the options in the GPSBabel help system and none worked. GPSBabel could not understand the date/time data in the format output by GPSToday, no matter what I did.

In the end I decided to use the ISO_TIME option and run a script to rearrange the date/time information into a format that would be understood by GPSBabel in conjunction with the ISO_TIME setting. In practice, this meant writing a bit of Visual Basic code. For convenience I did this from Excel.

This is the code:

Sub FixTime()

Dim TextLine As String
Dim LineBuffer As String

Open "C:\GPSBabel\geolog.txt" For Input As #1
Open "C:\GPSBabel\geologISOTIME.txt" For Output As #2

Line Input #1, TextLine
Print #2, TextLine

Do While Not EOF(1)
Line Input #1, TextLine

LineBuffer = ""
LineBuffer = LineBuffer & Mid$(TextLine, 7, 4) & "-"
LineBuffer = LineBuffer & Mid$(TextLine, 1, 2) & "-"
LineBuffer = LineBuffer & Mid$(TextLine, 4, 2) & "T"
LineBuffer = LineBuffer & Mid$(TextLine, 12, 8) & "Z"
LineBuffer = LineBuffer & Mid$(TextLine, 20)

Print #2, LineBuffer

Loop

Close #1
Close #2

End Sub

On running this VB macro, a new file, geologISOTIME.txt is created in the same folder, with the same data as geolog.txt but with the date/time format changed so that it would be acceptable to GPSBabel.

You can then run GPSBabel, by double clicking the file GPSBabelGUI.exe. You have to point it at the input file, geologISOTIME.txt, and specify that it is in xcsv format and also specify the style file, GPSToday.style. Give the output file name as say geolog.gpx and specify the gpx output format. Then run the translation process to get your location data into a standards compliant format you can use with a photo geotagging program.

Applying the geotags

The final step is to feed both the gpx file and your photos to a program which can do the timestamp matching and write the geotags to the photo files. I picked a free open source program called GPicSync.

It is fairly self explanatory in use. If you managed to cope with the format conversions then running it will not be too taxing. It creates new versions of your photos, with the geotags written into the EXIF data, and saves the untouched originals in a backup folder. Job done.

Proving the geotagging has actually worked

As an independent check I downloaded Microsoft's Pro Photo Tools 2 suite, again free. If you open one of your geotagged photos in that application you can use the built-in map function to locate where the geotag is saying the picture was taken.

I did that and was amazed to find that my pictures were all correctly geotagged. Having done the hard work I now have a proven workflow for geotagging photos taken with my DSLR, and it did not cost me a penny.

Using the geotagging solution in practice

It's simply a matter of making sure you take your phone on your photo trips and the geologging function is in operation from before you take the first picture in a batch, and until after the last picture in the batch. You can keep starting and stopping the logging function. You don't have to change the logging file name, GPSToday just appends new time/location records without overwriting.

It is important to make sure the GPS is logged in to some satellites before starting shooting. Best to turn the GPS on in persistent mode (see GPSToday help) and just leave it on for the day. And check periodically it is still locked on. You don't want to be caught out by finding the GPS is off or not latched onto a healthy bunch of satellites as you are about to start taking pictures.

One important point: time zone. The workflow will only work if the timestamps on the photos and the phone are in sync. Make sure, particularly if you are travelling abroad, that the time settings on both camera and phone are in sync.

  • 6 Votes
  • Enjoy this article? Help vote it up the 'Vine.

Back To Top

Published to:

What's this?
Who's leading the conversation?
This visualization below allows you to see the impact that each user has on the current conversation. The top row contains the group of users who have had the most impact, the 2nd row the group of users who have had the 2nd most impact (et cetera). Users with similar impact are grouped together, and the average score of the group is shown to the left of the group. The author of the article is also shown on the left, in their corresponding group. Each user's score is based on the number of comments the user has made plus the number of votes their comments have received. The scores are calculated relative one another, so while their absolute value is not particularly important, their relative difference does indicate a larger difference in impact on the conversation.
9.2
3.9
{"commentId":7819127,"authorDomain":"denniswright"}

Also, if you are a Flickr user, there is a neat way to view your photos on Google Maps. After uploading your geotagged photos, use Flickr's "save to map" option for each one. They will then be included in your Flickr geoFeed.

From the foot of your Flickr photostream pagem right click the geoFeed link to get the feed location, then paste that into the Google Maps search bar. Click search and your photos appear as search result points in Google Maps.

{"commentId":7819127,"threadId":"611181","contentId":"2963579","authorDomain":"denniswright"}
  • 2 votes
Reply#1 - Wed Jun 24, 2009 10:03 AM EDT
{"commentId":7826059,"authorDomain":"tyler"}
Also, if you are a Flickr user, there is a neat way to view your photos on Google Maps. After uploading your geotagged photos, use Flickr's "save to map" option for each one.

Mind. Blown. Thanks Dennis M Wright, I really want to get better with my digital camera and the more carrots the better.

{"commentId":7826059,"threadId":"611181","contentId":"2963579","authorDomain":"tyler"}
  • 2 votes
#1.1 - Wed Jun 24, 2009 2:39 PM EDT
{"commentId":7826415,"authorDomain":"denniswright"}

You are most welcome.

;-)

{"commentId":7826415,"threadId":"611181","contentId":"2963579","authorDomain":"denniswright"}
  • 1 vote
#1.2 - Wed Jun 24, 2009 2:51 PM EDT
Reply
{"commentId":7822398,"authorDomain":"justinpm"}

Nice article, thanks Dennis. I've got a Digital Rebel right now, but I've been eyeing that D90 for a few months now. And the GP-1 makes it that much more handsome.

{"commentId":7822398,"threadId":"611181","contentId":"2963579","authorDomain":"justinpm"}
  • 2 votes
Reply#2 - Wed Jun 24, 2009 12:25 PM EDT
{"commentId":7822503,"authorDomain":"denniswright"}

Trouble with the GP-1 is that it occupies the hot-shoe so you can't be using it for anything else. Maybe not that much of an issue in practice.

Anyhow, I have my solution which works for free using my mobile phone. I imagine there are (or will be) similar solutions for the iPhone, Android, Symbian et al.

{"commentId":7822503,"threadId":"611181","contentId":"2963579","authorDomain":"denniswright"}
  • 2 votes
#2.1 - Wed Jun 24, 2009 12:28 PM EDT
{"commentId":7828864,"authorDomain":"justinpm"}

I was thinking that too until I found out that the GP-1 can also attach to the camera strap. But, get this, you need the GP1-CL1 in order to do this. I also looked on the App Store and found a Geologger, but there are tradeoffs. It needs to be the active application, can't go to sleep, and can't be locked. If the GP-1 were hotshoe only, it would've totally been a deal breaker, but with that strap adapter I've been considering it. Now if I didn't have this damn debt.

{"commentId":7828864,"threadId":"611181","contentId":"2963579","authorDomain":"justinpm"}
  • 1 vote
#2.2 - Wed Jun 24, 2009 3:50 PM EDT
Reply
{"commentId":7830727,"authorDomain":"greyson1"}

This article is one of the best I read so far about geotagging. It gives a good overview of the different possibilities, although the solution I use is not described :-)

Since a couple of weeks I'm using my iPhone 3G to geotag photos taken with my Nikon DSLR. I use an app called for that purpose. The app tracks my location while I take my photos and is a great help afterwards when I geotag my photos. Initially I was going to buy a dedicated GPS data logger device, but this solution is much cheaper ($5) and works perfect.

{"commentId":7830727,"threadId":"611181","contentId":"2963579","authorDomain":"greyson1"}
  • 3 votes
Reply#3 - Wed Jun 24, 2009 4:34 PM EDT
{"commentId":7832279,"authorDomain":"denniswright"}

I gave the equivalent Windows Mobile solution because at the moment I am using a WM phone. I am not at all surprised to find there is a corresponding (and by the sounds of it easier) solution using the iPhone.

I guess that's par for the course with Windows. It's been around for ages longer than Apple but harder to use and needs you to get your hands dirty.

{"commentId":7832279,"threadId":"611181","contentId":"2963579","authorDomain":"denniswright"}
  • 2 votes
#3.1 - Wed Jun 24, 2009 5:22 PM EDT
Reply
{"commentId":7830950,"authorDomain":"greyson1"}

Pfff, seems that I forgot to mention the apps name. It's called GeoLogTag and you can find more info about this app here:

{"commentId":7830950,"threadId":"611181","contentId":"2963579","authorDomain":"greyson1"}
  • 2 votes
Reply#4 - Wed Jun 24, 2009 4:40 PM EDT
{"canLink":false,"threadId":"611181","isPrivate":false}
Leave a Comment:
You're in Easy Mode. If you prefer, you can use XHTML Mode instead.
As a new user, you may notice a few temporary content restrictions. Click here for more info.
{"threadId":"611181","contentId":"2963579"}
Start TrackingStart Tracking
Stop TrackingStop Tracking