FreeFoote's Arbitrary Internet Home

FreeFoote

Home About FreeFoote Contact FreeFoote

Linux Projects

GPS Photo Correlator EXIF Utility Scripts Sound Scope LCDMenu MPG123 HTTP patch Remote Download Manager

Hardware Projects

Cut down keyboard mod Sprinkler Controller

Abandoned Projects

The CFW

About the CFW Background Images Next Version: CFW3 Current Version Download Email Lists Screenshots Source Code

The F3C

About the F3C Contribute Documentation Download

GPS Photo Correlation

What is it?

Digital cameras are cool. So is GPS. And, EXIF tags are really cool too.

What happens when you merge the three? You end up with a set of photos taken with a digital camera that are "stamped" with the location at which they were taken.

The EXIF standard defines a number of tags that are for use with GPS.

A variety of programs exist around the place to match GPS data with digital camera photos, but most of them are Windows or MacOS only. Which doesn't really suit me that much. Also, each one takes the GPS data in a different format.

So I wrote my own. A little bit of C, a little bit of C++, a shade of GTK+, and you end up with... what I have here. I wrote both a command line and GUI version of the program.

GPS Correlate Screenshot Thumbnail (45,123 Bytes)
Click on thumbnail for full size image

You will need...

  • GTK+ 2.0
  • libxml2
  • Exiv2 EXIF library (Note: this was only recently added to the Debian archive, so it is in unstable/testing, but not stable)
  • Linux for the GTK GUI version, or Linux for the command line version. (One day I will get around to making Windows binaries.)

Things you should know:

  • The program takes GPS data in GPX format. This is an XML format. I recommend using GPSBabel - it can convert from lots of formats to GPX, as well as download from several brands of popular GPS receivers.
  • The program can "interpolate" between points (linearly) to get better results. (That is, for GPS logs that are not one sample per second, like those I get off my Garmin eTrex GPS)
  • The resolution is down to one second. But that should be good enough for most things. (This is a limit of the EXIF tags format, as well as GPX)
  • For best results, you should synchronise your camera to the GPS time before you start taking photos. Note: digital cameras clocks drift quickly - even over a short period of time (say, a week).

Download

You can download it here (130,623 bytes). Alternately, read the documentation here.

If you are running debian unstable (sid) you can just apt-get install gpscorrelate gpscorrelate-gui to install it.

Please, try it out - tell me what you think!

GPSCorrelate 2

Due to many feature requests, have begun work on gpscorrelate2, which should offer many improvements over the original gpscorrelate. It will allow for extra features that can't really be effectively be hacked into the original gpscorrelate.

It's a work in progress, and moving pretty slowly. So please don't hold your breath, but it will happen.

The earliest possible alpha version can be downloaded here. The command line correlation will work to a degree, but many things are missing, and it has been very minimally tested. The GUI version currently does nothing. Patches or constructive criticism are naturally welcome.

Bug in versions prior to 1.5.2

Versions prior to 1.5.2 had a bug that affected date parsing. The matches were still correctly performed, but the GPSDateStamp and GPSTimeStamp tags were incorrect. 1.5.2 has a --fix-timestamps option that will fix this.

Release History

  • 21 November 2007: Re-release of 1.5.6, including patch from Marc Horowitz to fix negative timezone adjustments.
  • 19 November 2007: Re-release of 1.5.6, updating the version number to be correct.
  • 1 October 2007: Version 1.5.6: Incorporated patch from Marc Horowitz that allows gpscorrelate to correctly calculate negative timezone adjustments. Previously, the minutes were not subtracted from the timezone adjustment.
  • 20 August 2007: Version 1.5.5: Made altitude data in GPX files optional. This should have been the case since the beginning, but it seems it was not.
  • 22 June 2007: Version 1.5.4: Added Photo Offset time, as a fine adjustment between photo time and GPS time. Read the docs to understand it. GUI now has extra settings, and a "Strip GPS tags" button. GUI Now remembers settings on exit, into ~/.gpscorrelaterc. These are reloaded next time the GUI is started.
  • 20 June 2007: Version 1.5.3: GPS coordinates, including altitude, are not written as Rational values instead of Signed Rational values, this now meets the EXIF specifications. Default format for writing coordinates is now DD MM SS.SS. The old behaviour can be forced with the --degmins parameter. If altitude is negative, the correct sea level reference value is now written.
  • 6th June 2007: Version 1.5.2: Fixed bug where program would die with uncaught exception if input files were not JPEGs at all. Now the exception is caught. Fixed very silly bug where timestamps were incorrectly calculated: in struct tm, I didn't realise that tm_mon was 0-based, and didn't decrement it. This caused failures on dates spanning months with different numbers of days. Because the timestamps inside EXIF data and the timestamps from GPX data were converted the same way, the matching still worked. The date part is written as GPSDateStamp, which is wrong, and thus a --fix-datestamp option is provided. Turns out GPS Timestamp wasn't correct either. This time was out by the local timezone. This did not affect matches. --fix-timestamps will fix this as well. Added a --version option.
  • 3rd April 2007: Version 1.5.1: Included patch from Marc Horowitz (an MIT one) to correctly remove all GPS tags when using the "remove GPS tags" feature. It seems my original code missed two. The patch instead iterates over the tags and removes anything starting with "Exif.GPSInfo". Thanks!
  • 24 Feb 2007: Version 1.5: Fixed very silly bug where it would segfault on certain GPX files. Turns out those GPX files don't have time data on the trackpoints, and this is due to that track coming from certain parts of the GPS memory (where the timestamps get stripped to save space on the GPS device itself). This is something gpscorrelate should have handled.
  • 28 May 2006: Version 1.4: Added option to preserve mtime on input photos. Patch submitted by Russell Steicke. (http://adelie.cx/). Also added patch to make GPX read correctly in non-C locales - would interpret "." as thousands seperator in some locales.
  • 25 April 2006: Version 1.3: It would appear that the Exiv2 API changed somewhat. And gpscorrelate didn't work. Reported to me by a friendly chap. Now fixed to work correctly with the latest Exiv2 v0.9.1.
  • Not Released: Version 1.2: Added --machine/-o option. This outputs the tags from the passed files in a machine-readable CSV output.
  • 1 March 2005: Version 1.1: by default it now does not interpolate between GPX track segments (it ignored them before). You can still interpolate between track segments if you want. GPX track segments generally indicate where data was lost, or the unit was turned off - you don't really want matches when this is the case.
  • 24 Feburary 2005: Version 1.0: Initial working release.
  FreeFoote, aka Daniel Foote - freefoote [at] dview [dot] net