A Technical Follow-Up: How We Built the World’s Prettiest Auto-Generated Transit Maps
byAnton Dubrau Six weeks ago, we launched Transit Maps, and wrotethis blog postabout why we took on the mammoth task of creating automatically-generated yet aesthetically-pleasing maps. We were blown away by the public reaction to our efforts, though not altogether surprised given the amount of time, thought and inspiration it took to create them. Today, we’re fulfilling our promise to publish a technical follow-up from Anton, our resident mapping wizard, who explains in much greater detail what went into building these maps.
When you think of Transit, you might think sleek, colourful interface. Given that we’re extremely particular about making the app as beautiful and usable as possible, that’s no big surprise. But UI isn’t the only thing we’re about: our team extends well beyond expert designers, and our app is much more than just pretty. Below the surface, there’s a lot of ‘hard’ technology quietly driving it.
First, our powerful backend quality checks hundreds of transit data feeds, automatically fixes broken data, and flags issues that need investigation. This system enables us to manage 350 transit feeds in 125 cities with a small team.
Then there’s our compression algorithm. It shrinks transit schedules up to 100 times smaller than the zip-files transit agencies provide. This allows Transit to download the schedules of the user’s entire region, store the data on the user’s device, and return search results… all in the amount of time it takes other apps to request and load a single schedule. And while our users may now be accustomed to our app’s speed, when the feature was first introduced, it effectively cut response time from several seconds to 0.1 seconds. That’s fast.
But there’s one particular technology that we’ve been working on for years. To our great joy (and relief), we finally launched itthis summer: automatically-generated transit maps .
Transit Maps: Transit App (left), Apple Maps (middle), and Google Maps (right) The idea itself is hardly new: Google launched their transit maps almost six years ago. But it turns out it’s quite the problem to solve, and Google (even after all these years) still can’t generate very pretty, or even very useful transit maps.
So how did we manage it? With sweat, tears, and creative thinking.
1. Shapes on a Map
The idea of creating automatically-generated maps is something that has captivated me since before joining Transit App three years ago. At the time, Google was the only player in the industry, and to be frank, their transit maps were kind of crappy. We had just finished our aforementioned super compression algorithm and felt ready to tackle a new problem. We figured, rather naïvely, that it would take about three months. Little did we know…
The first step was to show the source data on a map. Many of the trips in the underlying transit data already contained shapes representing the routes that transit vehicles took. If we simply drew all of the shapes defined by all of the trips, we’d get a simplistic sort of transit map: