Maps and pictures go together like a horse and buggy.
Ever since Flickr started cataloguing people's digital photography, many have been clamouring to be able to geolocate photos. The idea of geotags was proposed by Dan Catt. As described in "Browse Photography by Shooting Location" [Hack #46], Dan created a service called Geobloggers (http://www.geobloggers.com) to aggregate the geotagged photos.
One of Flickr's key features is that it allows you to add tags to your photos. A tag can be a word or group of words, such as "vacation" or "my kids." There are three tags you need to add to photos to be able to geolocate them: geo: lat=xx.xxxx, geo.lon=yy.yyyy, and geotagged.
The latitude and longitude are expressed in decimal degrees. Latitudes south of the equator and longitudes west of Greenwich are negative. As different latitudes and longitudes appear to be different tags to Flickr, the geotagged tag is necessary to let you search for geotagged photos. There are two ways to geotag photos: manually and using Google Maps.
If you have a GPS, use it to record the latitude and longitude as you take photos by taking a photo of the GPS. You can set the GPS to display in decimal degrees (which may be represented as hddd.ddddd° in the GPS settings), however, GPSes often display in degrees and minutes, as shown in Figure 5-20, or degrees, minutes, and seconds.
Figure 5-20. Take a photo of the GPS to make geotagging easy
If you have GPS coordinates in degrees, minutes, and seconds, try the FCC's converter at http://www.fcc.gov/mb/audio/bickel/DDDMMSS-decimal.html.
In Flickr, add the three tags to each photo, which is represented by that latitude and longitude. Taking the location in the photo as an example, the tags I would add to the photo are:
geo:lat=71.171067 geo:lon=25.783050 geotagged
There is, thankfully, an easier way. We can use Google Maps and a nifty Greasemonkey script to do all the heavy lifting for us.
The hard bit is setting up. You need to install Firefox (http://www.mozilla.org/products/firefox/), and then Greasemonkey (http://greasemonkey.mozdev.org/). Flickr user CK has written a Greasemonkey script called GmiF. Version 2.3 of GmiF can be found at http://www.flickr.com/photos/ckyuan/30014875/. In Firefox, right-click on the flickr.gmap.user.js link, and select "Install user script." Then click OK in the dialog box. Now when you go to a Flickr photo page, there will be an extra icon on the photo toolbar, as shown in Figure 5-21.
Figure 5-21. A Flickr photo page, with extra GMaps button
Clicking the GMaps button adds a Google Map into the page, along with several choices as shown in Figure 5-22.
Figure 5-22. A map embedded in the photo page
Drag and zoom the map to find the point where the photo was taken. You may have to switch to satellite mode to see where you are at higher zooms. Then click on the map in the exact place where you took the photo, and a red pointer will be displayed, as in Figure 5-23.
Figure 5-23. A red geolocation pointer appears
Click the red pointer, and a bubble will display a thumbnail of the photo, location, and more actions, as shown in Figure 5-24.
Figure 5-24. A geotagging bubble
Finally, select the "Add geo tags" link. This adds the required tags to the photo, as shown in Figure 5-25.
Figure 5-25. The final set of tags, including geotags
The photo is now geotagged; you can submit it to Geobloggers or wait for them to find it with the automatic search of photos tagged geotagged. Once you've picked up the process, geotags can be added quickly to sets of photos.
You Are Here: Introducing Google Maps
Introducing the Google Maps API
Mashing Up Google Maps
On the Road with Google Maps
Google Maps in Words and Pictures
API Tips and Tricks
Extreme Google Maps Hacks