Tuesday 6 March 2012

GPS Information in photos
I got a post today asking
I had no idea this could happen from taking pictures on the blackberry or cell phone. It's scary.http://www.youtube.com/watch?v=N2vARzvWxwY
The short answer is, yes if you have location services switched on then photo's you take can include that information. How detailed is it? And how can you use it?
As an example consider this photograph,




It contains a metadata including GPS properties. I used ImageMagick to extract the following,
Image: CameraZOOM-20120215124309832.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 1944x1944+0+0
Resolution: 72x72
Print size: 27x27
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
...
Image statistics:
...
Page geometry: 1944x1944+0+0
Properties:
...
exif:GPSAltitude: 0/1
exif:GPSAltitudeRef: 0
exif:GPSDateStamp: 2012:02:15
exif:GPSInfo: 302
exif:GPSLatitude: 37/1, 48/1, 58099/1000
exif:GPSLatitudeRef: S
exif:GPSLongitude: 144/1, 57/1, 57862/1000
exif:GPSLongitudeRef: E

exif:GPSTimeStamp: 144/1, 57/1, 57862/1000
exif:ImageLength: 1944
exif:ImageWidth: 1944
...
Highlighted in red is the relevant location information. With a little work, this information can be used to find a map reference. The method is
  1. Convert latitude and longitude from Degrees/Minutes/Seconds (DMS) in decimal
  2. Plug this into an online map
1. Conversion
You can use one of many an online calculators to do this. But it is easy enough to manually perform the calculation.
Converting Latitude:
exif:GPSLatitude: 37/1, 48/1, 58099/1000
exif:GPSLatitudeRef: S

This is
   37 Degress, 48 Minutes, 58.099 Seconds, South
Which is
   37.0 + 48/60 + 58.099/(60*60)
Or (rounded to 6 places)
   37.000000 + 0.800000 + 0.016139

That is
   37.816139
But since this is South, the real value is
   -37.816139
Converting Longitude:
exif:GPSLongitude: 144/1, 57/1, 57862/1000
exif:GPSLongitudeRef: E

This is
   144 Degress, 57 Minutes, 57.862 Seconds, East
Which is
   144.0 + 57/60 + 57.862/3600
Or (rounded to 6 places)
   144.000000 + 0.950000 + 0.016073
That is
   144.966073
2. Map Coordinates
Put this into Google Maps as -37.816139,144.966073 will yield you this map,
View Larger Map
Wolfram Alpha does this whole thing in almost one step:
Just put 37 Deg 48' 58.099"S , 144 Deg 57' 57.862"E into the search field and you get taken straight to a map.