SlideShare ist ein Scribd-Unternehmen logo
1 von 61
How to (not) build an
election map
Jason Norwood-Young
Code4SA
jason@code4sa.org
Code4SA
“Everyone has the right of access to any information
held by the state; and any information that is held by
another person and that is required for the exercise
or protection of any rights.”
South African Constitution (Section 32)
http://code4sa.org
Elections 2009
Then, in 2012…
2014
HTML Data Mobile
2009
Flash Multimedia Web
News24
• 1.7 Million Unique Users
• 22 Million Page Views
• 30,000 app downloads
• 102,000 concurrent users
• … just on the day after the elections
source: http://www.bandwidthblog.com/
Mail & Guardian
• Map accounted for 10% of traffic
• 5,000 concurrent users on the map
• 22,674 unique users
• 54,475 sessions
• 85,668 pageviews
• Avg session duration: 9m29s
source: Google Analytics, TechCentral
That’s nice, but I thought this was about maps, not statistics
Data Information
Presentation Knowledge
First, the APIs
Mix in a bit of inspiration
http://afrith.github.io/election-web
Start visualising
Our first look - all the provinces, municipalities, wards
Adding some color
Pulling back a bit
Mario Maps!
Fighting with the maps
Large parts of the country don’t have wards (2009)
EC Ward in KZN? WTF
That’s okay EC, have some KZN islands
Fighting with the IEC
Contacting the IEC
(This isn’t a link - it’s
an IMAGE)
At least we had plenty of time for testing…
east we got the API documentation in g
Election day: Wednesday 7 May 2014
we had known about the FRICKING MYSQL REPLICATION OP
Voting Day
May 7, 10:16am
• 7am - 2pm
• Throw out 2009 Wards maps
• Throw out seat allocation graphic
• Add names to map
• Add party flags
• 2pm - 3pm
• Vote
• 3pm - 6pm
• Final fixes to map
• 6pm - 7pm
• Rest, dinner
• 7pm - 9pm
• Integrate with IEC API
• 9pm - 5:54am
• PANIC!!!!
• 5:54am - 10am
• Sleep
• 10am onwards
• PANIC some more
Fun on the day
• IEC API reports that a Voting District has changed (pull,
not push)
• We fetch the changed VD
• We fetch the changed Munic (No ward data available)
• We fetch the changed Province
• Have to do this for Provincial and National
• Takes approximately 4 seconds for one result
4 (seconds) * 22,000 (voting districts) * 2 (provincial, national) =
176,000 seconds
or
2,933 minutes
or
49 hours
Meanwhile, IEC is giving us bullshit data
which means we’re giving bullshit data
At 12pm on 8 May
I decided to turn off ward reporting
But a few days later
(Thanks to Adrian Frith who quickly scraped the data)
Wards are back, baby!
And now we have Voting Districts!
So who did the best maps?
• Media24 had the most up-to-date, accurate data
• We had the coolest
• Adrian Frith had the awesomest (and continues to
do the most with the maps)
• Everyone else kinda sucked
http://adrianfrith.com/
Lessons
• Data accuracy should come first, second and
third
• Don’t trust the data
• Check, double-check, triple-check, and then get
someone else to check
• I’m too old for all-nighters
What’re the 2016 Elections
going to look like?
• Mobile
• Waaay more data
• A more sophisticated, data-literate reader
• They’re maps, Jim, but not as we know it…
Tech Stack
• Code4SA Elections API
• Python (Flask)
• http://election-api.code4sa.org/
• Interface to IEC API
• Node.js
• Middleware btw Code4SA API and IEC API interface
• Python (Flask)
• Maps API
• Node.js, Topojson, Restify
• Front end
• D3.js
• Bootstrap 3
• CodeKit
Embed your own
<link rel="stylesheet" href="http://election-map.code4sa.org/res
<div id="Code4SA" style="height: 100px"></div>
<script src="http://election-map.code4sa.org/code4sa-ck.js" typ
<script>Code4SA.Map.deploy();</script>
But was it worth it?
Yes, but only because
of the APIs
http://maps.code4sa.org/
http://election-api.code4sa.org/
– Emma Goldman
“If voting changed anything, they’d make it
illegal.”

Weitere ähnliche Inhalte

Ă„hnlich wie How to (not) build an elections map

Data data everywhere
Data data everywhereData data everywhere
Data data everywherePhil Bradley
 
Friending The Statehouse
Friending The StatehouseFriending The Statehouse
Friending The StatehouseMark Headd
 
