GTFS - Transfers missing

Context: I am importing the SBB dataset from there https://gtfs.geops.ch, where I keep only a single date and removed bus trips. GTFS ZIP is 3.7MB. I have issue to make transfers working and thus the search always ends up with large walk legs.

Since version 0.12 or 0.11, it seems that the code of transfer handling has changed. Because, it seems that before, it was somehow allowed to leave and enter the PT graph, thus those transfers were not really an issue, since 0.12 or 0.11, you cannot leave and reenter this PT graph and the only way to continue on the PT network is to have proper transfer betweens stops. In the SBB datasets it means that I had to augment somehow the transfers table (in our case)

I first imported the dataset and have been unable to get transfers working between mode (train <-> subway, both direction) but between trains as well. I spent quite some time to debug and explore the edges and nodes and couldn’t find a proper solutions.

I restricted the GTFS file to only the two trips and transfer I was interested into and LOGGED out all the edges inserted and if/else conditons to discover that that the culprit comes from here:

Because the first condition was not true and the second is comparing a route_type (train vs subway) with a route_id

if (from_route_id == null || GtfsStorageI.PlatformDescriptor.route(from_route_id).equals(routeId)) {

Before the old code was

if (from_route_id == null || from_route_id.equals(entry.routeId)) {

I was able to temporary solving it by removing the condition but it tooks 55 GB of RAM and and the edges files was gigantic (29 GB). With the previous version and similar code, I ended up with smaller such cache files, so I suspect this is not the correct fix.

I tried to remove some entries of RouteTypePlatform but it seems to be more complicated than that. Another workaround would be to replace all route_type by the same value in the GTFS file.

So I’d like help to figure out what I am missing here to get transfer working. I could also provide a PR to fix this the correct way because so far I have the impression I only “hacked” the code base. One cool thing would be to create inter-modal transfers but give the different weight / prioriy s.t. a search visits first train legs, then light rail then bus, or something like this, from coarse to fine grain.

Thank you very much in advance if you have a bit of time for it :slight_smile:

1 Like

Hello All,

I am still blocked on this one. Maybe I did a bad job explaining what was my issue? Is it expected to take that kind of resources for GTFS on the Switzerland network? It is normal we do not want transfer between different route_type?

Thank you in advance