ElectionMapper

About this website

This website started out as a major group project for a fourth year Web-Based Information Systems course at Simon Fraser University. We had to plan and implement a web information system using modern web standards, open-source software, and an MVC framework. The course required a proposal be sent and approved by the instructor, a checkpoint for implementation to make sure the project was underway, and a poster presentation to the university community to show what the system was supposed do and why it would be useful.

When I started to think of concepts for the project, I knew that I wanted to do something with Google Maps in real time. I think that having real time data available to anyone on Earth (as long as they can get "plugged in") is the true cornerstone of the usefulness of the Internet. Mapping, cartography and geography are interests of mine, as well as Canadian federal politics. I combined these elements together and I decided to create a system capable of providing real time election results, including the real time mapping of those results, and charting for added measure. A quick look through Google didn't yield any useful results, so the plan was set.

The official storyline behind the project was that it could be something that Elections Canada, or ultimately any electoral authority for that matter, could adopt and use for relaying live information to the public immediately following the closing of polling stations. People would be able to see in real time how their candidate is doing, and see how their neighbours voted. Candidates would be able to see right away how their best and worst areas fared. Plus, who doesn't like colourful charts and maps? Lastly, if you wait for the media to report on your electoral district, you might be waiting a while, especially if you don't have a minister or "star candidate" running for office, or if your interested area is not local to where you happen to be on election night. To alleviate this, email alerts would be available to anyone who wanted to know what the results are when their polling division is tabulated, when the last division has been tabulated, or when a candidate is declared by the system as the winner.

Since completing the course, I've since decided to take this on as a pet project to expand my skills, and to create a more useful and sophisticated array of information (including historical information) available to the public. This website will specialize in mapping, and I don't have that much time on my hands so updates may take some time. I hope people will find this website useful, or at the very least, interesting to look at. If you find any mistakes, please let me know. During an election or byelection, if any campaigns are interested in using the live service in conjunction with their scrutineers, I could set you up.

How this works

The concept is quite simple, however when I started, I never had a real website, I didn't know what a MVC framework was, I didn't know PHP, I never used Linux, and I never made a database online before. I had to learn all this and finish the project within 2 months. As this website continues to be a learning resource for me, and in case anyone else also wants to learn about how I set this up or where my information is from, each resource is listed and readily accessible at the bottom of each page. Here is how the service breaks down:

Web host and domain name registrar

The host I am using is Dave's Network. Dave is a University of Ontario Information Technology student, who does a bunch of computer things on the side. He started his hosting service in April 2009 and offers free webhosting via redflagdeals.com. I took advantage of this offer and I must say that the control panel for the various website controls and settings is a lot better than what I've seen from paid hosts, and at no cost you can run most websites. I've since upgraded to a paid account. The .ca and .com domain names were bought via Netfirms, as they have the cheapest registration and renewal rates I can find. There is a coupon for a discount on .com domains available on Google. Don't get suckered into GoDaddy's cheap rates because you'll be paying it back in subsequent years.

Server details and MVC framework

The host server I am using as of the time of writing has (for the nerds) Apache 2.2.16, PHP 5.2.14, MySQL 5.0.91, phpMyAdmin 3.3.8, architecture x86_64, Red Hat Enterprise Linux Server 5 OS, and kernel version 2.6.18-194.11.3.el5. The MVC framework I'm using is CodeIgniter 1.7.3. Installation takes 30 seconds and is literally download, unzip, copy, and paste into your website folder. The online tutorials and user guide are excellent in learning the ropes on how it works. For PHP, you can Google for any solution you need, and most of the time you'll find that you end up on PHP's website, which also has great examples. phpMyAdmin does all the administrative work you need on your MySQL database(s), and is a good tool overall. If you want to make your own server, everything above is available for free except that particular version of Linux, but Ubuntu works just as fine. The website design is based on "ablaze" by Spyka Webmaster, with some modifications. It is coded in XHTML 1.0 Strict through Notepad++.

Data

All electoral data is provided by Elections Canada, while map data is provided by Natural Resources Canada. The data is shown visually with the help of Google Maps JavaScript API V3 and Google Charts API. The charts load on demand depending on what data is passed through the image URL, while Google Maps allows us to overlay KML data layers to show our data. Within the maps application itself, you can view the street map, satellite imagery, or the terrain. If that's not enough, you can virtually transplant yourself into a neighbourhood using Street View. Google Earth was also available, but since users are required to install a plugin and it shows pretty much the same thing as Google Maps, I've left it out.