For the past few weeks, I've been working on a map of all Canadian ridings for the upcoming 40th general election. I was first inspired by a Google Maps + Flash application made by the ABC for the 2007 legislative election in Australia. It had the colors of the parties holding a seat, ABC's predictions, and the eventual outcome, along with different tones of color to indicate the margin of victory.

Google has secondary border data, but it isn't publicly available as far as I know. What I did to make a Canadian electoral map was to get the electoral district data from GeoGratis, a service of the Natural Resources Ministry that provides maps of all kinds free of charge. The data is in SHP (Shapefile) and was converted to the Google Earth KML format with a third-party program. I could've get the coordinates data (which is really what I need from GeoGratis' maps) with a copy-paste by opening the SHP file in the Google Earth Pro edition.

I then parsed everything to a database for ridings, political parties and candidates information. All the data is already available on the Elections Canada website in CSV text format. It was still a bit of a hassle to convert and normalize everything (I also had to import complementary data only available on the Canadian Parliament website).

One of the most interesting features of this map are the network links. They allow for incremental update of the map's points, polygons, info balloons based on the user's point of view, whether your above some pre-defined region, or at regular intervals of time (see KML reference). This map is able to show regularly updated data, which I won't be able because of time constraint.

Finally, the coolest feature (and most useful) is probably the inclusion of Google Chart, which can generate custom charts (bar, pie, etc) as PNG images from data sets and labels that you send to the script. So, with the data that I had, I could generate charts for the two previous elections for all ridings along with the icons representing the voting proportions at the last election this riding saw.

A couple of visual features:
- Riding color represents the party owning it at dissolution. That is, before Parliament starts sitting again, such that Blair Wilson is counted as an independent, not a Green.
- Transparency level represents the margin of victory. Does not work for floor-crossers.
- Pie charts represent vote shares at the last general election, or by-election if applicable.

Update (2008-10-15): The following is the use of my map by Canada's state television in French: