london. flickr. city. · 2005-07-03 03:01

(update: the Flickr API is up and down all the time at the moment – if you hit flickrcity at a bad time, you’ll get a nasty 500 error. And having caching problems with new code. Will fix this asap.)

The need to program comes around every 6 months or so for me, and, probably due to the Where 2.0 conference (which I sort-of attended by sitting in the IRC channel and heckling), I decided to get one of my mapping ideas out of my head.

It also fortuitously coincided with the google maps api launch, which has made it both easier and harder to created google maps hacks.

So, here it is : flickrcity.

The basic idea is to provide a nice output mechanism for geotagging photos, much like the excellent work of Trevor, Mikel and many others. However, this uses Flickr as its data source and google maps as its presentation.

So what? I mean, Flickr + Google Maps is an idea everyone’s had. Well, I think I’ve got a few nice features now, with the promise of more. Basically, the code is based around a city – it at a base level filters through tags of the city name, and ‘geotagged’. You can then specify extra tags, and either take contributions from all users, or just one.

So, an example:

This is the base New York map, with photos tagged with ‘newyork’ and ‘geotagged’:
http://weather.nearperfect.com/flickrcity/newyork.city

flickrcity newyork

This is New York filtered through the tag ‘bridge’:
http://weather.nearperfect.com/flickrcity/newyork.city?tags=bridge

or what about ‘thegates’:
http://weather.nearperfect.com/flickrcity/newyork.city?tags=thegates

Filtering on a user (I choose you, charmingman):
http://weather.nearperfect.com/flickrcity/newyork.city?user=charmingman

And finally tags and user:
http://weather.nearperfect.com/flickrcity/newyork.city?user=charmingman&tags=eastriver

Through a combination of user and tags, you can basically define your own custom map.

There’s a limit of 50 photos on the map at the moment (I’ll implement pages soon). To test the limits of the APIs, there’s also this. Which indicates not that many people have geotagged the way I thought they had (or at all) – if there are other ways of indicating position, let me know.

This is not a worldwide service, though the code is suitable for anywhere in the world. I’ll run the code for a few cities, but what I really want is for others to take this and run it (and run with it). By being situated, the code gives a more immediate response to users, and it’s easier to understand cause and effect. The map itself may be the visualisation, or the pictures themselves tell the story. I hope it’s open-ended enough to have a variety of uses.

So, I’m currently running:
New York
San Francisco

flickrcity london

London
Helsinki
Copenhagen

Want to add photos? You need to tag your pictures on Flickr. This currently isn’t completely easy – the best way is using Firefox, Greasemonkey and Steeev’s wonderful hacks. It’s a lot easier than it used to be, but not easy enough for most people. I’m hoping this output spurs the input community to get hacking.

v0.2 to do – a list so far – any suggestions, holler:

WARNINGS, BUGS

The first time you hit a combination of city, tags and users, it takes a while to generate the page. A minute or so. It’s making a lot of hits on the APIs, particularly Flickr’s, to get all the information out. Sit tight. After the initial creation, it should be a lot quicker, with updates happening in the background. I’d like to find ways to do less api calls though.

The source code (in Perl) is here(link now fixed) – it should be fairly self explanatory.

My code is crufty. Really bad. Professionals, look away, it will cause nightmares. I’m not a programmer. Please, take it, improve it, rewrite it. Send me a copy when you do!

home