Showing posts with label automatic knowledge. Show all posts
Showing posts with label automatic knowledge. Show all posts

Wednesday, 3 March 2021

Where's the Centre of Scotland?

A little bit of map trivia today, inspired by a recent exchange on Twitter and also because it served as a useful training exercise for my new training courses. It's also related to a previous blog post from last year on Scotland's 'pole of inaccessibility' (near Braemar, since you ask), as well as other exchanges here and there (exhibit a, exhibit b). Okay, so let's start with a map of Scotland showing a variety of different 'centre' points, and then I'll work through each of them until I decide which I think are the right ones. One conclusion: the 'central' belt might need a new name. Another conclusion? Dollar could launch a whiz-bang marketing strategy that includes the words 'The Centre of Scotland'.

Dalwhinnie? Dollar? 

The answer to the question 'Where's the Centre of Scotland?' does of course depend upon how you define it ('it' being both 'centre' and 'Scotland'). I'll leave the question of marine areas out of this discussion and say that I'm only going to focus on the land area of Scotland - from Shetland in the north, out to St Kilda in the West and to the Mull of Galloway in the South. The most easterly point is also in Shetland.

Let's start with the slightly unusual ones.

This is the centre of Scotland based on Scotland's 'minimum bounding circle'.

Off the coast, near Buckie

What about the centre of Scotland based on the 'minimum bounding box'?

Closest town is Dingwall

How about if you orient the bounding box more naturally, to fit Scotland's shape rather than doing it on a north-south axis?

On land, between Buckie and Keith

Now, these ones so far can make some sense (at a stretch) but they are all large shapes. What if we use a 'convex hull'? This is of course a tighter shape, and should give a different result.

Munlochy - in the middle of the Black Isle

Okay, how about the point furthest from the sea? Well, this is known as the 'pole of inaccessibility' (whether on land or sea) and here it is. You can read all about it - and see pictures of it - in my blog post from last year. For the centre point of the mainland, that's a different calculation but I believe it is near Schiehallion.

Very close to Braemar, in the Cairngorms

Okay, these are all very interesting, but what about the centre of Scotland based on a) landmass and b) population? Okay, here you go.

A little bit south of Dalwhinnie, off the A9

Just outside Dollar

Here are a couple of zoomed-in views of the Dalwhinnie/Trinafour geometric centroid of Scotland and the Dollar population-weighted one.

You can easily see this from the road


I have double-checked this, seems legit

I also did a 60 minute drive time check to see what can reasonably be reached from Dollar within an hour - here's the map of that. The population within the light area in the map below is just over a million, within reach of Dollar.

The million Dollar population question

Here's the first map again, but this time with some place labels on it. I also have a web map version showing just the two most logical centre points (the geometric centroid and the population-weighted one).

The centres of Scotland


Nerd notes: are these calculations correct? I believe so. I have double checked and I did them based on the highest resolution Ordnance Survey data available. I also did them using much lower resolution, generalised data and got almost exactly the same results. Search the web and you'll quickly find the Centre of Scotland Wiki article, which would appear to corroborate the A9 location. 

I couldn't find anything at all online about Scotland's population-weighted centroid - possibly bad at searching - but I did these calculations using two datasets. One was a 1km gridded population dataset of Scotland from 2011. The other was a set of data zone population-weighted centroids from 2019. Both calculations put the location of the population-weighted centroid outside Dollar. It also makes sense when you look at the population distribution of Scotland, as in the travel time map above.

Why do this? I am running a new series of training events on data, maps and analysis so this was a useful training dataset, plus I'm Scottish and was curious about the topic.


Saturday, 30 January 2021

New QGIS training courses for 2021

A short post today about the new training courses I'm launching as part of my new business (Automatic Knowledge). In late February and early March 2021 we're putting on the first of our public QGIS training courses, as well as one in Aerialod. These are paid events, bookable via Eventbrite and are part of our mission to help improve geospatial software skills across the world. We'll make the training material available for all, plus the data - and we will continue to offer financial support to the QGIS project as a 'sustaining member' - as well as make further donations to the Aerialod project. The permanent url for our training pages is automaticknowledge.eventbrite.com and right now you'll see the first five courses advertised - all of which will be repeated on a fairly regular basis. Note: we offer discounts based on where you are in the world, plus a 50% discount for all students (the 50% student discount is in addition to any country-specific discount). Obviously this isn't a perfect solution but we do want to make our pricing structure as fair and accessible as possible. Feel free to get in touch if you have any questions - you can contact us here.

See our global pricing policy

