valhalla / demos

demos
MIT License
98 stars 58 forks source link

Valhalla returning convoluted transit routes #215

Closed Rui-Santos closed 6 years ago

Rui-Santos commented 6 years ago

For example here: valhalla-strange-routing

Taking the Metro from the starting point, it would take 1 transfer to get to the blue line and get to the destination, because as you can see the Metro Yellow line intercepts with the Metro Blue line instead it says to take the Metro from departure for 3 stations only and take a few buses in between, and completely discards the Metro the rest of the way, when there are more optimal routes, being it taking the Yellow line until it intercepts with the Blue line, or even taking the Yellow line, doing a transfer to the Red line, take the Red for one stop and transfer to the Blue line. And probably there are buses that connect the 2 places on a straighter path than using the Metro. The total journey by Metro is like 1h:15m, yet, using the given instructions, it's more than 6 hours.

Any ideas about anything I may tune on the valhalla config file that may help with this? Is it a problem with the transit data from Transit.land? Any clues?

BTW, here is what was requested from valhalla by the frontend: /route?json={%22locations%22:[{%22options%22:{%22allowUTurn%22:false},%22latLng%22:{%22lat%22:38.793663869859806,%22lng%22:-9.173669815063477},%22_initHooksCalled%22:true,%22lat%22:38.793663869859806,%22lon%22:-9.173669815063477},{%22options%22:{%22allowUTurn%22:false},%22latLng%22:{%22lat%22:38.75240990134552,%22lng%22:-9.22478199005127},%22_initHooksCalled%22:true,%22lat%22:38.75240990134552,%22lon%22:-9.22478199005127}],%22costing%22:%22multimodal%22,%22costing_options%22:{%22transit%22:{%22use_bus%22:%220.1%22,%22use_rail%22:%220.9%22,%22use_transfers%22:%220.1%22}},%22directions_options%22:{%22language%22:%22en-US%22},%22date_time%22:{%22type%22:1,%22value%22:%222018-02-28T16:03%22}}