title: Interpreting GPS info of exif data from photo in python
body: <p>I am writing a small program to get the GPS info of a iphone jpg photo.</p>
  
  <p>The library I am using is the PIL in python. Now I am able to get the GPSInfo, which is something like:</p>
  
  <pre><code>{1: 'N', 
   2: ((1, 1), (20, 1), (5365, 100)), 
   3: 'E', 
   4: ((103, 1), (41, 1), (1052, 100)), 
   5: 0, 
   6: (43, 1), 
   7: ((15, 1), (32, 1), (7, 1)), 
   16: 'T', 
   17: (77473, 452), 
   29: '2013:10:25'}
  </code></pre>
  
  <p>How can I interpret this? And I notice the tag is not continuous, so is there any cheating sheet which I can refer to in order to get a better understanding of all the number tags and what they mean? Thank you!</p>
  
  <p><strong>UPDATES</strong></p>
  
  <p>Sorry, I have figured it out. In the PIL lib, there is a GPSTAGS.get() function which can help me decode the key in gps info. Thank you guys!</p>
  
  <pre><code>gpsinfo = {}
  for key in exif['GPSInfo'].keys():
      decode = ExifTags.GPSTAGS.get(key,key)
      gpsinfo[decode] = exif['GPSInfo'][key]
  print gpsinfo
  </code></pre>
  
  <p>and here is the result</p>
  
  <pre><code>{'GPSTimeStamp': ((15, 1), (32, 1), (7, 1)), 
   'GPSImgDirectionRef': 'T', 
   'GPSImgDirection': (77473, 452), 
   'GPSLongitude': ((103, 1), (41, 1), (1052, 100)), 
   'GPSLatitudeRef': 'N', 29: '2013:10:25', 
   'GPSAltitude': (43, 1), 
   'GPSLatitude': ((1, 1), (20, 1), (5365, 100)), 
   'GPSLongitudeRef': 'E', 
   'GPSAltitudeRef': 0}
  </code></pre>