blog.aka.me -
« Back to top page
May 19, 2003
Viewed 161 times
| GPS | keitai | Photos |
Loading Retweet

GeoTags in EXIF headers

Just had an interesting discussion on the JapanBloggers mailing list about GPS locations embedded in blog entries or photo galleries. We got some good ideas coming.For those who moblog with GPS phones (who can retrieve the phone location and send it a URL linking to a map to this location on the internet), Jim suggested that we should embed the GPS locations (latitudes & longitudes extracted from the URL) into the EXIF header included into JPEG pictures. We would probably need Kevin from mfop to modify his code to check whether a GPS location as been attached to the email with the picture and extract those coordinates to make it a nice link to a map on the internet as well as encode them into the EXIF header of the picture and the Geotags of the individual entries. In my case, on top of having Gallery check whether there are GPS coordinates in my captions, I could simply have JHEAD to write them in the EXIF headers of my pics as they are uploaded to the galleries. And if Geotags were being generated as well, I could also write a script that would suck all the data from the album pages and write a master XML file with all the GPS coords associated to hyperlinks to the corresponding pics that I could then use to recreated an interactive map of Tokyo with hotspots of all the locations I have taken GPS-tagged pictures. (see blogmapper) For the moment however, I seems that only a handfull of us have GPS phones: Stuart, Mie, Kurt, Jean and I, with Mie and Jean yet to attach locations to some of their moblog entries. Inspired by Stuart attempts at reading the EXIF header of the photos taken from the mobile phone using a little Python script called exiftool.py, I contacted Gene Cash, the author of a similar script: exif.py. After a few tests, we discovered that if you request a GPS location to be attached to a picture-email before sending it, the EXIF header GPS fields of that picture are filled with the GPS location information (with even more precision that you can get the phone to let you know about in normal use, like altitude). This is not mentioned in the phone manual but means that the phone companies are as smart as we are, and are probably cooking some nice little tools to embed in their forthcoming phones. I can't wait! Below is the data we read from the Exif: Filename: exif-gps-test-image.jpg EXIF ColorSpace: 1 EXIF ComponentsConfiguration: YCbCr EXIF DateTimeOriginal: 2003:05:15 20:40:15 EXIF ExifImageLength: 176 EXIF ExifImageWidth: 144 EXIF ExifVersion: [48, 50, 50, 48] EXIF FlashPixVersion: [48, 49, 48, 48] GPS GPSAltitude: 82 GPS GPSAltitudeRef: 0 GPS GPSLatitude: [35, 47, 183/25] GPS GPSLatitudeRef: N GPS GPSLongitude: [139, 36, 2941/50] GPS GPSLongitudeRef: E GPS GPSMapDatum: WGS-84 GPS GPSTimeStamp: [20, 40, 7] GPS GPSVersionID: [2, 2, 0, 0] GPS Tag 0x001B: [65, 83, 67, 73, 73, 0, 0, 0, 71, 80, 83, 45, 70, 73, 88] GPS Tag 0x001D: 2003:05:15 Image ExifOffset: 180 Image GPSInfo: 290 Image ImageDescription: 030515_2040~01 Image Make: KDDI-TS Image Model: A5304T Image Orientation: 1 Image ResolutionUnit: Pixels/Inch Image XResolution: 72 Image YCbCrPositioning: 2 Image YResolution: 72 Includes JPEG thumbnail: No Includes TIFF thumbnail: No The data in the EXIF's GPSInfo fields was bang on correct. In the url attached to the picture in the email, there were: http://www.at-navi.com/map/checkMap.jsp?datum=0&unit=0&lat=+35.47.07.32&lon=+139.36.58.82&fm=0 now in the exif we find: GPS GPSLatitude: [35, 47, 183/25] GPS GPSLatitudeRef: N GPS GPSLongitude: [139, 36, 2941/50] GPS GPSLongitudeRef: E in the url we have: lat=+35.47.07.32 (where "+" means North) lon=+139.36.58.82 (where "+" means East) in the exif 183/25 equas to 7.32 and 2941/50 equals 58.82 This format in in arc with 2 decimals for the seconds which is a more precise position than most GPS that usually give only 1. For the altitude, we have no means to get to find out about it on the phone in normal use, but this info is added here. I have another GPS, a Garmin, and I double checked the altitude of that picture and it matches. The altitude seems to be in ft. unit (even though the EXIFStandard says it s in meters...). This is so exciting and we are conducting more test with Gene. I know Dav and Kevin will be happy to write a script to parse this info into MT entries. The great thing about the Exif is that it is safe, in the picture and can be retrieved at any time and made available for a host of uses such as geotags encodings (in whichever format becomes standard) or links to as many different maps you want (as long as we have the coordinates, we can convert them to whichever format needed by the mapping website) and more. And for those of you who don't feel like revealing your whereabouts too precisely, I am sure that the script could automatically shorten the GPS coordinates, hence making them less precise. As well as the possibility of adding a default location in case you are not adding a GPS one, because we should all geotag those pictures and posts at the city/national level, if not at the street level. Stay tuned.

Comments (0)

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    twitter