ODC BarCamp 2013 - Introduction to Data Journalism
ODC BarCamp 2013 - Introduction to Data JournalismODC BarCamp 2013 - Introduction to Data Journalism
ODC BarCamp 2013 - Introduction to Data JournalismOpen Development Cambodia
 
American Planning Association 2001 New Orleans - Online GIS for economic deve...
American Planning Association 2001 New Orleans - Online GIS for economic deve...American Planning Association 2001 New Orleans - Online GIS for economic deve...
American Planning Association 2001 New Orleans - Online GIS for economic deve...GIS Planning
 
IDEAS-Nomination-OH
IDEAS-Nomination-OHIDEAS-Nomination-OH
IDEAS-Nomination-OHJohn Dziurlaj
 
open data: opportunities and challenges for business and government
open data: opportunities and challenges for business and governmentopen data: opportunities and challenges for business and government
open data: opportunities and challenges for business and governmentDan Herbert
 
Open Data: opportunities and challenges for business and government
Open Data: opportunities and challenges for business and governmentOpen Data: opportunities and challenges for business and government
Open Data: opportunities and challenges for business and governmentDan Herbert
 
OAEO District 8 Meeting
OAEO District 8 MeetingOAEO District 8 Meeting
OAEO District 8 Meetingboardofelections
 
Advanced Research Investigations for SIU Investigators
Advanced Research Investigations for SIU InvestigatorsAdvanced Research Investigations for SIU Investigators
Advanced Research Investigations for SIU InvestigatorsSloan Carne
 
How you could hack the Dutch elections for the last 26 years
How you could hack the Dutch elections for the last 26 yearsHow you could hack the Dutch elections for the last 26 years
How you could hack the Dutch elections for the last 26 yearsSijmen Ruwhof
 
Data data everywhere and not a byte to eat...
Data data everywhere and not a byte to eat...Data data everywhere and not a byte to eat...
Data data everywhere and not a byte to eat...Tim Willoughby
 
Information Technology Services 201608 v1.5
Information Technology Services 201608 v1.5Information Technology Services 201608 v1.5
Information Technology Services 201608 v1.5John Halbert
 
Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...
Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...
Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...TechSoup
 
Big Data, Open Data, Big Costs - tim willoughby
Big Data, Open Data, Big Costs  - tim willoughbyBig Data, Open Data, Big Costs  - tim willoughby
Big Data, Open Data, Big Costs - tim willoughbyTim Willoughby
 
Aligarh Democracy and AI.pptx
Aligarh Democracy and AI.pptxAligarh Democracy and AI.pptx
Aligarh Democracy and AI.pptxChris Marsden
 

Ă„hnlich wie How to (not) build an elections map (20)

Big Data
Big DataBig Data
Big Data
 
Data data everywhere
Data data everywhereData data everywhere
Data data everywhere
 
Friending The Statehouse
Friending The StatehouseFriending The Statehouse
Friending The Statehouse
 
ODC BarCamp 2013 - Introduction to Data Journalism
ODC BarCamp 2013 - Introduction to Data JournalismODC BarCamp 2013 - Introduction to Data Journalism
ODC BarCamp 2013 - Introduction to Data Journalism
 
What can be done with Open Data?
What can be done with Open Data?What can be done with Open Data?
What can be done with Open Data?
 
Big Data and You
Big Data and YouBig Data and You
Big Data and You
 
American Planning Association 2001 New Orleans - Online GIS for economic deve...
American Planning Association 2001 New Orleans - Online GIS for economic deve...American Planning Association 2001 New Orleans - Online GIS for economic deve...
American Planning Association 2001 New Orleans - Online GIS for economic deve...
 
IDEAS-Nomination-OH
IDEAS-Nomination-OHIDEAS-Nomination-OH
IDEAS-Nomination-OH
 
open data: opportunities and challenges for business and government
open data: opportunities and challenges for business and governmentopen data: opportunities and challenges for business and government
open data: opportunities and challenges for business and government
 
Open Data: opportunities and challenges for business and government
Open Data: opportunities and challenges for business and governmentOpen Data: opportunities and challenges for business and government
Open Data: opportunities and challenges for business and government
 
OAEO District 8 Meeting
OAEO District 8 MeetingOAEO District 8 Meeting
OAEO District 8 Meeting
 
Real Estatate
Real EstatateReal Estatate
Real Estatate
 
Advanced Research Investigations for SIU Investigators
Advanced Research Investigations for SIU InvestigatorsAdvanced Research Investigations for SIU Investigators
Advanced Research Investigations for SIU Investigators
 
