Visualizing Election Results Directly from the Ballot Box

Wednesday, June 15, 2011 | 10:18 AM

Labels: , ,

This past Sunday Turkish citizens went to the polls to cast their vote at a critical juncture in their country's history. After the polls closed, voters across the country turned to Google first to understand the results and the impact of the election. Providing access to useful information like results for elections are closely aligned to Google’s mission and help improve democracies across the globe. In Turkey, the team at Google helped visualize and explore the latest election results as they became available. Using Fusion Tables and the Google Maps API, our elections team built a gadget that displayed province and district-level results in real-time “directly from the ballot box.” To facilitate this, we partnered with Cihan News who recruited 50,000 volunteers to provide real-time election data and received praise from voters and other media outlets for their quick and accessible reporting of election results.

By making it easy for multiple collaborators to integrate data, create visualizations and work with a variety of data types, Fusion Tables allowed us to quickly build a prototype. We created tables with static content such as district shapes and names and separate tables with dynamic content such as the number of votes received and counted ballot boxes. We wrote a simple program to periodically parse Cihan’s XML feed of results and populate the dynamic content tables. We then were able to merge both the static and dynamic tables and visualize them directly in Fusion Tables without writing a single line of new code. As soon as Cihan uploaded the data, we were ready to visualize. The result was a quick and easy mashup that we could check for accuracy.



The gadget was built using PolyGonzo, an open source library for the Google Maps JavaScript API. PolyGonzo provides fast rendering and highly interactive polygons in most modern browsers using the HTML5 canvas element and GeoJSON shape data. From Fusion Tables, we exported the static content for Turkey’s 957 districts to KML and we then converted the shapes into simplified GeoJSON. Using the Fusion Tables JavaScript API, the gadget also periodically read from the same dynamic content tables we used to build our prototype. The end result was an engaging gadget whose static and dynamic content could be traced back to Fusion Tables.

We hosted the gadget off of Google Project Hosting. By 7:30 in the evening local time we were seeing over 500 queries per second to load the gadget’s static content from Project Hosting and over 1000 queries per second to load the gadget’s dynamic content from Fusion Tables - both astounding figures. As evidenced by the volume of updates on Twitter and elsewhere on election night, Turkish voters were indeed eager to share the details of the election outcome courtesy of this custom mapping platform.

Projects like this help people around the world view and explore information and also allow people to collaborate and merge different data sources. For instance, a tech savvy reporter could incorporate publicly available socioeconomic or past election data to the Fusion Table and use the Google Maps API to overlay the data directly onto the existing map. The web holds much promise to continue to transform politics and elections from a passive process to an active, participatory one. The elections team here at Google will continue to seek solutions and build tools and platforms to help inform and connect voters and candidates across the globe.

As evidenced by this latest project, Google is committed to partnering with and helping news organizations succeed online and off. The Turkish election results gadget is the first of many election visualizations we hope to create in the future. Soon, we’re creating an election results specification so any news organization can provide the public data and can work with us to provide visualized and - importantly - searchable results on election day. We can’t wait to see what tools and products we can cook up together for elections around the world!

Posted by Chetan Sabnis, Software Engineer, Public Sector Engineering

5 comments:

İbrahim Halil Dere said...

Could anyone who knows the link of this map give it?

�zg� said...

I noticed the same speed as we were watching the results outside the country. Thanks Google thanks cihan news agency.

�zg� said...

I noticed the same speed as we were watching the results outside the country. Thanks Google thanks cihan news agency.

Google Politics, Elections, and Public Sector Team said...

@İbrahim Halil Dere

You can find the gadget here: http://www.google.com.tr/intl/tr/landing/elections/2011/

Bülent Keleş said...

Awesome work!