Welcome to Medieval Murder Maps
CSI London, York, and Oxford:
Discover the murders, sudden deaths, sanctuary churches, and prisons of three thriving medieval cities.
CSI London, York, and Oxford:
Discover the murders, sudden deaths, sanctuary churches, and prisons of three thriving medieval cities.
Here’s some code to show the distance to the nearest airports on a map.
Here’s a modified version that shows the distance to the nearest Gregg’s. The hub-and-spoke visualisation overlaid on the map changes as you pan around, making it look like a spider bestriding the landscape.
Jonty’s version shows the distance to the nearest Pret a Manger.
I got nerdsniped by someone saying:
@adactio This would be cool for sessions 😉
He’s right, dammit! So here you go:
Now you can see how far you are from the nearest traditional Irish music sessions.
It’s using data from the weekly data dumps from thesession.org—I added a GeoJSON file in there.
Pure silliness, but it does make me wonder what kind of actually good data visualisations could be made with all this scrumptious data.
Yesterday when I mentioned my paranoia of third-party dependencies on The Session, I said:
I’ve built in the option to switch between multiple geocoding providers. When one of them inevitably starts enshittifying their service, I can quickly move on to another. It’s like having a “go bag” for geocoding.
(Geocoding, by the way, is when you provide a human-readable address and get back latitude and longitude coordinates.)
My paranoia is well-founded. I’ve been using Google’s geocoding API, which is changing its pricing model from next March.
You wouldn’t know it from the breathlessly excited emails they’ve been sending about it, but this is not a good change for me. I don’t do that much geocoding on The Session—around 13,000 or 14,000 requests a month. With the new pricing model that’ll be around $15 to $20 a month. Currently I slip by under the radar with the free tier.
So it might be time for me to flip that switch in my code. But which geocoding provider should I use?
There are plenty of slop-like listicles out there enumerating the various providers, but they’re mostly just regurgitating the marketing blurbs from the provider websites. What I need is more like a test kitchen.
Here’s what I did…
I took a representative sample of six recent additions to the sessions section of thesession.org. These examples represent places in the USA, Ireland, England, Scotland, Northern Ireland, and Spain, so a reasonable spread.
For each one of those sessions, I’m taking:
I’m deliberately not including the street address. Quite often people don’t bother including this information so I want to see how well the geocoding APIs cope without it.
I’ve scored the results on a simple scale of good, so-so, and just plain wrong.
Then I tot up those results for an overall score for each provider.
When I tried my six examples with twelve different geocoding providers, these were the results:
Provider | USA | England | Ireland | Spain | Scotland | Northern Ireland | Total |
---|---|---|---|---|---|---|---|
1 | 1 | 1 | 1 | 1 | 1 | 7 | |
Mapquest | 1 | 1 | 1 | 1 | 1 | 1 | 7 |
Geoapify | 0 | 1 | 1 | 0 | 1 | 0 | 3 |
Here | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
Mapbox | 1 | 1 | 0 | 1 | 1 | -1 | 3 |
Bing | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
Nominatim | 0 | 0 | 0 | 0 | -1 | 1 | 0 |
OpenCage | -1 | 1 | 0 | 0 | 0 | -1 | -1 |
Tom Tom | -1 | -1 | 0 | 0 | -1 | 1 | -2 |
Positionstack | 0 | -1 | 0 | -1 | 1 | -1 | -2 |
Locationiq | -1 | 0 | -1 | 0 | 0 | -1 | -3 |
Map Maker | -1 | 0 | -1 | -1 | -1 | -1 | -5 |
Some interesting results there. I was surprised by how crap Bing is. I was also expecting better results from Mapbox.
Most interesting for me, Mapquest is right up there with Google.
So now that I’ve got a good scoring system, my next question is around pricing. If Google and Mapquest are roughly comparable in terms of accuracy, how would the pricing work out for each of them?
Let’s say I make 15,000 API requests a month. Under Google’s new pricing plan, that works out at $25. Not bad.
But if I’ve understood Mapquest’s pricing correctly, I reckon I’ll just squeek in under the free tier.
Looks like I’m flipping the switch to Mapquest.
If you’re shopping around for geocoding providers, I hope this is useful to you. But I don’t think you should just look at my results; they’re very specific to my needs. Come up with your own representative sample of tests and try putting the providers through their paces with your data.
If, for some reason, you want to see the terrible PHP code I’m using for geocoding on The Session, here it is.
The Session has been online for over 20 years. When you maintain a site for that long, you don’t want to be relying on third parties—it’s only a matter of time until they’re no longer around.
Some third party APIs are unavoidable. The Session has maps for sessions and other events. When people add a new entry, they provide the address but then I need to get the latitude and longitude. So I have to use a third-party geocoding API.
My code is like a lesson in paranoia: I’ve built in the option to switch between multiple geocoding providers. When one of them inevitably starts enshittifying their service, I can quickly move on to another. It’s like having a “go bag” for geocoding.
Things are better on the client side. I’m using other people’s JavaScript libraries—like the brilliant abcjs—but at least I can self-host them.
I’m using Leaflet for embedding maps. It’s a great little library built on top of Open Street Map data.
A little while back I linked to a new project called OpenFreeMap. It’s a mapping provider where you even have the option of hosting the tiles yourself!
For now, I’m not self-hosting my map tiles (yet!), but I did want to switch to OpenFreeMap’s tiles. They’re vector-based rather than bitmap, so they’re lovely and crisp.
But there’s an issue.
I can use OpenFreeMap with Leaflet, but to do that I also have to use the MapLibre GL library. But whereas Leaflet is 148K of JavaScript, MapLibre GL is 800K! Yowzers!
That’s mahoosive by the standards of The Session’s performance budget. I’m not sure the loveliness of the vector maps is worth increasing the JavaScript payload by so much.
But this doesn’t have to be an either/or decision. I can use progressive enhancement to get the best of both worlds.
If you land straight on a map page on The Session for the first time, you’ll get the old-fashioned bitmap map tiles. There’s no MapLibre code.
But if you browse around The Session and then arrive on a map page, you’ll get the lovely vector maps.
Here’s what’s happening…
The maps are embedded using an HTML web component called embed-map
. The fallback is a static image between the opening and closing tags. The web component then loads up Leaflet.
Here’s where the enhancement comes in. When the web component is initiated (in its connectedCallback
method), it uses the Cache API to see if MapLibre has been stored in a cache. If it has, it loads that library:
caches.match('/path/to/maplibre-gl.js')
.then( responseFromCache => {
if (responseFromCache) {
// load maplibre-gl.js
}
});
Then when it comes to drawing the map, I can check for the existence of the maplibreGL
object. If it exists, I can use OpenFreeMap tiles. Otherwise I use the old Leaflet tiles.
But how does the MapLibre library end up in a cache? That’s thanks to the service worker script.
During the service worker’s install
event, I give it a list of static files to cache: CSS, JavaScript, and so on. That includes third-party libraries like abcjs, Leaflet, and now MapLibre GL.
Crucially this caching happens off the main thread. It happens in the background and it won’t slow down the loading of whatever page is currently being displayed.
That’s it. If the service worker installation works as planned, you’ll get the nice new vector maps. If anything goes wrong, you’ll get the older version.
By the way, it’s always a good idea to use a service worker and the Cache API to store your JavaScript files. As you know, JavaScript is unduly expensive to performance; not only does the JavaScript file have to be downloaded, it then has to be parsed and compiled. But JavaScript stored in a cache during a service worker’s install
event is already parsed and compiled.
This project, based on OpenStreetMap, looks great:
OpenFreeMap lets you display custom maps on your website and apps for free.
You can either self-host or use our public instance.
I’m going to try it out on The Session once there’s documentation for using this with Leaflet.
This is kind of about art direction and kind of about design systems.
There is beauty in trying to express something specific; there is beauty too in finding compromises to create something epic and collective.
My only concern is whether we are considering the question at all.
I wish more publishers and services took this approach to evaluating technology:
We scrutinize third-party services before including them in our articles or elsewhere on our site. Many include trackers or analytics that would collect data on our readers. These may be standard across much of the web, but we don’t use them.
A lovely bit of real-time data visualisation from Robin:
It’s a personal project created at home in Wales with an aim to explore and visualise renewable energy systems. Specifically, it aims to visualise live generation from renewable energy systems around Great Britain and to show where that generation is physically coming from.
A free PDF with five articles:
Three of those authors spoke at this year’s UX London!
City of Women encourages Londoners to take a second glance at places we might once have taken for granted by reimagining the iconic Underground map.
I love everything about this …except that there’s no Rosalind Franklin station.
Cennydd asked for recommendations on Twitter a little while back:
Can anyone recommend an outlining app for macOS? I’m falling out with OmniOutliner. Not Notion, please.
The only outlining tool that makes sense for my brain is https://kinopio.club/
It’s more like a virtual crazy wall than a virtual Dewey decimal system.
I’ve written before about how I prepare a conference talk. The first step involves a sheet of A3 paper:
I used to do this mind-mapping step by opening a text file and dumping my thoughts into it. I told myself that they were in no particular order, but because a text file reads left to right and top to bottom, they are in an order, whether I intended it or not. By using a big sheet of paper, I can genuinely get things down in a disconnected way (and later, I can literally start drawing connections).
Kinopio is like a digital version of that A3 sheet of paper. It doesn’t force any kind of hierarchy on your raw ingredients. You can clump things together, join them up, break them apart, or just dump everything down in one go. That very much suits my approach to preparing something like a talk (or a book). The act of organising all the parts into a single narrative timeline is an important challenge, but it’s one that I like to defer to later. The first task is braindumping.
When I was preparing my talk for An Event Apart Online, I used Kinopio.club to get stuff out of my head. Here’s the initial brain dump. Here are the final slides. You can kind of see the general gist of the slidedeck in the initial brain dump, but I really like that I didn’t have to put anything into a sequential outline.
In some ways, Kinopio is like an anti-outlining tool. It’s scrappy and messy—which is exactly why it works so well for the early part of the process. If I use a tool that feels too high-fidelity too early on, I get a kind of impedence mismatch between the state of the project and the polish of the artifact.
I like that Kinopio feels quite personal. Unlike Google Docs or other more polished tools, the documents you make with this aren’t really for sharing. Still, I thought I’d share my scribblings anyway.
A timeline of city maps, from 1524 to 1930.
Robin Hawkes has made a lovely website to go with his newsletter all about maps and spatial goodies.
Well, this is a rather wonderful mashup made with data from thesession.org:
The distribution of Irish traditional tunes which reference place names in Ireland
80 geocoding service plans to choose from.
I’m going to squirrel this one away for later—I’ve had to switch geocoding providers in the past, so I have a feeling that this could come in handy.
The beautiful 19th century data visualisations of Emma Willard unfold in this immersive piece by Susan Schulten.
An absolutely gorgeous piece of hypermedia!
Data visualisations and interactive widgets enliven this maze of mathematics. Dig deep—you may just uncover the secret passages that join these concepts together.
I can’t decide if this is industrial sabotage or political protest. Either way, I like it.
99 second hand smartphones are transported in a handcart to generate virtual traffic jam in Google Maps.Through this activity, it is possible to turn a green street red which has an impact in the physical world by navigating cars on another route to avoid being stuck in traffic
A lovely little bit of urban cartography.
I’m finding this tool to be very useful for the kind of chaotic mind-mapping I do when I’m preparing a conference talk.