Even though I set “avoid=ferry”, Graphhopper still uses the ferry in the given example.
Did I do something wrong? Is there also a way to avoid ferries in Java Code and not by GET request?
Ah, sorry. I missed that. The problem here is that it is only “avoid ferry” and not “exclude ferry”. I.e. if the detour without the ferry would be too long it still uses the ferry. Excluding ferries is currently only possible for a dedicated setup. For more details about this please contact us per Email.
Thank you for your help. I am using a dedicated setup. I tried excluding ferries by writing my own Encoder:
public class NoFerryCarFlagEncoder extends CarFlagEncoder {
public NoFerryCarFlagEncoder(int speedBits, int speedFactor, int maxTurnCosts) {
super(speedBits, speedFactor, maxTurnCosts);
}
@Override
public EncodingManager.Access getAccess(ReaderWay way) {
if (way.hasTag("route", ferries))
return EncodingManager.Access.CAN_SKIP;
return super.getAccess(way);
}
}
But I’m not sure if this is the proper way to do it. At least it seemed to work and the routing service didn’t use the ferry.