How to ignore lengths of ferry routes?

Hello,

I’m working on a route-based lodging algorithm that dynamically suggests sleeping locations based on how far a user wants to travel each day. This works well in most cases, but I’ve encountered an issue when ferries are part of the route.

As seen in the screenshot below, the algorithm calculates total travel distance, including ferry routes. This leads to incorrect lodging recommendations—if a user sets a daily travel limit of 80 km, the algorithm assumes they need lodging immediately after disembarking the ferry, even though ferry travel requires no effort.

I’d like to adjust the algorithm so that ferry segments don’t contribute to the distance used for lodging calculations (while still allowing them in the initial route planning). Ideally, I’d modify the route data after retrieval to set ferry distances to 0.

Has anyone dealt with a similar issue? Is there a way to adjust route data to ignore ferry distances post-processing?

You can calculate the ferry distance based on the path details. The GraphHopper UI is doing the same by requesting the path details distance and road_environment.

1 Like