Skip to content

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_const…

Notifications You must be signed in to change notification settings

eelcodevlieger/mapimage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/github/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
  • outputs files to directory $project_dir\target\mapimage-output:
    • writes the updated SVG file
    • renders the same map as PNG file

sample constituency voting pattern images: image

result

Voting pattern changes in successive UK General elections: 2005-2024-mapimage-uk-general-elections-small

input map sources

About

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_const…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages