Friday 15 January 2021

Which football team is nearest me?

Today's post combines points, pointlessness, science, football, maths and maps - the perfect combination. It's based on the perennial 'which thing is nearest me?' question and does it in relation to teams in the English men's football pyramid that were scheduled to compete in the 2020-21 season (this includes a small number of Welsh teams that play in the English football league system). The main things we made are two interactive maps showing which teams are nearest anywhere in England and Wales (top flight version and tiers 1 to 8 version - oh go on then, here's another one for the top four leagues). This was a little Automatic Knowledge side project that came out of a conversation between Philip Brown and me last September. It's really just a bit of map fun with a dataset Philip put together that we thought was quite interesting - we have no secret agenda. Or maybe we do. We don't. Or do we?

This is how the polygons work and what they mean: all areas within a polygon are closest to the team (shown as a point) within the same polygon. In the examples below we've added an indication of the underlying settlement pattern as well, just to show where people live. In the first map below, everywhere in the bigger yellow shape is closest to Everton and everywhere in the smaller yellow shape is closest to Brighton & Hove Albion. Note that in season 2020-21 Everton is the only top flight team that has parts of England, Scotland, Wales and Northern Ireland closest to it. Already knew that? Keep reading, we have more.

For each team, you can see the area closest to it

Same map as above, but minus the yellow explainer areas

Now, if you're a bit of a boffin you will at this point have several questions, including 'does anyone play in purple?' or 'how many teams begin with the letter b?' (54, presently more than for any other letter of the alphabet amongst clubs in the top eight tiers of English men’s football). However, top of the list might be 'I wonder how many people live in each area?'. Well, we did some calculations for this using the most recent Office for National Statistics mid-year population estimates (for June 2019) and got some answers. We used population-weighted LSOA centroids (covering small areas) so this gives us final estimates that will be reasonably accurate. 

As you can see in the tables below, we calculated that for 12.6% of England's population, Southampton are the nearest top flight team this season - that's over 7 million people. We didn't expect Tottenham Hotspur to be second, at 9.4% (over 5.3 million people), but that's what we get, because the Tottenham wedge takes in much of the East of England. In the second table below you can see the same data but with the entire population of England and Wales included, just because there are a small number of Welsh teams who play in the English football league system. 

Incredibly important data

Even more important data

Here's what the areas look like zoomed-in a bit on the top flight interactive map (below). You can see from the table above that in the blue wodge (Chelsea) the population adds up to almost a million, because of the high density in west London. Almost 1.4 million live in the Arsenal wodge on the top flight map. But we're not writing about population density today so let's look at some other stuff.

Almost a million people live in the Chelsea wodge

The nearest English top flight team this season if you live anywhere in Scotland? Well, let's just say that nobody can call you an Everton glory hunter if you're a Toffees fan from Stranraer. Burnley comes close, but doesn't quite touch Little Ross island. For everyone else in Scotland, Newcastle United are the closest team, which is not surprising.

Dumfries and Galloway - Everton territory?

We extended the polygons beyond the boundaries of England, but of course everywhere has their own leagues and teams - this was just to make sure all of England was covered, but it overlaps other countries too. We're not suggesting everyone in Brugge/Bruges should be a West Ham United fan (although, feel free). See the nerd notes at the bottom of the page if you want to know more about the method, but the shapes are called Voronoi polygons (also known as Thiessen polygons and for maths boffins more commonly Voronoi diagrams). You put a line half way between each set of two points and then construct a whole set of polygons based on this simple geometric principle. See below for how this looks in Merseyside, where Liverpool's Anfield and Everton's Goodison Park are only about 1km apart and the dividing line is half way between the two grounds.

The red and blue 'halves' of Merseyside

And below, here's a little more zoomed in detail of London so you can see how the polygons are constructed. Again, half way between each point pair a line gets drawn and then all the lines are joined up until they intersect and make polygons. 

Half way between each pair of dots, you see a line

Okay, you get the point, but there's more to football than the Premier League, right? Yes, so we decided to do lots of leagues, but which to include and which to leave out? In the end, we decided - after some discussion - to include tiers 1 to 8 of the English football pyramid. Once you go below the 8th level the number of football clubs really skyrockets, plus we've just had an 8th tier team (Marine AFC, of the Northern Premier League Division One North West) play a top flight team (Tottenham Hotspur of the Premier League) in the FA Cup for the first time ever in the competition’s 140 seasons, so it seemed like good timing. Here's a screenshot of the interactive map that includes the top eight tiers of English men's football.

This is not pointless

We've also shared a spreadsheet that tells you how many (and what %) of the population of England and Wales live within each polygon.

