Mapping Israel's Elections 1992-2021
These are the scripts required to recreate the project.
- Clone the repository
git clone https://github.com/JacobWeinbren/Israel-Data/
- Create venv and enter to scripts
#Create the venv
python3 -m venv israel_env
#Enter the venv
source israel_env/bin/activate
#Enter scripts
cd scripts
- Create folders
python setup.py
Collects location for all polling stations
- Enter Station Scripts
cd stations
- The 19th Knesset election is a PDF. Convert it to an
xlsx
, stored inoutput/meta
.
python 19.py
- Reads the data from the station addresses and stores in
output/stations
.
python process.py
- The 19th Knesset election has an incorrect value. This script runs a backup and fixes the error (previously, this was designed to fix more values).
python fix.py
- Get a complete list of every polling station and booth and it's respective location, placing it in
output/locations
.
python positions.py
This is not necessary to the replication of the project. These scripts tabulate the locations of all avaliable station addresses and calculate their distants between Knesset elections.
- Enter Station Scripts
cd stations
- Geocode every address and store in
output/locations
python geocode.py
- Calculate the distances between station locations in each Knesset election and store in
output/analysis
python analysis.py
You can see the completed version of this analysis on this Google Sheet. The main finding is that there is very little variation of polling station locations between Knesset elections.
geocode_arcgis.py
andgeocode_google.py
takekey.py
(in.gitignore
) and run a process function. The function takes the address and returns a latitude and longitude in Israel.geocode_test.py
tests the google script works
variables.py
includes variables common the geocoding scripts
The scripts create a geojson
hexagonal map, containing all knesset election data. This map can be served on a web server.
-
Create a tessellated geojson file.
-
Create a new ArcGIS project and load map of Israel, West Bank and Gaza (you can use the one below)
-
Run
Generate Tesselation
with the following settings - Shape Hexagon - Extent of Israel Map - Size 5km (squared) - Spatial reference Current Map (Web Coordinates) -
Run
Features to JSON
withWGS_1984
tooutput/maps/base.geojson
. -
Now we need to add data to the map
-
Enter Map Scripts
cd maps
- Add stations to on
base.geojson
to produceoutput/maps/stations.geojson
python stations.py
- Collect election results from all Knesset elections
python politics.py
- Apply tallied data to map
python data.py
-
Afterwards, we need to convert the hexagons to points (to save space)
-
Run
JSON to Features
withWGS_1984
onoutput/maps/stations.geojson
-
Run
Features to Point
(calculates centroids) -
Run
Features to JSON
as withWGS_1984
tooutput/maps/points.geojson
-
Collect election results to produce election data files in
elections
.
python csv_writer.py
You can find the published map here
- Double Envelopes (Military Ballots) are coded seperately, as they have no location data
- 13th, 16th and 17th Knesset requires dividing by 10 to keep ballot numbers consistent
- Decimal points suggest multiple booths at one polling station. Though sometimes multiple stations can also be at one address.
- Default blocs are based on the IDI, the Historic Israeli Elections Project and consideration from myself and those who provided feedback on this project.
- The 13th Knesset election required some extra transcription of the notes in CBS Series '926', entered on this sheet and saved in
13_Corrected
.
Stations geocoded using ArcGIS, credits provided by Exeter University.
A small number of polling stations are missing - if you have the addresses to polling stations in the crossed out elections, please let me know.
Knesset | Year | Polling Stations | Station Notes |
---|---|---|---|
13th | 1992 | ❌ | |
14th | 1996 | Knesset | |
15th | 1999 | ❌ | |
16th | 2003 | ❌ | |
17th | 2006 | Knesset | |
18th | 2009 | ❌ | |
19th | 2013 | Knesset | Adobe Converted |
20th | 2015 | Knesset | |
21st | 2019 | Knesset | Ballot Report |
22nd | 2019 | Knesset | Ballot Report |
23rd | 2020 | Knesset | Ballot Report |
24th | 2021 | Knesset | Ballot Report |
Results can generally be found through the most recent Knesset Site.
Knesset Election | Year | Results | Results Notes |
---|---|---|---|
13th | 1992 | Bureau of Statistics | This was a request to the ISDC |
14th | 1996 | Knesset | |
15th | 1999 | Knesset | |
16th | 2003 | Knesset | |
17th | 2006 | Knesset | |
18th | 2009 | Knesset | |
19th | 2013 | Knesset | |
20th | 2015 | Knesset | |
21st | 2019 | Knesset | By Polls |
22nd | 2019 | Knesset | By Polls |
23nd | 2020 | Knesset | By Polls |
24th | 2021 | Knesset | By Polls |
Initial map of Israel from Open Source Natural Earth, extracted using Data -> Export Features
. Wurman Dots inspired by ArcGIS blog post.
I have categorised default blocs for all the Knesset elections in this spreadsheet. This was stored in data/blocs.tsv
. This is based on my subjective opinion - feel welcome to offer suggestions or changes.
Thanks to the Israeli Election Commision for data and support. And many thanks my relatives in particular Gidi and Michal for helping to retrieve data and explaining how elections worked.
Thank you Hovav Dror at Quantitative and Lior Kaplan at Open Source Consulting for providing location data under CC and much needed advice.
Many thanks to my friends, in particular Chris Terry and T.S. Kovak, for help along the way.
Hebrew Wikipedia provides the Hebrew symbols for ballots and common English names.
Isael Democracy Institute provided the 12th Knesset Election results (in aggregate).