Sunday, 20 August 2023

GB railway stations + nearest station

I'm sharing a file of the location of all railway stations in Great Britain, put together from Table 1410 of the UK's Office of Rail and Road (ORR). So, clearly, a momentous occasion. I published something similar years ago and I see people still using it but the old one doesn't have new stations like Reston, Inverness Airport or Marsh Barton in it. Oh, and I also calculated the nearest station (as the crow flies) for each station, just out of curiosity. Here's the spreadsheet. 

The real blockbuster of the summer

I posted a few maps I made of this on my twitter, as a kind of annoying map quiz - these are copied below too. What on earth are these maps showing? Well, for each of the 2,573 stations in my dataset I simply drew a line to its nearest station. Sometimes the lines are reciprocal - e.g. for Aberdeen, Dyce is the nearest station as the crow flies, and for Dyce, Aberdeen is nearest. In these cases the lines on the map look a bit glowy because there are two overlapping each other. But this kind of thing isn't always the case. That's why the maps look kind of disjointed and weird.






Now, if you can't be bothered clicking on to the spreadsheet then here are the numbers on furthest gaps between stations and also nearest to each other according to my calculations. And remember that a) this is straight line distance, as the crow flies, and b) it doesn't mean you can actually travel between these station pairs. It's purely a measure of how far away - in a straight line - the nearest station is.

  1. Malton to York - 27.4 km / 17.0 miles
  2. Stranraer to Barrhill - 26.1 km / 16.2 miles
  3. Wick to Georgemas Junction - 22.2 km / 13.8 miles

and at the bottom of the list

  • Catford to Catford Bridge - 0.09 km / 0.06 miles
  • Catford Bridge to Catford - 0.09 km / 0.06 miles
  • St Budeaux Victoria Road to St Budeaux Ferry Road - 0.12 km / 0.08 miles


Hmm, but what about actual distance along the railway? Could we try and figure this out? Yes we could. But first here's a map or two comparing the longest straight lines to how bendy the real lines are.


Bendy

VERY bendy

Surprisingly bendy

And my quest to find the longest gap between stations - again, regardless of whether you can get a train from one to the other - has led me to the following maps.

More interesting if you're into this stuff

I do believe we have a winner

Not very bendy, so similar distances

Okay, so, to sum up.

  • Some stations are far away from others.
  • Some stations are close to others.
  • Some stations are even further away if you are a train.
  • Malton to York is the 'furthest nearest' station gap at 27.4 km / 17.0 miles
  • Stranraer to Barrhill is the 'furthest nearest' station gap if you follow the railway line, at 41.4 km / 25.7 miles.
  • Coatbridge Central and Highbury & Islington are both the nearest station - as the crow flies - to four other stations. That's more than any other.
  • What about tube stations, tram stops, subway, etc? I'm only looking at the national network of rail stations included in the ORR data here so that's not part of this.



The clue is in the name!

Centre of a universe


Another more bendy one




Monday, 14 August 2023

Global terrain maps

A short post today, with some visuals. I used some Blue Marble imagery from NASA - one layer was topography and the other was the colour image of the earth for August - and then I used the prelease v2 of Aerialod to visualise it. I tweaked the Blue Marble colours slightly and the elevation and bathymetry (in the final images) is greatly exaggerated, for effect.

I had a bit of fun with this. And this is the result.

NASA Blue Marble + topography

A few bumps in Europe and North Africa

Some nice colours and interesting bumps here

A view across most of North America

A slightly different angle on South America

I quite like this perspective, very interesting

Gosh, The Himalayas are quite big

So many mountains here!

Another pretty interesting view

Same as the first one, but with a few more light effects


That's all for now :)

With exaggerated bathymetry too

Classic mid-Atlantic wrinkles

Maps without New Zealand should not exist


Thursday, 13 July 2023

A new UK constituency hex map

There are new constituency boundaries in the UK so we made a new hex map. This means that the ones used in previous elections have been replaced by a new set. There are still 650 constituencies but they are in many cases quite different so any election boffins/mappers will need to get used to them, and their new shapes and names, pretty quickly. Take a look at this interactive map if you want to compare them (will load slowly, is best on big screen). When is the next UK general election? Well, nobody knows the date but it has to be no later than 28 January 2025. Philip Brown and I knew all this was in progress because we keep track of these things - particularly Philip - so many months ago we began the process of creating a new hex map, which you can see below. After that I say a bit more about the process of putting this together. Here's the direct link to the geo files if you want a shp, gpkg or geojson of the new hex map. Don't like hexagons? See this new video on my channel for how to change them to other shapes.


The new hexmap - web version


Search constituencies by name

A bit of preamable

You can make these things automatically, programmatically, algorithmically etc etc but the results will normally be very sub-optimal. Why? It's because of the difficulty of putting the hexagons together in a 'least-worst' configuration. They are all in the wrong place, but some are less wrong than others. That is, hex maps are about portraying each area with a shape covering the same area rather than geographical accuracy. 

Why? Because sometimes we want to size things by population rather than land area, but this means we have to sacrifice overall shape and individual area locations. But you probably already know all about this if you're reading my blog.

Each constituency has (very roughly, and with a few notable exceptions) a fairly similar population. Here's what the Parliamentary Constituencies Act 2020 says about it.

The Act sets out a number of Rules in Schedule 2 which are relevant to the detailed development of proposals for individual constituencies. Foremost among these is Rule 2, which provides that – apart from five specified exceptions – every constituency we recommend must have an electorate (as at 2 March 2020) that is no less than 95% and no more than 105% of the ‘UK electoral quota’. The UK electoral quota for the 2023 Review is, to the nearest whole number, 73,393.

Accordingly, every recommended constituency (except the five ‘protected’ constituencies) must have an electorate as at 2 March 2020 that is no smaller than 69,724 and no larger than 77,062.


The four Boundary Commissions in the UK published their new electoral maps (after previously publishing the initial proposals) in June 2023 and then we finalised the process. There are a total of 650 constituencies, just like before, with the following number in each country of the UK.

  • England (543)
  • Northern Ireland (18)
  • Scotland (57)
  • Wales (32)


The process of making this hex map

The process of making the map involved the following things, with me proposing the idea to Philip initially because he's really an electoral genius with boundary knowledge that quite frankly I'm surprised can be contained in just one brain. Anyway, he took up the task and got to work and we have our initial 'final' set - though as you can see from the web map url we consider this a 'beta' release because we're very aware that we are capable of making mistakes, even if we did go through a fairly rigorous quality assurance process!

Okay, so here's what we did. Then below that you'll see some images of how this all worked, including a few WhatsApp screenshots as proof of the level of thought behind this (and probably also evidence that we may need new hobbies).

Here's how we did this
  1. Meet at Dunkin Donuts many months ago to discuss doing this.
  2. Create blank hex grid in QGIS.
  3. Agree that we should start with final shape in mind.
  4. Agree that out of all previous UK constituency hex maps Ben Flanagan's (Esri UK) shape was the best shape, so model ours on that.
  5. Agree that we should generate a unique three letter code for each hex - so that (e.g.) we can label each hex within the shape and because official names often too long!
  6. Get loads of sheets of A2 and A3 paper printed with blank hex grids on them.
  7. Leave Philip to do his thing.
  8. Meet to discuss from time to time.
  9. Let Philip get on with it, region by region (England) and then UK countries.
  10. Monitor initial proposals from Boundary Commissions.
  11. Come up with final configurations on paper.
  12. Spend day working together on converting paper into digital.
  13. Revise, tweak, move a few polygons, re-shape Northern Ireland, move things around a little bit.
  14. Check for errors, duplicates, typos, and suchlike.
  15. Check again, then generate geo files for sharing (shp, gpkg, gejoson).
  16. Make web map available, as well as file repo.
  17. Add ONS area codes as soon as they become available (not sure when this will be).

That is more or less it, but it took many months and most of the hard work here was done by Philip. 


Some photos and screenshots for anyone who might be interested

It was quite an interesting process. Working on paper was actually very useful so we'd recommend starting with a final shape in mind plus some big bits of hex grid paper if you are trying to do this yourself, but really all the hard work is in figuring out how best to arrange the hexagons. This is what takes so long. Imagine if you had a Word document with 650 text boxes in it and you move just one box - everything else gets totally messed up. Well it's a bit like that. A real headache. All maps are wrong. All hex maps are wrong. But we created the least-wrong hex map we could and we hope others might use it and find it useful.

Happy mapping!