2007-05-27

Putting photos on a map using GPS

I was planning to go on vacation to Yosemite, and I got it in my head that I'd like to be able to build a map of where my photos were taken. It turns out to be shockingly easy.

Hardware Required
  • A digital camera. I have a Canon SD400. Almost any digital camera will do.
  • A handheld GPS. I have a Garmin eTrex Vista Cx, but almost any GPS with data export capabilities will suffice.
Figure 1: GPS data plus Digital Photos can produce JPEG photos with location data and KML files for Google Maps or Google Earth.

From the camera's vantage point: Photos with EXIF data

A digital camera often stores the date and time within the photo. The camera also stores tons of other chunks of data within the photo: the camera model, shutter speed, zoom settings, and numerous other parameters. This data is stored inside the JPEG file using a standard called EXIF, and just about every modern digital camera supports this format.

From the GPS angle: Track points

While your GPS is on, it is collecting data about where you are. Every few seconds your GPS notes its latitude, longitude, and altitude, and stores this data within memory along with the current time and perhaps some other data. Each position/time stamp record is called a "track point", and the collection of all track points is called the "track log".

Your GPS's track log can hold a finite number of track points. My Vista Cx can store us to 10,000 track points within its track log. Some GPS units record a point every 1 second, while other GPS units record a point every time you've moved away from your current location. Sometimes the GPS uses a hybrid strategy.

Using a computer, it is possible to pull the track data off of the GPS and store it in a file.

The Merge

The way to building Geolocated photos is to merge GPS track points with a photo's EXIF timestamp. If your photo is dated "January 15th, 2007 at 09:30 AM", all you have to do is look up that time within your track log to find out exactly where the picture was taken.

You can then modify the photo's EXIF data to including latitude/longitude data.

Figure 2: EXIF data, augmented with position data.

Doing this once by hand sounds fun, but it could become tedious if you had dozens (or hundreds) of photos. And so therefore, software has been created that easily does this match/merge process for you. This software will modify the EXIF data for all your photos, given a collection of GPX files.

Using geodata

OK, so now you have a wonderful collection of data: Photos with location data, and tracklogs of where you've been. How can you use it?

Some software
I used GPSBabel to extract the track data from my Garmin Vista Cx GPS into the standards GPX data format.

I used GPSPhotoLinker to merge the track data into my photos. The program loads track logs and photos, and then updates the EXIF data in the photos with the location data plucked out of the track log. It took about 20 minutes to process about 400 photos.

I discovered that JetPhoto Studio can be used to create KML and KMZ files from my collection of photos. JetPhoto Studio also appears to be able to merge GPX files with photos, but I haven't tried that feature yet.

I used Google Earth to view my GPX, KML, and KMZ files.

I also used Google Maps to allow others to easily view my GPX, KML, and KMZ files over the web.

No comments:


Share