Skip to main content

find_dock_to_dock_route

Function find_dock_to_dock_route 

Source
pub fn find_dock_to_dock_route(
    chart: &ChartStore,
    from_harbor: Position,
    to_harbor: Position,
    options: &FindOptions,
) -> Result<Option<Vec<Position>>, FindError>
Expand description

A check_leg-approved route between two harbours: from_harbor’s gateway, crate::find_route’s open-water search between the two gateways, then to_harbor’s gateway, combining two find_gateway calls with the open-water search between them so a caller does not stitch them by hand.

from_harbor and to_harbor are included as the first and last positions, unless a harbour was already its own gateway, but neither is validated by a check_leg call the way every position between them is: a harbour pin is routinely charted land at the precision check_leg insists on (see find_gateway_route’s own doc). Both bookend the route as a position, not a cleat, left for the mariner to close.

Ok(None) when either harbour has no gateway within GATEWAY_MAX_RADIUS_NM, or when crate::find_route itself finds no safe passage between the two gateways once found.

§Errors

If the chart cannot be read.