How you could hack the Dutch elections for the last 26 years
How you could hack the Dutch elections for the last 26 yearsHow you could hack the Dutch elections for the last 26 years
How you could hack the Dutch elections for the last 26 years
 
Electronic Voting System
Electronic Voting SystemElectronic Voting System
Electronic Voting System
 
Data data everywhere and not a byte to eat...
Data data everywhere and not a byte to eat...Data data everywhere and not a byte to eat...
Data data everywhere and not a byte to eat...
 
Information Technology Services 201608 v1.5
Information Technology Services 201608 v1.5Information Technology Services 201608 v1.5
Information Technology Services 201608 v1.5
 
Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...
Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...
Women Social Entrepreneurs in Civic Tech: How Voices of Women Help Us Advance...
 
Big Data, Open Data, Big Costs - tim willoughby
Big Data, Open Data, Big Costs  - tim willoughbyBig Data, Open Data, Big Costs  - tim willoughby
Big Data, Open Data, Big Costs - tim willoughby
 
Aligarh Democracy and AI.pptx
Aligarh Democracy and AI.pptxAligarh Democracy and AI.pptx
Aligarh Democracy and AI.pptx
 

KĂĽrzlich hochgeladen

AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...
AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...
AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...Axel Bruns
 
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...AlexisTorres963861
 
₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...
₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...
₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...Diya Sharma
 
2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docx
2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docx2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docx
2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docxkfjstone13
 
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...narsireddynannuri1
 
Powerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)
WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)
WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)Delhi Call girls
 
30042024_First India Newspaper Jaipur.pdf
30042024_First India Newspaper Jaipur.pdf30042024_First India Newspaper Jaipur.pdf
30042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
Kishan Reddy Report To People (2019-24).pdf
Kishan Reddy Report To People (2019-24).pdfKishan Reddy Report To People (2019-24).pdf
Kishan Reddy Report To People (2019-24).pdfKISHAN REDDY OFFICE
 
BDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Enjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Pakistan PMLN Election Manifesto 2024.pdf
Pakistan PMLN Election Manifesto 2024.pdfPakistan PMLN Election Manifesto 2024.pdf
Pakistan PMLN Election Manifesto 2024.pdfFahimUddin61
 
Minto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptxMinto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptxAwaiskhalid96
 
2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docx
2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docx2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docx
2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docxkfjstone13
 
Enjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
BDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
BDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
28042024_First India Newspaper Jaipur.pdf
28042024_First India Newspaper Jaipur.pdf28042024_First India Newspaper Jaipur.pdf
28042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
How Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdfHow Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdfLorenzo Lemes
 
Verified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover Back
Verified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover BackVerified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover Back
Verified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover BackPsychicRuben LoveSpells
 

KĂĽrzlich hochgeladen (20)

AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...
AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...
AI as Research Assistant: Upscaling Content Analysis to Identify Patterns of ...
 
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
 
₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...
₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...
₹5.5k {Cash Payment} Independent Greater Noida Call Girls In [Delhi INAYA] 🔝|...
 
2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docx
2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docx2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docx
2024 03 13 AZ GOP LD4 Gen Meeting Minutes_FINAL.docx
 
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
 
Powerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Phoenix, AZ (310) 882-6330 Bring Back Lost Lover
 
WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)
WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)
WhatsApp đź“ž 8448380779 âś…Call Girls In Chaura Sector 22 ( Noida)
 
30042024_First India Newspaper Jaipur.pdf
30042024_First India Newspaper Jaipur.pdf30042024_First India Newspaper Jaipur.pdf
30042024_First India Newspaper Jaipur.pdf
 
Kishan Reddy Report To People (2019-24).pdf
Kishan Reddy Report To People (2019-24).pdfKishan Reddy Report To People (2019-24).pdf
Kishan Reddy Report To People (2019-24).pdf
 
BDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Indirapuram Escorts >༒8448380779 Escort Service
 
Enjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Rajokri Delhi >༒8448380779 Escort Service
 
Pakistan PMLN Election Manifesto 2024.pdf
Pakistan PMLN Election Manifesto 2024.pdfPakistan PMLN Election Manifesto 2024.pdf
Pakistan PMLN Election Manifesto 2024.pdf
 
Minto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptxMinto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptx
 
2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docx
2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docx2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docx
2024 02 15 AZ GOP LD4 Gen Meeting Minutes_FINAL_20240228.docx
 
Enjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Iffco Chowk Gurgaon >༒8448380779 Escort Service
 
BDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 135 Noida Escorts >༒8448380779 Escort Service
 
BDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 143 Noida Escorts >༒8448380779 Escort Service
 
