Skip to content

Filling England/Scotland/Wales boundary polygons

Notifications You must be signed in to change notification settings

CampaignLab/boundary-coverage

 
 

Repository files navigation

Filling constituencies with circles

What is this?

This project 'fills' the England, Scotland and Wales revised 2023 Westminster constituencies with circles according to the following parameters:

  • The circles' radii are multiples of 1km, with a minimum radius of 1km
  • The circles can overlap
  • A constituency can have at most 200 circles

How can I use the results?

The calculated circles can be found here.

The percentage coverage achieved for each constituency can be found here.

A visualisation of the circles calculated and coverage achieved for each constituency can be found here.

How well does this work?

The average coverage achieved is 86%.

Vale of Glamorgan is the constituency covered most completely: Visualisation of the calculated circles and coverage for Vale of Glamorgan

Beaconsfield has coverage closest to the average: Visualisation of the calculated circles and coverage for Beaconsfield

Excluding constituencies that have no coverage at all, Southgate and Wood Green has the smallest coverage: Visualisation of the calculated circles and coverage for Southgate and Wood Green

Seven constituencies are small enough and/or awkwardly-shaped enough that they can't even fit any of the smallest 1km radius circles:

How can I run this myself?

  • Clone the repository

  • Change directory into the respository

  • Install the dependencies, e.g. using Anaconda:

    conda env create --file environment.yml

  • Activate the environment:

    conda activate bubbles

  • Run python generate_bubbles.py, which will:

    • Download and fetch shapefiles for constituencies into data/
    • Write images showing bubble coverage into output/constituencies/JPGs
    • Write output/constituencies/bubbles.csv with one bubble per record
    • Write output/constituencies/statistics.csv with one constituency per record
  • Run python app.py and view http://localhost:5000/

Was this done for the current/old/pre-2024 constituencies?

Yes!

The calculated circles for the old constituencies can be found here.

The percentage coverage achieved for each old constituency can be found here.

A visualisation of the circles calculated and coverage achieved for each old constituency can be found here.

About

Filling England/Scotland/Wales boundary polygons

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 66.8%
  • Python 30.0%
  • HTML 3.2%