You'll see full details of each course on the Eventbrite page. For now, we are running them online - see below for a brief look at each of the five courses - three are full day courses and two are half days. When the world opens up again we'll still be doing them online but will also start up our in-person training sessions again.

Our first five training courses


I've previously put on lots of public and corporate QGIS training events, as well as delivering thousands of hours of GIS training in Universities. Now that I've launched Automatic Knowledge I want to continue to do this as much as possible, so this is part of the reason for launching these public sessions. Part of my motivation also has to do with the fact that - in the UK at least - there is something of a skills gap in relation to geospatial skills - e.g. see p.8 from the 2019/20 Geospatial Commission Annual Plan.

I agree that there's a need for better skills


However, I'm not trying to turn everyone into a geospatial nerd, honestly. I just think that whilst many of us have access to great open data, and fantastic free and open source software like QGIS, there aren't always enough people with enough knowledge and skills to do the kinds of things they might want to. I've seen this need grow over the past few years as I've put on training courses for a variety of organisations - including the BBC, the FT, Savills, Regeneris, as well as teaching people who work for large global organisations such as Google. In addition, I always try to help people who come to me with queries and questions about tutorials I've posted previously on my blog - this happens on a fairly regular basis from people in different parts of the world (e.g. recently I helped people from Colombia, Bhutan and Nigeria with GIS-related queries).

With all of the above in mind, I can probably summarise my general training principles now, with a few bullet points.

  • Not for nerds: what I mean by this is that the Automatic Knowledge QGIS (and other) training sessions are not aimed at the uber-nerd but at competent IT users who want to get more into geospatial tools but are not really sure where to start or how to move beyond the basics. Even so, if you do self-identify as a nerd already you are still very welcome!
  • Fun - I really do think it's important to try to have fun, or at least enjoy things as you learn them, so this is an important part of my approach.
  • Fairness - it's difficult to offer an approach to timing (e.g. the first courses are on UK time) and price (I realise not everyone can afford full price) that helps everyone, so I have adopted a varied pricing structure so that it can at least be a little bit fairer than a flat global pricing structure. I also plan to put on sessions in other time zones - and in person when this is allowed again.
  • Inclusive - I welcome anyone and everyone, no matter who you are or where you come from or what you know or don't know. My view is that the geospatial world - particularly in education - should be about encouragement, positivity, mutual support and openness. 
  • I don't know everything - this is obvious, but important. Sometimes during a training session someone will ask 'what does this tool do?' and the answer I have to give is 'I don't know'. Sometimes this happens, but you may also be glad to hear that I do know quite a lot about the software I teach - but I realise this is all relative and I continue to look on in awe at so many people in the geospatial world. I'm always learning, and in cases where I do have to say 'I don't know', I always end up learning more in the end.
  • Flexibility - my training sessions are based on a very carefully prepared, tried-and-tested workbook format. This works really well but there is always a risk that it can turn us into robots - so I always make sure we can go off at tangents, explore new ideas and tools and generally get to grips with the software in a way that makes most sense for the user. 
  • Giving back - a cliché, I know. When people do my training sessions, they pay for my time and expertise developed over many years, but I will continue to share my knowledge more widely on my blog, on Twitter and elsewhere. I am often found in Twitter DMs sharing my knowledge or tips with users from across the world. Right now, Automatic Knowledge is in the 500+ Euros per year category of QGIS donors, but we always want to give more - our last donation to Aerialod was $200USD and we plan to continue to donate to the project. 

The courses currently listed on Eventbrite

Right now we're working on finalising our new training material (see below for a peek) and we're really looking forward to getting started. You can see who 'we' are on our website. The idea is to start small and then grow slowly over time as things develop. The training side of the business is only part of what we do but it is a very important part of our overall mission.

This is our intro-level QGIS course

We're currently using QGIS 3.10

Part of the intro section

A few introductory words

Finally, I've recently been re-writing my 'QGIS tips and tricks' sheet and thinking about a) what I know, b) what I think is important for users in different contexts, and c) how amazing QGIS is. Here are my notes on that so far - only some of this is going in; the rest will be part of different levels of the courses.

Messy handwriting, sorry

So, if you're looking to get into making maps from data, or want to get better at it, or just want to talk about it, feel free to get in touch with me.


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.


Friday, 28 August 2020

Automatic Knowledge

This is a short blog post about what I'm doing next, now that I have moved on from my job as a professor at the University of Sheffield. It's not going to be a self-indulgent retrospective, it's more for information and a bit of reflection. From 1 September 2020 I'll be working on my own business, Automatic Knowledge Ltd. 

Take a look at the website to find out more, but I'm going to be doing similar kinds of things (maps, stats, analysis) though instead of working mainly within academia I'm mostly going to be doing this with other organisations and businesses. I was doing some of this already and in fact it was taking up more and more of my time so I decided it was time to make the move. 

