Some of the public transport backend services actually provide links to images or PDF files with a map for all stops or stations involved in a journey, showing those would be fairly straightforward and would even give us the official maps of the corresponding operators. That’s better than nothing, but it’s not the best approach when looking at why you’d actually want a map of a train station or airport in the first place:
Find the departure location of your next connection, ie. the gate of your flight or the platform (or better platform section) of your train. As we know those information, we can easily assist there by highlighting those places.
Locate where to buy a ticket for the local public transport service, say a ticket machine or a ticket office. As we know with which transport operator you are continuing your trip, suggesting the right places for this would help.
Find a restroom, a place to get food/drinks, the lost luggage counter, a pharmacy, or a lounge compatible with your ticket or frequent traveler bonus program. This can be supported by searching/filtering, but can also use context information such as considering opening hours (ie. places closed during the time you are waiting for your connection are probably not very relevant).
For all of the above, you’d might also want navigation support. While finding your way there might not be all that complicated (we are talking about a single large building usually), it can get a lot more challenging when considering mobility restrictions, be it heavy luggage, a stroller, a hurt leg or a wheelchair. In those cases you might for example prefer elevators over stairs. For those it’s however not only useful to know where they are, but also whether they are actually operational right now.
All this obviously needs more than an opaque image with a map, but something we can fully introspect and adapt depending on the use-case. While certainly ambitious, we do have all the necessary data to build this, thanks to OpenStreetMap. OSM doesn’t just provide the spatial data for the map, but also detailed semantic annotations (see e.g. the very elaborate machine-readable opening hours specification). And applications like wheelmap.org show how this can be combined with live status data for elevators.
OSM Indoor Maps
While many OSM maps focus on two dimensions, we have the additional complication that train stations and airports are often multi-level buildings, so we do have to care about a third dimension. Look for example at how the default OSM renderer shows Berlin central station:
This is hardly useful, as half of the platforms are underground and thus not even visible and amenities are spread over three floors which you cannot tell apart. The information on which level things are is all there though, we just need to consider this when rendering the map.
OSM calls this indoor mapping, even if maybe not everything related to this is technically “indoors”. There’s a few existing web-based renderers for these information as well, such as OpenLevelUp or OpenStationMap.
There is certainly a lot more to write about, and I’ll try to do that over the coming weeks. And there is also still much more work ahead before this becomes actually useful.
The code for this is currently in the KPublicTransport repository, not necessarily because this is the best place for it, but because it’s using OSM code that already existed in there. It’s still a fairly small codebase, feel free to get in touch if this is a subject you are interest in diving into!
A central part of this is a declarative definition of whats shown on the map, so that part doesn’t even require programming skills to meaningfully work on. And in case you are into more challenging performance or math problems, there’s some of that as well :)