Everything you ever wanted to know

Of all the English teams in tiers 1 to 8, the team with the highest population in its Voronoi polygon area is Arsenal, with approximately 1.3% of the English population. Leicester City and Tranmere Rovers are the only other English clubs with a figure of more than 1%. In Wales, about 28.6% of the national population fall within the Swansea City polygon and about 27.1% fall within the Cardiff City polygon - however, caution should be exercised when interpreting this data for Welsh teams as most Welsh football clubs do not play in the English football league system but instead play in the Welsh football league system. But, returning to England, spare a thought for Swindon Supermarine of the Southern League Premier Division South, wedged between Highworth Town and Swindon Town, with a polygon population of just under 21,000. That’s the smallest local population for any team in the top eight tiers of the English football league system.

Swindon Supermarine FC

This all leads us off-topic to the seemingly weird and wonderful names of some of the teams. Or at least they can sound weird and wonderful if you've never heard of them. Talking of which, I'd like some AI/machine learning guru to go full-on Bobson Dugnutt on English football team names, if it hasn't been done already.

Here's a selection of some of my favourites, staring with Swindon Supermarine:

  • Swindon Supermarine - a full tier above Marine FC 
  • Corinthian Casuals - they are of course pretty famous though
  • Whitehawk - from a suburb of Brighton
  • Prescot Cables - again, pretty famous and they've been around for a long time
  • Loughborough Dynamo - I just love their name (I believe named after Moscow Dynamo)
  • Three Bridges - but just one football team, based in Sussex
  • Folkestone Invicta - am really hoping they get to play Blyth Spartans some day
  • Dorking Wanderers - in the sixth tier, the National League South
  • F.C. Romania - in the eighth tier, founded in 2006 by Ionuţ Vintilă

Whitehawk FC

This turned out a bit longer than intended and we have loads more stuff but I think I'll leave it there for now - possibly forever. It will go out of date soon enough once the 2020-21 season ends and teams move up and down the various tiers of the English football league system, and in and out of the Premier League.

As for me, I'm a season ticket holder at Thrumpington Olympians, who may or may not be a real team but hopefully someone like Dan Hon can train an AI to generate football team names as a next step in this important scientific quest. 

To end, I should add that I have no strong opinions about what teams people do or don't support - however near, far, successful or futile they may be. This piece is just what happens when I end up discussing random 'I wonder what that would look like' ideas with similarly-inclined colleagues and have a bit of spare time to find out the answers.

Nerd notes: this is my favourite video about Voronoi diagrams. Note that Georgy Voronoy (spelling is different for the polygons but it's the same dude) was Ukrainian and, as it happens, a student of Andrey Markov - part of a chain, you might say. I also like this little Voronoi software demo with Theo Gray. Philip Brown located all the football team grounds from the Premier League all the way to the eighth tier, and beyond, but we just used the top 8 tiers here as you can see. We made the Voronois in QGIS (it's really easy) and the web maps were made with Tom Chadwin's qgis2web. Colin Angus did a nice version of the top flight map in November, and thankfully our shapes match his. Guus Hoekman also has some code for doing similar things, if you want to have a go.

The colours on the top flight map are from individual teams - if not the first colour, then a different one from their badge. The tier 1 to 8 map uses the red and navy blue shades from the FA website. As noted above, I'm informed that no team in tiers 1 to 7 plays in purple as their first choice kit (thanks to Philip, once again) but we didn't want to have a purple map. [Side note - City of Liverpool FC, of the 8th tier Northern Premier League Division One North West, chose to play in purple due to the fact that the city's two Premier League clubs (Everton and Liverpool) play in blue and red respectively and when blue and red are mixed, they make purple!]

Loads of people have done this kind of thing before, with football in England, major league teams in the US, and many more. Ours is just for fun, using the most recent data for the top 8 tiers of the men's football league system. What about tiers 9 and 10!? If we'd included tiers 9 and 10 we'd have had to add more than 650 teams - when our current dataset for tiers 1 to 8 only has 382 teams in it. Did you think about doing a travel time one? Yes, we've done this too and may share that in future, we'll see. This post is long enough already. Note that 'nearest' here relates to straight line, as-the-crow-flies distance, or what is also known as Euclidean distance, after Euclid, the famous Greek centre forward (possibly) and geometry genius (definitely).

Finally, for English data boffins, the mean population of an English LSOA from the 2019 mid-year estimates is now just under 1,714 people. The lowest population of an LSOA is in Hull, with 679. But the highest - and this is EXCITING - is 16,004 in Newham in East London.

The base map on the web map is © OpenStreetMap contributors, used under the CC-BY-SA licence.