[GraphHopper] Bigger penalty for ferries?
Thomas Ferris Nicolaisen
tfnico at gmail.com
Tue Dec 3 08:12:11 UTC 2013
Hi,
I'm pretty new to working with OSM, so please forgive any gross
misconceptions here..
GraphHopper often ends preferring a ferry here near our office instead
of driving around on the nearest bridge (with car):
http://graphhopper.com/maps/?point=50.694636%2C7.181025&point=50.688689%2C7.165897&locale=en-US
In comparison Google Maps prefers the bridge, as it estimated 22
minutes for crossing with the ferry, while driving around the bridge
is estimated to less than 15 minutes:
http://goo.gl/aKSnmD
(Check Route options -> 'Avoid highways' to have Google Maps use the ferry)
My real experience from taking this ferry is that it very often loses
out to driving. There is only one ferry, and waiting time is anywhere
from 0 to 2 crossings + loading time. A crossing is about 6 minutes,
and loading is 3, so the average time to get across is around 15
minutes. Additionally there's an expensive fee, and under certain
conditions (Hochwasser), the ferry doesn't ship at all.
OSRM makes the same (wrong, in my opinion) decision as GraphHopper,
which led me to believe that the underlying OSM data is to blame:
http://osrm.at/5LW
I've been debugging what happens in the
com.graphhopper.routing.util.AbstractFlagEncoder#handleFerry method.
Here are all the tags from the way object:
fee=yes, estimated_distance=371.4757924566722, route=ferry,
name=Autoschnellfähre Bad Godesberg-Niederdollendorf, toll=yes
As there is no duration here, GraphHopper ends up with this logic:
// unknown speed -> put penalty on ferry transport
return (int) speedEncoder.setValue(0, unknownSpeed);
I'm not sure how the result is used (these byte flags are a bit hard
to read), but I reckon that the penalty is not strong enough.
In the end, I guess my question is: How do I best go about
instrumenting GraphHopper to be more restrictive about using ferries?
I don't necessarily want to avoid them all together, but they should
be avoided if there's a reasonable alternate route.
More information about the GraphHopper
mailing list