Skip to content

Instantly share code, notes, and snippets.

@reedriley
Created July 22, 2013 03:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reedriley/6051055 to your computer and use it in GitHub Desktop.
Save reedriley/6051055 to your computer and use it in GitHub Desktop.
Modified gpx.fmt file capable of reading geotags for iPhone photographs. Can be used as follows: exiftool -r -if '$gpslatitude' -fileOrder datetimeoriginal -d %Y-%m-%dT%H:%M:%SZ -p gpx.fmt folder > out.gpx
#------------------------------------------------------------------------------
# File: gpx.fmt
#
# Description: Example ExifTool print format file for generating GPX track log
#
# Usage: exiftool -p gpx.fmt -d %Y-%m-%dT%H:%M:%SZ FILE [...] > out.gpx
#
# Revisions: 2010/02/05 - P. Harvey created
#
# Notes: 1) All input files must contain GPSLatitude and GPSLongitude.
# 2) The -fileOrder option may be used to control the order of the
# generated track points.
#------------------------------------------------------------------------------
#[HEAD]<?xml version="1.0" encoding="utf-8"?>
#[HEAD]<gpx version="1.0"
#[HEAD] creator="ExifTool $ExifToolVersion"
#[HEAD] xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
#[HEAD] xmlns="http://www.topografix.com/GPX/1/0"
#[HEAD] xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
#[HEAD]<trk>
#[HEAD]<number>1</number>
#[HEAD]<trkseg>
#[BODY]<trkpt lat="$gpslatitude#" lon="$gpslongitude#">
#[BODY] <ele>$gpsaltitude#</ele>
#[BODY] <time>$datetimeoriginal</time>
#[BODY]</trkpt>
#[TAIL]</trkseg>
#[TAIL]</trk>
#[TAIL]</gpx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment