I’m parsing the relations and I just found out that some Bus Route relation are not found, do you know why ?
For example, from OSM, 45.4656, 6.9613
When I print every relations on HandleRelationTags, the ones on this way are not found.
On 45.4507, 6.9767 it only find the “Train Rouge” one. The other bus routes are not found.
Any idea why ?
One last question:
How can I edit the code so the path follow only one bus route ?
in your example you are just altering the priority. But all other edges/ways also exist. If GH has no other way, it also uses the worst edges. Due to bus lane not creating a coherent graph it is nether a posibility to throw away all other eges expcpt for bus ones.
Also there is the fact that you pointed out. GH wold not follow one Bus-route in paticular. GH sees all busrouts and can switch routes whenever it is beneficial.
I would use a complete different approch.
I wrote a programm that searches all bus-routes and saves them with their id. If a pedestian wants to use the bus I calculate the eucledian distance to all Bus-Stops and choose the start, end stop with the least walking.
I than get all Busstops inbetween and do a GHReuest with a round-trip to all these stops. I also use a own encoder to allow the use of retricted road that cars are normaly not allowed to use.
The optimal route that GH response is to 95% the official bus-route in OSM.
This is a hacky way and it is more sutible to use the GH-GTFS reader, but the disatwantage is that not every city provides GTFS files. Currently we are thinking about to generate our own GTFS files form OSM and some made up scheduling.
Bus routing is complex. We are still working on our approches to find the best solution.