Trouble routing using large GTFS file

Hello graphhopper developers,

thanks for your nice software! I have some trouble routing via public transport on a large GTFS file on a local self hosted instance of graphhopper via the provided REST API.

I have a working configuration for car routing over long distances over the openstreetmap dach region as downloaded as .pbf file from geofabrik de here:

(Link removed as I can only post two links as a new user apparently)

Now I would like to be able to route over this whole region via public transport with foot access as well and run into some problems (ideally I would use one graph for both car routing and public transport, but that is not an important problem here).

The routing example for the brandenburg region works fine (side remark: you might want to add the needed excluded ways option to the example in the documentation) as well as the gtfs file for the long distance rails as downloaded from here:

This file should be a subset of the larger GTFS file here:

I can build a graph for both cases (in the second case it takes around 5 hours on my laptop though) and I can start the service for both cases, however I can only route long distances for the first case.

An example which works for the first but not the second case is a route from the GPS coordinate of Stuttgart central station to the GPS coordinate of Berlin central station, which has a direct long distance ICE train connection.

For the second case of the big GTFS file, it answers after quite some time with a json with a “hint” which points at that it searched 1 million ways (I think? I have to double check the actual number) but does not return any result.

Is it feasable to use graphhopper for this use case or do I need very beefy hardware for this? It seems strange to me that car routing works in fractions of a second for very long distances but fails spectacular for public transport where it should find a direct connection. Could it be a very wrong configuration on my part which causes this?

For my particular use case it would be enough also to completely forego the foot navigation and just route from a near bus stop / train station.

I can of course provide much more detail on the used file / configuration if needed. I just want to make sure that graphhopper is in principle feasable for my use case and that it is not some stupid misconfiguration on my part.

Thanks a lot, cheers,
Florian

If you tried 7.0 - can you try with master again? There were significant performance improvements in that area.

it answers after quite some time with a json with a “hint” which points at that it searched 1 million ways

Can you try if it works when you increase the configuration?

graphhopper:

  routing.non_ch.max_waypoint_distance: 1000000

side remark: you might want to add the needed excluded ways option to the example in the documentation

Can you submit a pull request?

It seems strange to me that car routing works in fractions of a second for very long distances but fails spectacular for public transport where it should find a direct connection.

This isn’t so unexpected. Transit routing (public transport) and car routing require completely different algorithms.

I tried again with master (7352ec3c4) today. Do yo mean increasing routing.max_visited_nodes? Anyway, I tried increasing both values, but I still get the result:

{
    "hints": {
        "visited_nodes.average": 1000000,
        "visited_nodes.sum": 1000000
    },
    "info": {
        "copyrights": [
            "GraphHopper",
            "OpenStreetMap contributors"
        ],
        "took": 24061
    },
    "paths": []
}

which is the previous value. Is it an internal limit?

About the excluded ways option I’m not sure. It seems to be required to give an value here, but it seems to me, that giving a value does prevent building a graph for both car routing and public transport (via foot access, because the excluding options for car and foot seem to exclude each other). Is it intended to run two instances with two seperate graphs for this use case then? Maybe this check should be revisited.

I understand that public transport routing adds a time parameter to the route. However shouldn’t the graph in general not be smaller? I would assume there are a lot less public transport routes than ways navigable by car and the search space should be smaller due to the time constraint?

Hi
Did you find a solution for the problem? I use the same data set and have exactly the same problem, public transport routing doesn’t work for longer journeys. I cannot increase the value for “max_visited_nodes” via the config.
If you found a solution, I would be extremely happy about a hint.

Many thanks and regards,
Martin

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.