Skip to content

Commit baaa5d7

Browse files
committed
Update readme to show how to download parliamentary shape files
update requirements to include geopandas
1 parent e65858a commit baaa5d7

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ docs/_build/
7070
target/
7171

7272
# Jupyter Notebook
73-
.ipynb_checkpoints
73+
**/.ipynb_checkpoints
7474

7575
# pyenv
7676
.python-version

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@
22
This project contains code to generate maps of the United Kingdom divided by constituency lines. One can supply constituency-level data,
33
such as number of voters, to see the constituency break down of the data.
44

5-
Formally known as choropleth maps, the plots are generated using plotly.
5+
Formally known as choropleth maps, the plots are generated using geopandas.
6+
7+
## How to use
8+
Clone the repo and run the python script or ipython script in the `map` directory.
9+
10+
The plots use the generalised parliamentary boundaries as of December 2015 by default (error downloading more recent data - update on the way). To use different geographic divisions,
11+
download the [*shapefile*](https://www.gislounge.com/what-is-a-shapefile/) you want and replace the dataset loaded in the example.
12+
13+
You can download official UK boundaries [here](https://geoportal.statistics.gov.uk/search?q=Parliamentary%20Generalized%20Clipped%20Boundaries).
14+
15+
_Note: Make sure you copy_ **all** _of the files, not just the shp file._
616

717
### What are constituencies?
818
The United Kingdom of Great Britain and Northern Ireland operates elections under a first-past-the-post (fptp) system.
919
The nation is split into hundreds of **constituencies** of **roughly** the same number of citizens.
1020

11-
In General Elections, the politician with the most votes in each constituency is elected as that constituencies representative to the House of Commons.
21+
In General Elections, the politician with the most votes in each constituency is elected as that constituency's representative to the House of Commons,
22+
as one of 650 Members of Parliament (MP).

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
numpy
22
matplotlib
33
pandas
4-
plotly
4+
geopandas

0 commit comments

Comments
 (0)