Friday, January 26, 2024

Exciting facts about UK postcodes

I have some exciting facts about UK postcodes and I'm going to post them here. My data source is the ONS Postcode Directory (ONSPD) and I'm sharing this information here because it's all incredibly interesting and you know it. If you have a list of UK postcodes that you just want to turn into lat/long or eastings/northings then Doogal's batch geocoding tool is what you need. He really is a hero. But anyway, back to the boring stuff.

Okay, let's start with postcode extremes by latitude and longitude - here's a map of that.

Well, now we know

What about longest straight line distance between UK postcodes? It would appear to be ZE2 9EQ in the north of Shetland to TR22 0PL in the Isles of Scilly.

Currently £1.25 to send a letter first class

In the ONSPD file I used, downloaded in January 2024, there are 2,697,530 postcodes - and by that I mean there is a point for each full postcode unit in the UK with a geographic location - e.g. NW1 1AA. But hold on a second, this is way more than the actual number of UK postcodes so what's going on? 

Red Road flats, Glasgow (CC, Miles Glendinning)

The ONSPD file also contains postcodes that are no longer active - for example for areas where lots of buildings have been demolished like in the case of the old Red Road flats in Balornock / Barmulloch in Glasgow, and lots of other examples across the UK. They are still in the file but you can easily filter them out using the DOTERM column (this column indicates when a postcode was terminated):

"If present, the most recent occurrence of the postcode’s date of termination, otherwise: null = ‘live’ postcode"

That's the kind of useful information you can find in the user guide.

Postcodes that are no longer in use

What about postcodes with no geographic location? Well there are about 24,000 of those in the dataset and they don't have a point but that's a bit of a pointless thing to say, isn't it?


How many live, in-use postcodes are there? 

In the ONSPD dataset I'm using here, there are 1,798,027 live postcodes in the UK. And the geographic centre of all of these? Well it happens to fall just to the north east of Barton-under-Needwood in Staffordshire. So now we know that too.

Barton-under-Needed to know this

Should be the capital of the UK, clearly

Other stuff

What about postcodes with an i in them? See below.

There are some IM postcodes in there, but no dots

I quite like the way the Kirkwall postcodes look like they're invading Caithness.



Can't you do some point-in-polygon postcode density maps?

Yes I can. I can do it with squares. Or I can do it with other shapes. This is definitely not pointless because there are more than 1.7 million points so how can it be?

Postcode density by 10km square


5km hexagons, shaded by postcode count (yellow = more)


That's enough of that.

Wednesday, January 10, 2024

CaII me AI

This is my new blog, the third in the series. I started my first blog in 2008 and then I wound down my last one in late 2023 because I was a bit bored of it, and was thinking to myself "You know, I don't find this stuff amusing anymore". I was thinking about maybe doing a Substack or something but I realised I actually quite like having a blog, so I'm going to keep doing it. Do I want a shot at redemption? Maybe.


A great map of Scotland

This first post is really just me saying 'hi, I'm back' and also because I wanted to say a tiny bit about AI and post a map of Scotland made by DALL-E, which described what they produced like this: 

"Here is a conventional and accurate map of Scotland, featuring major cities in their correct locations and other geographical details. This map is styled like a standard geographical map, providing a clear and informative view of Scotland."

Will the rise of AI lead to the demise of the GIS analyst and mapmaker? I don't think so. I submit the map of Scotland above as evidence. All the same, I think there are lots of ways in which AI will have an impact in the geospatial world, in ways we can't yet imagine. It's a street in a strange world! 

When I first started blogging in 2008 we couldn't have imagined the things AI can now do, but what frustrates me most at the moment is how confidently wrong it can often be, even if I have managed to successfully get Bard or ChatGPT to help me do stuff I'd otherwise struggle with. So I still kind of treat it like that oft-cited legal mantra:

"never ask a question to which you do not already know the answer"

To this we could add: "only ask questions where the answer doesn't really matter". That does kind of defeat the purpose but I do wish answers weren't given so confidently much of the time. It is of course quite good at creating sports teams logos though.

The best Aussie rules team in Dundee

Shinty world champions

The newest NBA franchise

The Celtics name change, honoring Brian Scalabrine

This is a bit of a rambling, random first post - for sure - but I got a short little span of attention

I've also been adding in lyrics in italics from Paul Simon's You Can Call me Al just because a) when I see AI it always looks like Al (which is how smart people spell my name in order to avoid mis-spelling Alasdair, which happens like 10 times a day) and b) 

"As we wrap up this initial journey, remember that every map is not just a guide, but a gateway to new adventures and discoveries."
(prompt: please can you write a short sentence for me that I can use as the last sentence in the first post of my new blog, called A wee bit of mapping

reply: Absolutely! Here's a fitting sentence for the conclusion of your first blog post on "A wee bit of mapping":)

But yes, you can call me Al, or Aly or even Alasdair if you want to spell it all out. For now I think when it comes to maps and geospatial I can do a better job than AI but that may change. 

He says, "Amen and Hallelujah!"

Notes

  1. The title of this blog post is actually caii me ai - a reminder that when we're talking about AI we should use a serif font, RlGHT?
  2. The blog header here is an image I made using Aerialod and Ordnance Survey open data. Why that location? It's a nod to the fact that I used to travel on the M62 then M602 then into central Manchester every day from Liverpool when I first started blogging. 
  3. The blog name? Well, of course I say 'a wee bit' all the time and then it's about mapping so that seemed to be about right. Also it's borrowed and modified from the blog title of a friend of mine.
  4. Blogger red underlines shinty. This is how we really know technology is still rubbish.