OTP Seems to prefer bus routes / ignore subway

392 views
Skip to first unread message

Marijn Vandevoorde

unread,
May 8, 2015, 5:16:24 AM5/8/15
to opentrippl...@googlegroups.com
Hi all,

I'm in the process of making a route planner for public transport and am running into some issues here.

Mainly, OTP seems to prefer bus routes over subway or tram, thereby taking huge detours instead of direct lines. I tried manipulating with the parameters like transferPenalty, walkBoardcost,... but to no use.

My feeling is that this is due to one of two causes:

1. OTP not linking the OSM maps with the gtfs stops of metro correctly. Therefore finding no way of getting on the metro
2. the trips for the routes we are "hoping" OTP would take differ a lot it seems. So maybe the trips around the time we are "leaving" are weird or incomplete, therefore not offering a decent option.

So what I'm hoping to find out is: Why does OTP take these huge detours? Is this really the best option? And If so: Why is it the best option and why can't it "see" options that seem a lot better to us. Options that google maps (using the same gtfs data) does see...

Thank you so much,

Marijn

Marko Burjek

unread,
May 8, 2015, 5:22:04 AM5/8/15
to Marijn Vandevoorde, opentripplanner-users
Probably the problem is that subways aren't linked to streets correctly. Linking stops to streets is very complex.

You can check if how links are made with inspector layers. Just add ?debug_layer=true to OTP url and you should have 3 layers in layer chooser. Choose traversal permissions. Stops are blue and are linked to streets with orange links.

I'm working on improving this and have made some progress.

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marijn Vandevoorde

unread,
May 8, 2015, 7:19:59 AM5/8/15
to opentrippl...@googlegroups.com
Hi Marko,

Thanks for the super quick response. I've recompiled with debug enabled, but the stops seem to be linked correctly. I can enforce the trajectory to go over the metro line if I put the starting point right next to it. It helps if I put the walkReluctance really low, but from a given point, it seems the suggested routes all take a 20 minutes detour by bus over a 10 meter extra walk to get there a lot faster.

I had the idea of adding all rail lines to the list of preferred routes but am running in another problem there. But to keep things organized I'll add this to a separate thread.

Marijn Vandevoorde

unread,
May 8, 2015, 10:49:04 AM5/8/15
to opentrippl...@googlegroups.com
Well, you can ignore that last paragraph, I got it sorted out. 

One more thing though. What are the options if a certain metro/rail stop is not linked to the OSM map? The gtfs data is the one I received from the transit agency and the same file which is made available to google, so I don't want to fiddle with that, especially since I'll receive updates with the same "deviations" in the future. So a "for once & for all" solution is due.

The transfers.txt file is only related to transfers between transits, right? It can't be used to add transfers from addresses to stops?

Thanks in advance!

Op vrijdag 8 mei 2015 13:19:59 UTC+2 schreef Marijn Vandevoorde:

Marko Burjek

unread,
May 12, 2015, 1:33:17 PM5/12/15
to Marijn Vandevoorde, opentripplanner-users
Hello Marijn,

If you have stop_codes in GTFS data you can add problematic stop nodes to OSM. Where ref is GTFS stop_code and connect them to the ways you want to connect.
The most correct way to tag it is tu use https://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dplatform and then add bus=yes (for bus), rail=yes (train), tram=yes (tram) subway=yes.

Currently this tag isn't supported but you can add it here: https://github.com/opentripplanner/OpenTripPlanner/blob/master/src/main/java/org/opentripplanner/openstreetmap/model/OSMNode.java#L67.

I'll do a PR for this.

If OTP finds OSM transit stop with tag ref which has same value as GTFS stop_code it connects them without linker involvement.

Problem can happen if you don't have license for stop data to add them to OSM, because it isn't under OSM compatible license. Then you can add this in your local OSM dump. (Just use JOSM and add stops and connect them) OTP will use all OSM files in a folder. But I'm not sure how would this work since some ways would be duplicated in your OSM data and data with rest of OSM.

You can also try new linker https://github.com/opentripplanner/OpenTripPlanner/pull/1922 which simplifies linking and will be merged soon.

Best would be if you post where are the problems (which specific stops) and I can try to fix it for everyone.

--
Reply all
Reply to author
Forward
0 new messages