Google Earth: Canada Federal Election 2008 (by polls)

Inspired by Stephen Taylor's post (and my ownpastproject from Fall 2008), I set out to produce a website where people could navigate election results by riding, but also by poll.

I used cartographic data from the Geogratis.gc.ca website. I imported the Shapefiles to a PostgreSQL database with Postgis. Then, I processed results by polling divisions from the 2008 election, data available on the Elections Canada website. It was put in a separate table on the same database. A custom program in Python using the very handy libkml (a code library developed and supported by Google) took the data and outputted pretty KML code. It was packed as a KMZ and uploaded to my webspace. [E-mail me, if you want to exchange ideas on the code]

The webpage itself is rich in JavaScript and the code can be seen here. I use hashes to make the webpage bookmarkable and loadable with a given riding pre-loaded.

The website requires the Google Earth plugin, available for Windows and Mac. It works very smoothly on my old computer (bought in 2003).

You could also download the individual KMZ files (they are in fact zip files, so on Windows you would rename them with .zip and unzip them with your usual utility). They are at: http://earth.smurfmatic.net/canada2008/polls/ridings/ . However, if I post updates (which I will), you won't see them.