Does Graphhopper GTFS not create routes with more than one PT data?

I’m using Graphhopper for a project to calculate routes using public transit. I’ve loaded it with multiple GTFS .zip files and I can confirm that it can use all of that data to create the routes. However, it never uses more than one for a single route.

In this particular case, it calculates a route that starts with a 1 km walking leg and then a PT leg, by train. However, the last one is a walking leg that covers 3 km of distance (I do not want a walking leg that long, especially when it is possible to take public transit). I’ve already tried calculating a route with the start and end point of that last leg, and it does use public transit to get to the destination.

As you can see, the problem is that, when creating the route, it doesn’t use the two different transports, when it really should. So I’m wondering, is this a bug? Or am I missing something?

Hi Octanas,

As far as I know GraphHopper only support multiple GTFS files if the region covered by those files are not overlapping. If they are overlapping you need to merge the overlapping GTFS files together as a preprocessing step.



I presume that would be the case. I will try that. Thanks.

Hi Octanas,

Was the issue solved? Also how do you know if you need to merge 2 files? I found that different agencies and gtfs files are not mergeable. What tool do you use?

Hi MathRR

What tools do you use for merging. I tried transitfeeds/ and always got errors that prevent merging gtfs files for the same area.

Hi CRMap,

Sorry to be replying so late, I hadn’t been here for some time because of other work.

Unfortunately it didn’t work for me, not because of Graphhopper, but because the GTFS data I have is not “mergeable”. Every time I tried to merge, there were errors that prevented it, mainly because the data is not… correct, I guess. There’s nothing I can do about it though, so I had to find another way to get the route. I did the following (consider that I want to go from place 1 to place 2, using PT, and that all GTFS files are loaded in Graphhopper):

  1. Calculate the route from place 1 to place 2 (it only uses one GTFS feed)
  2. Calculate another route from the last point of the PT leg of the previous route to place 2 (it uses another GTFS feed or, if not needed, just walking)
  3. Repeat step 2 until the new route doesn’t contain a PT leg
  4. Join the routes to make a unique complete route

I haven’t been able to test it fully, but as of now, the results seem to be fine.

I hope this workaround helps you.