Sunday, April 26, 2009

H1N1 Swine Flu TimeMap

Tweets from @ attilacsordas and @stew alerted me to the Google Map of the H1N1 Swine Flu outbreak by niman.

Ryan Schenk commented: "It'd be a million times more useful if that map was hooked into a timeline so you could see the spread.", which inspired me to knock together a timemap of swine flu. The timemap takes the RSS feed from niman's map and generates a timemap using Nick Rabinowitz's Timemap library.

Although in principle this should have been a trivial exercise (cutting and pasting into existing examples), it wasn't quite so straightforward. The Google Maps RSS feed is a GeoRSS feed, but initially I couldn't get Timemap to accept it. The contents of the <georss:point> tag in the Google Maps feed looks like this:

33.041477 -116.894531

Turns out there's a minor bug in the file timemap.js, which I fixed by adding coords= TimeMap.trim(coords); before line 1369. The contents of the <georss:point> taginclude leading white space, and because timemap.js splits the latitude and longitude using whitespace, Google's feed breaks the code.

Nick Rabinowitz has fixed this bug.


Nick said...

Fixed in trunk :). Great timemap - glad you found the library useful!

Steve said...

How are you getting the original data? Is it generated by Google? There are problems with it. One data point (Philadelphia, today: "sick person taken off plane at PHL") links to a story that states she tested negative for swine flu:

Roderic Page said...

I'm using the RSS feed from the source Google Map, so it's really a question for the people assembling that feed.

Rob Beiko said...

That's a very cool application, but it looks like the free Google Maps mashup has moved to the FluTracker site ( - are you still able to access the data?

Roderic Page said...


Actually I switched early on to a different source (also available via to get a map with fewer duplicates and links to the source stories.

Henry Niman's original map has, as you noted, moved to the much slicker, which provides a RSS feed (and other download options).

Rob Beiko said...

Ah, that's excellent, thanks! We're about to start tracking the evolution and spread of H1N1 using GenGIS (, and I have been combing the news trying to fill in incomplete collection locations and dates. This will be a huge help.