Subway Routing in Maps.Me

Posted by Zverik on 25 December 2017 in English (English)

Last week we published the latest version of Maps.Me. It’s got the major version number increase — 8.0. And not for nothing: there is a brand new “Discovery” button, which shows interesting places around you. There are christmas markets on the map — not from OSM though. You can register as a “local guide”, meet new people and show them around your city. Hotels from can be filtered by price, rating and availability.

But that is not why the release is worth celebrating. The main thing is, we’ve made a metro routing!

Screenshot of an Underground route in London

It won’t be an exaggeration to say that this is the first even public transport routing application that uses solely OpenStreetMap data. Anybody can employ GTFS data, but using OSM is not that easy. All these relations — “route”, “route_master”, “stop_area”, with enourmous tables in the wiki detailing their usage. Utter mess in the data, a result of mapping for a renderer. Very few people understand public transport mapping, so how did we even use it?

We started with a simple task: visualization and route planning for every subway and light rail network in the world. There are only 180 of these: 700 lines (which require at least 2100 relations, as you might know), 11700 stations. To map all of these, you have to get your tagging straight. And that’s how the “Metro Mapping” proposal was made. Then I wrote the subway preprocessor, which takes a filtered planet file and produces an easy to use structure for every network, and a validation page, so you know what to fix.

And then me and a few other mappers started improving public transport relations in many cities, mainly in Europe. When we started, there were, like, three good metro networks. Just before the MAPS.ME release, there were 78 in 74 cities. I’d like to thank Claudius Henrichs for improving many routes in Asia: he’s the first person outside our company that used the subway validator to improve public transport mapping.

Help us!

What’s for the future? The second proposal about rapid transit mapping is being discussed right now, and in mid-January the voting will start. Please read the proposal and if in doubt about anything, write your questions on the discussion page.

180 networks is not too much, but we need your help. Not a city in the United States has subway routing in MAPS.ME. Zero cities in China. If you live in Asia or any of the Americas and want to have subway routing on your next trip, please read the Metro Mapping tutorial, consult the validation page for your country and fix the tagging in OpenStreetMap.

We’d like to see public transport from OSM being used properly, not only in rendering of lines. If you work on an application, please consider using Subway Preprocessor to provide rapid transit navigation for your users. We in MAPS.ME strive for OSM to be used in as many ways as possible, and we continue to work on making public transport from OSM available to everyone.

Comment from Diego Sanguinetti on 27 December 2017 at 22:37

Hello. I added a wiki with the details of the Lima Metro. I just modified some routes and recommendations. If you could collaborate in changing the routes, I would greatly appreciate it.

The details are here:

Comment from bbmiller on 30 December 2017 at 14:05

Could you help me understand the warnings produced by the validator? I’ve done a lot of work over the years on the Chicago L and it follows the PTv2 tagging–at least to my imperfect understanding–but your validator still throws a lot of warnings.

For example, take the “stop node XXXX is not connected to a station” warning. The stop_position nodes in the Chicago network are all part of stop_area relations that include a station. Is this warning being produced because the station is mapped as an area rather than node?

I also don’t understand this specific warning (currently in the validation page): Route has no stops (relation 2400823, “Yellow Line: Howard to Dempster-Skokie”)

That relation contains stop_position nodes with the “stop” role. What’s triggering the warning?

I’d be happy to improve the metro mapping in Chicago, but some better documentation of your tools would be really helpful.

Comment from Stonemill2 on 12 January 2018 at 13:35

You say this “We in MAPS.ME strive for OSM to be used in as many ways as possible” but by blocking osm hotels and replacing them (not co-existing) with data. I can’t even tell if an OSM hotel/guest house has the right data in it because I can’t see any of it :-( Can’t even tell if it’s location is correct, or even if it’s missing because I don’t know if it’s blocked or just plain missing.

Comment from AgusQui on 13 January 2018 at 03:38

I’m correcting errors in Buenos Aires, I do not understand why the stations that belong to light_rail routes are unused, also ask for an interchange that does not exist.

Comment from Zverik on 18 January 2018 at 11:28

AgusQui, I see the issue with Buenos Aires has been resolved, thank you for correcting the subway system there.

For futher errors and updates to numbers, there is a link to a spreadsheet at the bottom of the validation page. That table has reference numbers for every rapid transit system in the world. Please add a comment there, and I will update numbers promptly.

Comment from bbmiller on 18 January 2018 at 23:02

Any assistance with my questions above? Again, I’m happy to do clean up work in Chicago where it’s required, but I’m having trouble interpreting the error messages returned by your validator.

Comment from AgusQui on 19 January 2018 at 04:55

@bbmiller I looked a little and noticed a couple of stop_area relations that do not contain the railway=station node, for example Howard, I think that is the reason for most of the errors.

Comment from bbmiller on 19 January 2018 at 13:07

Thanks, @AgusQui, that helps. I suspected that was the case, but wanted to make sure. Most of the Chicago subway network is elevated, so the stations can be conveniently represented as buildings. That seemed allowed under the Public Transport schema at the time, so that’s what I did. If I need to replace all the stations mapped as areas with nodes, I can do that, but it’ll have to wait until I have some time to sit down and do it.

Comment from AgusQui on 19 January 2018 at 15:19

It is not necessary, it can be in the area too.

Comment from bbmiller on 19 January 2018 at 17:39

Mea culpa. I thought I’d added the stations to the stop_area relations, but clearly I haven’t. Thanks for sticking with me.

Comment from bbmiller on 20 January 2018 at 13:25

Follow-up: Nearly all of the Chicago stop_area relations did include a station, either as a node or a way, but most of them were missing a “subway=yes” or “station=subway” tag. Adding one of those tags seems to satisfy the validator.

Comment from AgusQui on 20 January 2018 at 15:17

Use station=subway, subway=yes is used in stop_position

Login to leave a comment