Adam August 23rd, 2007
One of the things I (and others) have found lacking when working with geotagged images on Flickr, is the inability to retrieve a “photo set” (Flickr’s take on a slideshow) as a KML document that can then be displayed in GoogleEarth, GoogleMaps, or other geo-browsers. Flickr provides some KML links and GeoRSS feeds, but these are either limited to 20 items or can only be pointed at tags or users’ photo-streams, not a particular photo set.
To fill this niche, I present a small script I wrote to generate a KML file from the geotagged photos in a set:
Photo Set to KML (try it out)
- Generate a KML file from a Flickr photo set
- Directly open the KML file in Google Maps
- Choose what size image to include in the placemark description for each photo.
- Optionaly draw a path (line) from photo to photo ordered in one of several ways: by date taken, by date uploaded, by set order. Useful for making a quick and dirty map of a trip.
- KML / GoogleMaps – Some photos from Cape Cod.
View Larger Map
- KML / GoogleMaps – A set of photos from a trip I took around Turkey, with lines drawn chronologically. Since this is a large set that causes GoogleMaps to time-out, I’ve downloaded the KML file and then re-uploaded it to my website. This is the method I recommend for large photo sets.
View Larger Map
- Now uses htmlspecialchars() to clean titles instead of htmlentities(), the latter of which was causing excessive translation of German characters. Thanks Stefan Geens, for pointing this out.
- Form now generates valid XHTML 1.0 strict.
- Now can use image thumbnails instead of camera icons. Thanks for the idea Nicolas Hoizey.
- Now escapes ampersands in titles and descriptions. Thanks Jesse for pointing this out.
Future Improvement Ideas::
- Add an option for icon size.
- Add options for custom icon/path styles. I’m not sure whether to give several options, or just provide a field for a block of arbitrary KML style-markup.