Mapping the 2017 local elections in Scotland #council17

April 18th, 2017 No comments

I’ve always been an anorak around elections – it’s probably more about the numbers than the politics and Single Transferable Vote (STV) elections are as entertaining as they come. I’m enthusiastic about STV from a democratic perspective also, because it encourages a less tribal form of voting mentality. Political choices are complex and it makes sense that you can find policies to support across a spectrum of parties or prospective politicians. To be honest, I’m not a party political type of person, I prefer to stay untethered to party interests, so the notion of a party list vote (as in part of the Scottish parliament elections and the entirety of the European parliament vote in Scotland), where you are voting for a single party and not even a person, is an uncomfortable form of democratic process for me.

However, every 5 years, Scotland gets a shot at a Single Transferable Vote election in the council elections here. Turnout is generally low, so I’m keen to do what I can to encourage voters to engage with this election in the hope that it will promote the suitability of STV for other elections in Scotland. Having seen the wonderful visualisations made available for the snap Assembly election in the north of Ireland in March 2017, I was keen to implement something similar for the Scottish local elections in May 2017. It would be a challenge, not just because it would be like #AE17 times 32 since each council election is effectively a mini-assembly with wards for constituencies with multiple seats in each ward, but I also soon discovered that there is no detailed aggregated election data for the two previous STV elections in Scotland (2007 & 2012). Each council has a statutory responsibility to publish results in PDF form on their websites, so that means the data for Scotland is spread across 32 councils in a whole variety of different layouts to a varying degree of detail.

This same scatter-gun approach to presentation of data affects the candidate data also, with the formal statutory documents called “Statement of Persons Notified” (SOPNs) being the main source of information about who is standing where. Again each council publishes these independently in slightly varying formats. Fortunately some grassroots democracy enthusiasts rally round the Democracy Club website to painstakingly go through each SOPN (across the UK) to create a single source of candidate data for elections. Not long after the 32 SOPNs were published in Scotland, the Democracy Club had collated the information on each SOPN into a complete set of candidate data. I saw there was still a gap to fill in presenting this data in an accessible form, so I took the framework used by @electionsNI and adapted it to the Scottish candidate data.

Where the lack of joined-up resources for election data was frustrating, the tools and resources available to work with boundary mapping is a different story altogether. This was my first venture into programming with map data and I was pleasantly surprised to find out how easy it is to work with, given all the freely available and well-designed resources you can use. Here are some of the resources I used to put together the mapping website.

  1. The Local Government Boundary Commission for Scotland publishes each council area as shapefile data packages, which is the raw material for GIS software applications.
  2. There is an open source application QGIS which you can use to load and manipulate these shapefile packages. It’s really easy to use – the ZIP files containing the shapefile data can be loaded directly.
  3. Most web-based mapping applications will need to read boundary data in latitude/longitude form stored in a GEOJSON datafile. THe Lat/Long coordinates standard used is technically referred to in GIS applications as EPSG:4326 (European Petroleum Survey Group). To extract this from QGIS, you load the shapefile ZIP package and then right-click its layer description and select Save As…. Choose GEOJSON as the output format and EPSG:4326 as the CRS (Coordinate Reference System), then browse for your output filename and click OK to create the GEOJSON file.
  4. The data from these boundary shapefiles can be very very large, particularly the coastal council areas, where every twist and turn along the coast and every little island must be mapped as polygons made of little straight lines from one point to the next. The likes of Orkney, Shetland or the Western Isleas were over 10Mbytes in size once the GEOJSON was extract from QGIS. Fortunately there is a fabulous online application called Map Shaper to effortlessly simplify this map data as we only need approximate boundaries for this application. Map Shaper can take several different data formats as input including GEOJSON with EPSG:4326 coordinates, so once the data is loaded, you can just select Simplify and use a slider to take the data accuracy from 100% down to the lowest level that preserves the general gist of the boundaries. Typically with could be anywhere from 8% to 2%, which yield great reductions in filesizes. Achieving this trade-off between mapping precision and file size is vital to building a website that is quick to present the maps and respond to user input.
  5. The framework implemented by @electionsNI made use of the Leaflet javascript module, which is a lightweight mapping library linked to Mapbox and OpensSreetMap.

The website http://council17.mulvenna.org went live at about 1am on Sun 16 April 2017 and was an instant hit with users, grateful at last to get a clear picture of who was standing where in the council election. The site was accessed by 10,000 unique IP addresses in the first 24 hours. I’m continuing to add features to the site in the run-up to the election on 4 May 2017.

