Showing posts with label Scotland. Show all posts
Showing posts with label Scotland. Show all posts

Thursday, 6 April 2023

The longest straight line in Great Britain (without crossing a public road)

In short, I believe I've found a longer straight line without crossing a public road than the line identified by Ordnance Survey in 2019. Important stuff, clearly. Let me explain.

**Update, 8 April 2023: I've added a Part 2 to this now, where I find an even longer line in the same area. Also, be very careful if you try this route because it won't be at all easy and you may also be eaten alive by midgies, as well as all the other hazards like bogs, hills, snow, cloud and so on.**

This is a longer straight line than the one below

Back in 2018 someone asked Ordnance Survey a question on Twitter, as follows:

"what (and where) is the longest distance you can walk in a straight line in England/Wales/Scotland without crossing a road (defined as a paved surface for vehicular use)??"

Note 'a paved surface for vehicular use'. This is the most important bit for me and the reason I'm coming back to it again after years of working with this data and never quite finding time to investigate, until now.

It's an excellent question. The answer the OS team provided was then turned into a blog post on the OS website in early 2019, and you can read that here but see below for their map. There's also a fantastic short film of Calum Maclean and Jenny Graham walking the route. 

71.5km or 44.43 miles

Now, let me say a little bit more. I'm from the Highlands, know lots of this area pretty well from my days cycling around it on my mountain bike when I was a teenager, as well as loads of other trips over the years for all sorts of reasons. I also spend my days looking at map data because that's a big part of my job and because of that one thing troubled me a bit about this answer from Ordnance Survey. 

To be more precise, once again, it's the 'paved surface for vehicular use' part of the answer. I'll explain all below and my maps are very rough and quick but you'll hopefully see what I mean. 


The roads data

Ordnance Survey provide loads of great open data these days, and one of those products is their OS Open Roads product. Load it into your GIS software and it looks like the image below. You can see from just eyeballing it where the biggest gaps in the road network are - unsurprisingly, all in the north of Scotland. There are some gaps in England and Wales too but here I'm trying to find the longest straight line between roads in Great Britain so I'm focusing on the north of Scotland. The longest line in Great Britain is also the longest in the whole UK, because the density of roads in Northern Ireland is such that there's nowhere even remotely as long as the line above there.

All roads in Great Britain


This OS roads file is about 2GB in size and is really useful. However, when I've run different kinds of network analyses on it I sometimes run into problems because it also includes roads that are not public. These are typically flagged as 'Restricted Local Access Roads', and I've shown some of these in the zoomed-in map below in purple. You may think by looking that these are 'roads' but in reality they are usually unpaved private tracks but more on that further down the page. 

Restricted 'roads' in purple here

What do these restricted roads look like on the ground? Well, you can take a look via Google street view a lot of the time, and you can also get a sense for what public roads are just by hovering the street view icon over the map, like I've done below.

A much better representation of public roads

For example, if you travel down the road along the River Findhorn, you'll eventually get to the end of the public road. You can of course keep going on foot or on your bike because of the laws on access in Scotland but you can't drive down these routes (unless you have permission). 


The end of the public road


Another 'Restricted Local Access Road' - see what I mean?

If you download the roads file and then make public roads one colour (blue) and then the restricted roads a different colour and then make a head-splitting gif of the result, this is what you get. Study this for a while and then you start to wonder if you can find a longer line than the OS one from 2019. Sometimes restricted access roads are in places like caravan parks, cemeteries, and the like - but in the Highlands they are often in the hills too.

Loads of restricted access roads (purple) on the map

Using what I would consider to be the 'correct' OS roads file - i.e. the one in keeping with the original question and in keeping with the concept of public roads - I can get a longer line in the original Cairngorms route too, see below. Let's worry about distance over undulating ground later on.

I can get a distance over 74km (straight line) this way

But with my glasses on I could see a potentially longer route, that just missed a couple of public roads, this time to the west of the A9 instead of the east. That's the map I posted at the start, and again below.

From the A9 to near Fort William, a nice walk

I've added terrain to this one, to show how tough this would be

Here's a height profile for anyone mad enough to be thinking about doing this route. It looks horrendously tiring and almost certainly quite dangerous unless you're a bit of an expert. Units are in metres below and the max is just about 3,000 feet, with lots of ups and downs. How much distance does this actually add to the straight line? 

Well, it's never as much as I'd think and it depends upon the accuracy of your terrain model but using the publicly available OS Terrain 50 dataset I get a distance of 77.0 km / 47.8 miles for this so a bit longer than straight line distance. I calculated this in QGIS using the Saga 'Profiles from lines' tool. 

A nice wee stroll

Anyway, that's what I get when I look at the data. A bit longer than the OS answer, but that's because I've tried to stick to the spirit of the original question. Get a different result? Found a mistake? Feel free to let me know.

Not easy

All these options are over 75km, and none are easy!

Data source: © Crown copyright and database rights 2023. © OpenStreetMap and contributors

Want the line file to play around with? It's in this folder, in geojson, gpkg, gpx and shp formats. File name is longest-straight-line-candidate followed by the various file extensions for each type.

Interactive map version of my original line 

How could you systematically, definitively find the longest possible route? With some difficulty but it could be done. My map above involved converting OS open roads to polygons, then vertices then connecting vertices then measuring the longest lines and so on. It's not a trivial problem to solve with 100% accuracy, at least not for me.

Sunday, 21 March 2021

Munro maps and stats

