Archive for the 'PHP' Tag  

Flickr Photo Set to KML

August 23rd, 2007

Filed under: Computers and Technology , Software

Tags: , , ,

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

You are welcome to use this script hosted on my site, or you can download it and run it on your own computer/webserver. If you would like to run it yourself, please be aware of the following…

System Requirements:

This script is available under the GNU General Public License (GPL) version 3 or later. (Source Code)


  • 2011-10-06
  • 2007-08-27
    • 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.
  • 2007-08-24
    • 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.

Blogspot/Blogger RSS generator

May 16th, 2007

Filed under: Computers and Technology , Software

Tags: ,

Quite a few of my friends and relatives make use of Blogger/Blogspot for their weblogs. While Blogger seems to be a great service and very easy to use, what annoys me is that RSS feeds are often disabled on Blogger weblogs. Maybe people are setting this on purpose, maybe they are turning off RSS feeds unintentionally, or maybe that is the default. Either way, I read all of my news and blogs in an RSS reader. Friends & family blogs and photo-streams make up about 25 of the 100+ feeds I subscribe to. If a blog doesn’t have an RSS feed for me to subscribe to, I’m never going to remember to read it.

So, my work-around for Blogger was to write a screen-scraping RSS generator that creates an RSS feed from a Blogger weblog. BlogspotRSS is a simple PHP5 script that makes use of XPATH queries to turn the Blogger weblog into an RSS document. If you have a web server with PHP5, please download BlogspotRSS and run it on your own web server to save my bandwidth.

The BlogspotRSS script is licensed under the GNU General Public License (GPL).


  • It seems that some of the Blogger themes change the HTML quite a bit. I’ll have to fix up the RSS generator to make it work with a few more themes than the ones I tested it on…

« Prev