“Rutherglen South is in the north-west of South Lanarkshire, which is to the east of East Ayrshire…”

Categories: Blog Tags:

Scotland, like a life-long smoker contemplating quitting

February 22nd, 2014 No comments

It struck me, the other day, that the Independence Referendum debate in Scotland feels like the internal dialogue in the head of a life-long smoker. Plenty of information detailing the benefits of kicking the habit is calling out to you, but you blot it all out by convincing yourself “I like smoking”, “it helps me relax”, “I can’t really see me stopping”, “I’ve always done it”, “I like to hang with all the cool people in the smoking zone” and countless other delusions you use to avoid making that leap of faith in your own will power and taking responsibility for your future. Once upon a time you reckoned you were a smoker and you were going to stay a smoker, but now you’re not too sure. You’re swithering – your kids are nipping your head about it almost daily now and for the first time, you can actually see yourself in a smoke-free future.

Alternative visions for Scotland

Alternative visions for Scotland

 

Clearly this analogy is a product of my own pro-Independence position and the fact that I decided to stop smoking earlier this month. It certainly paints the No campaign in a tongue-in-cheek unhealthy light, but I think it resonates with the current state of the referendum campaign. I believe we’re approaching a 50-50 tilting point in voting intentions and the momentum is only going in one direction: towards YES. The lifelong smoker is actually swithering – he or she can do this. It’s only really the fear of change and the path of least resistance that is stopping you. Smoking isn’t offering any life-enhancing vision for the future. There are so many reasons to ring the changes. It won’t be easy and there might be the odd slip-up in the transition, but a confidence is growing that a change of lifestyle is within your grasp.

Should Scotland be a non-smoker? On 18th September 2014, I’m voting YES.

Further Obstacles and Progress

September 19th, 2013 No comments

Initially i had just used variables for my character information but i decided ti would actually be a lot better if i used records so i created a character information record but after i had changed all the names within the program things like selecting the weapon no longer worked. after some time though i manged to change about the way in which the weapons were selected so that it now worked again and while i was at it deiced to add further code that would display an image of the weapon you have chosen, also the change to a record data format seemed to make the gender validation stop working but not the race validation which worked in virtually the same way and this problem is still as of yet unsolved. also recently i decided to add an inventory array and a poison item to be added to this inventory with more items that could be added later and this lead to me crating a system for which to apply this poison to your weapon which involved a button that could be pressed that appears when you gain the poison and the click of that button changes a Boolean variable to true and changes the image of your weapon to look as though it has poison on it and this will be important at the end of the game.

Categories: Eoghan Tags:

Obstacles

September 18th, 2013 No comments

I keep forgetting to blog after working on the program so I’m goign to sum up the main obstacles I have faced so far. Initially i couldn’t get the combo box i was using i my program to work and since i am doing a text adventure the input of your choice is quite an important bit so it was vital i got it working but for some reason it just would not work so i switched to a text box which did work but as you can imagine that meant that you could enter anything and if you did not enter the correct option the program would crash so i decided to try and make the combo box work again and it soddenly came to me how to get it working and then it started working. the next big problem was that i could not get the moving on from each stage based on the option you choose working since for some reason it wouldn’t use the variables correctly so i created3 universal variables that each option would be set two in each stage and that worked since that would mean after each section the variables would be correct and move on in the game and not just keep doing the same stage over and over again, i then used a case statement that would take you to the next stage depending on what choice you made. so i then had a working selection system and a working method of moving through the game. i will talk about the other obstacles I’ve come across so far and what other developments i have made so far tomorrow as this post would be very long other wise, so i’m splitting it into two

Categories: Eoghan Tags:

Project Propsal

September 10th, 2013 No comments

Advanced Higher Computing Project Proposal

For my Advanced Higher Project I intend to create a Text adventure game in which descriptive text will appear on the screen offering you choices and you can enter your choice and the output box on the screen will tell you what happened because of your choices and what you can do now. There is to be a basic interface with an output screen and a combo box so as to input your choice. There will also be a box detail your character details and further necessary buttons for interaction like save game and load game.

Categories: Eoghan Tags:

Advanced Higher Computing

September 4th, 2013 No comments

Advanced Higher Computing Project

Here I will be recording the process I make on my AH computing project. the different obstacles I have to over come and just to keep track of how I’m doing on the project.

Categories: Eoghan Tags: