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.

2007-05-17

Mac USB Parallel printer adapters

Now I am able to use my old HP LaserJet printer like a champ with Mac OS X - by using a low cost USB parallel printer adapter and a little bit of magic software.

USB to Parallel adapters are inexpensive little adapters (generally under $20) that allow you to connect a printer using the old "parallel" connector standard over USB. There are generally two kinds of parallel interfaces on a printer: Either the 36-pin Centronics-style connector, or the 25-pin D-shaped printer connector. My HP used the bulkier 36-pin connector, so I bought an adapter with that style connector.

The low-cost USB-to-Parallel adapter I use with my Mac

But it all wasn't as easy as it should have been - even though I pluged it all together, my USB to Parallel adapter would either lock up after a single print job, or it wouldn't be detected by the Mac at all. I suffered with the situation for months, and even imagined purchasing a more modern printer. But perseverance paid off - I got it all to work by installing a simple printing package.

My solution to this problem was to install USBTB. This alternative printer backend for Mac OS X now lets me use my "USB to Parallel" adapter reliably, and with zero fuss. [And USBTB has worked wonderfully under many OS versions: Tiger, Leopard, and Snow Leopard.]

USBTB detected my printer model right away. I just selected my
printer's driver
and within 30 seconds I was printing my thesis!

Those old Centronics connectors are no longer a reason to throw out an otherwise reliable workhorse printer. Owners of those solid older laser printers now have a reason to rejoice!

Update: 6-Feb-2010

Another great option is to use a low-cost Parallel to Ethernet "print server", as noted here.

Share