28042024_First India Newspaper Jaipur.pdf
28042024_First India Newspaper Jaipur.pdf28042024_First India Newspaper Jaipur.pdf
28042024_First India Newspaper Jaipur.pdf
 
How Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdfHow Europe Underdeveloped Africa_walter.pdf
How Europe Underdeveloped Africa_walter.pdf
 
Verified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover Back
Verified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover BackVerified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover Back
Verified Love Spells in Little Rock, AR (310) 882-6330 Get My Ex-Lover Back
 

How to (not) build an elections map

  • 1. How to (not) build an election map Jason Norwood-Young Code4SA jason@code4sa.org
  • 2. Code4SA “Everyone has the right of access to any information held by the state; and any information that is held by another person and that is required for the exercise or protection of any rights.” South African Constitution (Section 32) http://code4sa.org
  • 4.
  • 5.
  • 6.
  • 8.
  • 10.
  • 11.
  • 12.
  • 13. News24 • 1.7 Million Unique Users • 22 Million Page Views • 30,000 app downloads • 102,000 concurrent users • … just on the day after the elections source: http://www.bandwidthblog.com/
  • 14. Mail & Guardian • Map accounted for 10% of traffic • 5,000 concurrent users on the map • 22,674 unique users • 54,475 sessions • 85,668 pageviews • Avg session duration: 9m29s source: Google Analytics, TechCentral
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. That’s nice, but I thought this was about maps, not statistics
  • 23.
  • 24.
  • 25. Mix in a bit of inspiration http://afrith.github.io/election-web
  • 27. Our first look - all the provinces, municipalities, wards
  • 32. Large parts of the country don’t have wards (2009)
  • 33. EC Ward in KZN? WTF
  • 34. That’s okay EC, have some KZN islands
  • 36. Contacting the IEC (This isn’t a link - it’s an IMAGE)
  • 37. At least we had plenty of time for testing…
  • 38. east we got the API documentation in g Election day: Wednesday 7 May 2014
  • 39. we had known about the FRICKING MYSQL REPLICATION OP
  • 42. • 7am - 2pm • Throw out 2009 Wards maps • Throw out seat allocation graphic • Add names to map • Add party flags • 2pm - 3pm • Vote • 3pm - 6pm • Final fixes to map • 6pm - 7pm • Rest, dinner • 7pm - 9pm • Integrate with IEC API • 9pm - 5:54am • PANIC!!!! • 5:54am - 10am • Sleep • 10am onwards • PANIC some more
  • 43. Fun on the day • IEC API reports that a Voting District has changed (pull, not push) • We fetch the changed VD • We fetch the changed Munic (No ward data available) • We fetch the changed Province • Have to do this for Provincial and National • Takes approximately 4 seconds for one result
  • 44. 4 (seconds) * 22,000 (voting districts) * 2 (provincial, national) = 176,000 seconds or 2,933 minutes or 49 hours
  • 45. Meanwhile, IEC is giving us bullshit data which means we’re giving bullshit data
  • 46. At 12pm on 8 May I decided to turn off ward reporting
  • 47.
  • 48. But a few days later (Thanks to Adrian Frith who quickly scraped the data)
  • 50. And now we have Voting Districts!
  • 51.
  • 52. So who did the best maps? • Media24 had the most up-to-date, accurate data • We had the coolest • Adrian Frith had the awesomest (and continues to do the most with the maps) • Everyone else kinda sucked
  • 54. Lessons • Data accuracy should come first, second and third • Don’t trust the data • Check, double-check, triple-check, and then get someone else to check • I’m too old for all-nighters
  • 55. What’re the 2016 Elections going to look like? • Mobile • Waaay more data • A more sophisticated, data-literate reader • They’re maps, Jim, but not as we know it…
  • 56.
  • 57. Tech Stack • Code4SA Elections API • Python (Flask) • http://election-api.code4sa.org/ • Interface to IEC API • Node.js • Middleware btw Code4SA API and IEC API interface • Python (Flask) • Maps API • Node.js, Topojson, Restify • Front end • D3.js • Bootstrap 3 • CodeKit
  • 58. Embed your own <link rel="stylesheet" href="http://election-map.code4sa.org/res <div id="Code4SA" style="height: 100px"></div> <script src="http://election-map.code4sa.org/code4sa-ck.js" typ <script>Code4SA.Map.deploy();</script>
  • 59. But was it worth it?
  • 60. Yes, but only because of the APIs http://maps.code4sa.org/ http://election-api.code4sa.org/
  • 61. – Emma Goldman “If voting changed anything, they’d make it illegal.”