I've been working on this on and off for ages, so I think it's time to publish what I've got and then move on. See below for a collection of maps and stats relating to Scottish Munros. You what? Just in case anyone reading this isn't aware, a 'Munro' is a mountain in Scotland with a height of 3,000ft or more, or 914.4 metres in modern parlance. The reason we're not using metric measurements here is that Sir Hugh Munro published his first list of peaks in 1891. Anyway, let's start with a simple map of all 282 Munros and then I'll look at how many are within 100 miles of Scotland's cities, and within a 90 minute drive + 5km. I also generated a distance matrix so you can see how far each Munro is from all the others - based on this measure, Beinn Teallach is the most central Munro (it's only just barely a Munro as well, by about 25cm).

All 282 Munros
Nine of them are above 4,000ft

In the maps above, I have used Ordnance Survey Terrain 50 data to create the terrain effect, and I made the maps in QGIS. I did a bit of post-QGIS processing to add a bit of 'noise' and also to recolour the maps, but the mapping was done in QGIS, like I said. I used the Scotland digital terrain model I created and have shared on my new business website, over at Automatic Knowledge. For the location of Munros, I used The Database of British and Irish Hills v17.1, which is really great.

The next thing I did was decide to look at how many Munros were within 100 miles of major cities - for this I chose Aberdeen, Dundee, Edinburgh, Fort William, Glasgow, Inverness, Perth and Stirling. I added in Fort William to the mix because even though it's not as big as the others, it is right in the heart of all the Munros so it would have been daft to leave it out. By my calculations, here's how many Munros there are within 100 miles of each of these places - and see below that for the maps of each one. The point in each places that I measured from was where the Ordnance Survey data I used put the place point - generally right in the city centre.

  • Aberdeen - 95 Munros within 100 miles
  • Dundee - 201
  • Edinburgh - 171
  • Fort William - 280
  • Glasgow - 203
  • Inverness - 282 (all of them)
  • Perth - 232
  • Stirling - 226








What about within 50 miles? 100 miles as-the-crow-flies gets you quite a long way, but given the terrain it can be a lot longer than that when you are actually trying to get there. So, I looked at it using a 50 mile buffer as well - see below for the data on that, plus the 50 mile maps for Fort William and Inverness.

  • Aberdeen - 10 Munros within 50 miles
  • Dundee - 55
  • Edinburgh - 3
  • Fort William - 193 (68% of them)
  • Glasgow - 38
  • Inverness - 141
  • Perth - 92
  • Stirling - 56


Okay, if you want to move to the Highlands and become a professional Munro-bagger, it's pretty obvious that Inverness or Fort William is where you need to be, but we already knew that. What I didn't know was exactly how many peaks were near each place. But of course this straight line kind of analysis is only really useful if you're a) a bird or b) have your own helicopter that can somehow fly directly to the top of mountains in - not easy when they are very often covered in clouds! Talking of clouds, I've used a cloud-style buffer mask on purpose here.

I have only been to the top of a very small number of Munros (not sure how many but definitely at least two, just can't remember), am generally quite scared of exposed drops, and am not into competitive mountainy things, but I do quite like making maps of this stuff because it reminds me of where I'm from. 

But let's say you want to do some kind of analysis that will help you understand - in a more practical way - how many Munros are near each city. That's what I decided to do. Based on an early morning departure time (06:00) at a weekend, driving 90 minutes at reasonable speeds, and then taking a 5km buffer around the 90 minute travel isochrone (calculated using the TravelTime plugin in QGIS), I came up with a number that I think looks about right for each of my eight places. See below for the results and the maps. Obviously, if you drive like a maniac and there's no traffic, you'll get different results, but these numbers seem about right, based on some additional manual checking. I've made the edge of the travel time zones a bit fuzzy, just to avoid the impression that there is a 100% precise cut-off. Plus I wanted it to look cloudy too, as I said above.

  • Aberdeen - 0 Munros within 90 minute drive + 5km
  • Dundee - 13
  • Edinburgh - 1
  • Fort William - 127 (45% of them)
  • Glasgow - 37
  • Inverness - 81
  • Perth - 54
  • Stirling - 51








Okay, so we're finally getting somewhere. Actually, we aren't. We're all stuck at home, apart from some people fortunate enough to be near these lovely places. By the way, those links I just put in are to the twitter accounts of Iain Cameron and Kelly Lander - two of my absolute favourite accounts - you may already know them if you're reading this but if not I highly recommend following them. Talking of incredible things - I'm still astounded by Donnie Campbell's Munro-round record of 31 days - he climbed all 282 in only 31 days last year - read about it here. Yes, that is an average of 9 Munros per DAY. Mind you, Hazel Strachan's Munro accomplishments over many years are also just exhausting to think about!

So, you want to know how far each Munro peak is from the top of Ben Nevis? Of course you do. First, here's a map of what that might look like. Read the text on the image for more info.


I generated a distance matrix - and a GeoPackage of it, for GIS users - so you can see how far each Munro is from all the others, in metres, kilometres and miles. 

I published this in list format and matrix format in the folder for this little side project. You'll also find higher resolution images of each of the maps above - the ones here are only half the size of the originals, although they are still pretty big.

There's loads more I could do on this, but I need to move on now. 

Hopefully some people will find this interesting. I'll leave you with a selection of photos I took last September on a trip up Ben Lawers and Beinn Ghlas, on a surprisingly lovely day. The second one was my attempt to zoom in to Ben Nevis, which we could see that day - it's 34.5 miles away from Ben Lawers.











Notes: yes, 3,000ft or 914 metres doesn't sound like much if you're from a much bumpier country. But if you are more than 3,000ft up a mountain at 57 degrees north, with a biting, gale force wind trying to knock you off your feet, 3,000ft can seem like 30,000! I could have calculated the distance between Munro peaks using a digital elevation model surface rather than straight line distance but that would a) be more complicated and time consuming and b) not be that useful if I only used the 50 metre open dataset I have available. I've compared this kind of thing before using straight line vs topographical distance and the results didn't change that much, but if anyone has done it please let me know. 

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.