Oh, but since I really like teaching (and learning) I'm going to continue to offer my QGIS courses - see the Training part of the website for more on that too. I've already done these for Savills, the BBC, the FT, Regeneris and more.

The Automatic Knowledge website

What's that you say? Brand identity? Corporate logo? Well, I'm not very big on all that but if you see something that looks like this (below) on a map or graphic or chart from now on you'll know it comes from me and my team (talking of which, I'll be working with a couple of former associates from now on, as projects require it).

Why 'automatic knowledge'? Read more here

People keep asking (really) so I'm opening a small print shop as well


Anyway, that's what's next and I'm very much looking forward to it - expanding my consultancy work, building on existing relationships and making new connections. 

Get in touch via the Contact page on the website, via LinkedIn or via Twitter if you want to start a conversation about consulting work.

Free stuff
In my previous job I liked to share as many free, useful resources as I could with the wider data and spatial analysis community, and I'll continue to do that with Automatic Knowledge. It's a small gesture but I know many people have found my resources useful - because they've told me about it. So, on my new website, I have also added a Resources section where you can find the following datasets. It's all already available as open data but in all cases I have added to the original with useful extras. I will also continue to try to give back to the open source GIS world in the form of financial support to the QGIS project. I've done this before and in fact that's the only time Automatic Knowledge has been seen online previously, though in this example it was before I set it up as a formal business. I'd only used that name for anonymous donations in the past.

  • A set of geofiles (shp, gpkg, geojson) of all places in Great Britain - more than 40,000 of them. There are also some more useful goodies here, like a fully-formed QGIS project and instructions on how to style and filter the data.
  • My popular 'All buildings in Great Britain' layer. You can get this online already in small chunks but I have put it all together and also added for each feature information on which local authority it is in and the floor area of the building footprint. This is a geopackage (gpkg) only because of the size.
  • A 'UK local authorities (2020) with data' file. I've added a number of fields to the dataset, including ones to indicate what country or region an area is in, plus the latest ONS population estimates (mid-2019) for each area, broken down by single year of age. There is also a field indicating what kind of area each local authority is (e.g. London Borough, Unitary Authority, Non-metropolitan District). I've made this layer available in shp, gpkg and geojson formats.
This is a preview of the GB buildings file


Looking back, just a bit
I'm not really one for looking backwards, or for sentimentality, but it appears that I worked at the University of Sheffield for a total of 4,320 days (about 12 years). I'm also not one for deleting emails and I can tell you that I received a total of 190,020 during that time (using 71.67 GB of inbox storage space, despite deleting tons of attachments). 

Using a sophisticated mathematical formula to crunch the numbers, I can tell you that this equates to an average of 44 emails a day. Now, in the early days I wasn't getting as many as I did at the end, but I tried to answer them all, honestly. But really, why am I talking about email? I have no idea.

Anyway, if you email me now at my University address you'll just get an out of office (forever) autoreply and a picture of the Western Highlands of Scotland. 

A typical blue sky day in the Highlands


If you were a student during my time at the University of Sheffield, I just want to say thanks. Teaching and interacting with students was one of the best things about it and I feel like I learned a lot about myself, life, others, and so much more. I'm still in touch with many former students, so I hope that continues - even if it's just to ask me for a reference. I 100% enjoyed marking every piece of work you all submitted (plus or minus 75%). 

I'm so proud that so many former students have gone on to do great things, or just to figure out that they really weren't that into urban studies, planning or GIS in the first place - there are many roads, and finding the one you want to be on can take time! I can't take any credit for this, but it's good to have been able to join you for part of the journey.

Talking of students, see below for a 2009 Lille field trip photo - quite low resolution, unfortunately, but then again it was taken on one of those custom-built 'cameras' we all used to take photos with. 

I can't name absolutely everyone because the resolution is too low, but I will at least give a shout out to Rebecca (far left), Grant (front, crouching), Isaac (double wave, far right), Liz (middle-ish) and Justine (also middle). As for the small boy in the plant bit of the sculpture, I have no idea who he is but he wasn't a Sheffield planner. Talking of the sculpture, it's the Shangri-la tulips sculpture by Japanese artist Yayoi Kusama in the French city of Lille, right by the Eurostar station (the glass building in the lower background).

Click to enlarge - or click here instead



Right, that's more than enough of that.

I'm going to take a very short break and maybe do a little bit of Highlands and Islands touring before I get back to work on the projects I have lined up, but feel free to get in touch if you think I can help with any analysis, maps, stats or research.