/mapimage

Generate a map of the UK showing the general election voting distribution of 2005, 2010 and 2015. Existing election result maps did not really show the subtlety in voting, this is due to the first-past-the-post voting system (winner-takes-all). Resulting SVG images now published on Wikipedia UK_General_Election_2010#Voting_distribution_per_constituency and UK General_Election_2015#Voting_distribution_per_constituency

Primary LanguageJava

mapimage project

what?

Generates a map (image) of the UK, displaying the General Election voting distribution.

why?

Existing election result maps did not really show the subtlety in individual voting, due to the first-past-the-post (winner-takes-all) voting system.

how?

  • source code starting point: src/main/java/com/knocksfornometer/mapimage/Main.java
  • reads in a public map of the UK in SVG format (see 'input map sources' section below)
  • reads in election data (from Electoral Commission or UK Parliament)
  • looks up party colors (using: http://en.wikipedia.org/wiki/Wikipedia:Index_of_United_Kingdom_political_parties_meta_attributes)
  • calculates a voting distribution for each constituency
  • generates a 'voting distribution' image for each constituency using an {@link ImageGenerator} where the pixels represent the party colour and appear in frequency proportional to the votes
  • fills the blank constituency areas on the full UK map with the generated constituency voting pattern
  • writes the updated SVG file as output

sample constituency voting pattern images: image

result

Voting pattern changes in 4 successive UK General elections: 2005 - 2017 UKElectionMap_votes

input map sources