main page - page initiale - hauptseite - página principal projects - projets - projekte - proyectos authors - auteurs - autoren - autores papers - exposés - berichte - papeles help - aide - hilfe - ayuda

carto:projects:photoTools:gpsPhoto.pl

gpsPhoto.pl

A commandline tool to synchronize a gps (gpx) tracklog with the date/time stamps of the image exif-data

Please note that gpsPhoto.pl is now a sourceforge project (gps2photo).

This tool can be used under the terms of the GPL license

About | Download | Required Perl Modules | Usage | Supported Image Formats | Software with GPX support | Software with IPTC/EXIF support | ExifTool Tricks | Links and Tutorials | Documentation in Other Languages | Credits | History | Authors/Feedback

The purpose of this tool is to allow a hiker to record a GPS tracklog or waypoints and later (at home) synchronize this GPS data with the timestamps of the image exif data of his digital camera, in order to locate and store the position where the picture was taken. The tool writes coordinates, altitude and additional metadata to the Exif and IPTC metadata section of jpeg, nef and potentially other file formats. Optionally, a Google Earth kml file is created containing the gps tracklog and the image positions.

The hiker can conveniently store the gps device in the pocket on top of his backpack. The GPS signal should be strong enough to penetrate the fabric of this material. To make sure that the signal gets properly recorded the hiker should check the device from time to time. The setup was tested with a Garmin eTrex vista device but it should work with any device that can export to the gpx (XML based) format. It is important that the gpx file contains the coordinates, and a timestamp. The hiker should check if the GPS clock and the camera clock are synchronized prior to the hike. A timeoffset is, however, allowed and can be considered during data processing at home.

A special advice for garmin users (tested with etrex version): you should not store the tracklog within the device under a separate filename (using the save option). The garmin device will filter the data (delete track points) and strip off the timestamps on saving the tracklog within the file. Just download the current (active) tracklog to the computer in order to preserve the data. The tracklog can then be cleared. The garmin track log setup also allows to set the time interval in which to record the data. The denser the data, the more accurate the matching can potentially be, but the sooner the storage capacity of your device will be used up. For shorter trips or devices with a larger storage capacity you can use a more dense interval.

Program download and prerequisites

As the program is written in perl it should run on any platform. You need however install the required perl modules from CPan. Windows users can use the ActiveState perl distribution and use the ppm (perl package manager) to install the modules. At a later stage we will provide a binary (.exe) version for the windows platform. Macintosh users can either use the provided perl version that comes with MacOSX or use ActiveStates MacOSX perl distribution.

Software Download

Required additional perl modules not included in the standard distribution:

ActivePerl users may install the perl modules using the "ppm" command. Start → ActivePerl → Perl Package Manager. Type "install module-name". See more information at the ActiveState ppm documentation page. Windows users who want to manually install the tool should have a look at Hans Loepfes instructions. Peter Rukavina provided a blog on some experience with open source GPS tools on MacOSX.

Program Usage

See manpage at sourceforge.

Currently supported image file formats

Potentially, one can add other formats as well, as long as they are supported by Image::ExifTool. If you want to add additional file formats add the extensions in the following line:

if ($ext =~ /^\.(jpg|jpeg|nef|cr2|crw)$/i) {

See also the list of supported File Types of ExifTool.

Extract from a sample gpx file

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="MapSource 6.8.0" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">

  <metadata>
    <link href="http://www.garmin.com">
      <text>Garmin International</text>
    </link>
    <time>2005-10-09T09:13:00Z</time>
    <bounds maxlat="47.420640" maxlon="9.062026" minlat="46.715949" minlon="7.977984"/>
  </metadata>

  <trk>
    <name>ACTIVE LOG</name>
    <trkseg>
      <trkpt lat="46.767876" lon="9.062026">
        <ele>487.525635</ele>
        <time>2005-09-04T18:35:04Z</time>
      </trkpt>
      <trkpt lat="46.767876" lon="9.062026">
        <ele>486.083740</ele>
        <time>2005-09-04T18:35:40Z</time>
      </trkpt>
      <trkpt lat="46.767876" lon="9.062026">
        <ele>487.525635</ele>
        <time>2005-09-04T18:37:42Z</time>
      </trkpt>
      <!-- .... -->
    </trkseg>
  </trk>
</gpx>

Software that is known to export to the gpx tracklog format:

Please tell us if you know additional software!

Software that is known to support reading and writing of IPTC and Exifdata:

Please note that EXIF tags are often read only. Please tell us if you know additional software!

ExifTool Tips and Tricks

See additional information at the exiftool Application Documentation.

Shift Date/Time in Exif data:
exiftool -AllDates+='5:10:2 10:48:0' -overwrite_original *.nef

This shifts all time stamps 5 years, 10 months, 2 days, 10 hours, 48 minutes and 0 seconds.

Manually set photo viewpoint coordinate and target point (GPS coordinates):
exiftool -GPSLatitude=43,22,1.41 -GPSLongitude=8,24,8.56 -GPSLatitudeRef=N -GPSLongitudeRef=W -GPSAltitude=5 -GPSAltitudeRef="Above Sea Level" -GPSMapDatum=WGS84 -GPSDestLatitude=43,22,2.84 -GPSDestLongitude=8,24,8.65 -GPSDestLongitudeRef=W -GPSDestLatitudeRef=N -overwrite_original yourimage.jpg
View all Image Metadata:
exiftool yourimage.jpg

Links and Tutorials

This section links to other pages, projects and tutorials using gpsPhoto:

Documentation in Other Languages

Credits

Version history

Authors and Feedback

Provided by Peter Sykora, Andreas Neumann and Dr. Uwe Girlich. Please let the authors know on the sourceforge mailinglist if you have proposals for corrections, useful features or documentation enhancements, report bugs or feature requests. If you have a cool project or article that makes use of gpsPhoto, please let us know, thanks!

About | Download | Required Perl Modules | Usage | Supported Image Formats | Software with GPX support | Software with IPTC/EXIF support | ExifTool Tricks | Links and Tutorials | Documentation in Other Languages | Credits | History | Authors/Feedback



Last modified: Monday, 14-Feb-2011 20:03:56 CET
© carto:net (andreas neumann & andré m. winter)
original URL for reference: http://www.carto.net/projects/photoTools/gpsPhoto/index.shtml
del.icio.us Add this page to del.icio.us