Making silly maps is my jam, but I definitely have a strong US bias. I’m American, so the first thing that comes to mind is… America. It felt like time I made a map for some other country.
The obvious candidate was the British Isles, and what could be more British than pubs? I decided to find how far you’ll need to walk from any point on the Isles to get to the nearest pub.
This turned out to be the most expensive project I’ve ever worked on. I forgot I had already hit my Google Maps free API call limit, and ran up a $170 bill 😬. Don’t be like me! Set your usage caps! But I’ll provide all the data below so you don’t need to repeat my mistake.
First, I needed to get a list of all pubs in the British Isles. This was surprisingly easy to accomplish, but it did take a few steps to gather the data.
- I got UK pub data from the Food Hygiene ratings API. The Trafford Data Lab was particularly helpful here, providing ready-made R code to retrieve and format data from the API. The UK groups “pubs, bars, and nightclubs” into one category. Not all of these may be traditional pubs, but I took the dataset as-is.
- Ireland data came from 2018-2019 liquor license renewals. I did have to geocode it all, as it doesn’t come with coordinates. Google was unable to geocode some of the pubs exactly–it tended to place the pubs at the center of their towns. I declared that to be OK.
- Isle of Man data I got from the Google Places API
- Scotland seemed really bare in places, so I ran a second scrub with Google Places. It turns out a lot of pubs in Highlands also operate as hotels, and are coded as such in the UK Food Safety data. To determine if an establishment was truly a pub or just a hotel bar, I read TripAdvisor reviews–if a real live Brit described the place as a pub, that was good enough for me.
Then, to create my final map, I used the following method:
- Create a uniform grid of points to cover the British Isles. I went for a relatively coarse mesh (every .0625 latitude; .125 longitude) due to API costs.
- For each point, find the 5 closest pubs as the crow flies.
- Run these through Google maps to find the walking distance from the point to each pub. Why walking distance? Well, for one, we’re responsible pub-goers and don’t drive drunk. Also, the grid of points rarely falls on a road, which trips Google up if you ask for driving distance.
- Save the shortest walking distance for each point.
- Double check the top 500 longest distances. I found that the coast of Scotland was often picking up pubs in Northern Ireland, which led to insanely long walks. For this step, I reviewed the top 15 pubs, limited just to those on the same island as the point of interest.
- Save the overall shortest walking distance found for each point.
- Plot a Voronoi diagram to illustrate how long a walk you have from each point to a pub
And the final result is below. Of course, this should be taken lightheartedly. Is 56.625, -4.625 really the farthest point from a pub? Probably not–there’s plenty of isolated islands that are technically infinitely far from a pub, unless you can walk on water–but it does show how pub-less northern Scotland is.
And the same map, just with distances as the crow flies. I like how you can see the lonely pubs in the Highlands as pale circles in a light blue sea:
Though I’m still irritated with myself for making such a dumb mistake and not monitoring my API usage more carefully, I am pretty excited about the results! I’m impressed at how many pubs our neighbors across the pond have managed to cram into so little space. There’s no gaping blank spots like we have in many maps of the American Midwest, and working with a new geometry was lightly refreshing.
Stay tuned for roundabouts next!