Skip to main content

find_gateway

Function find_gateway 

Source
pub fn find_gateway(
    chart: &ChartStore,
    harbor: Position,
    options: &FindOptions,
) -> Result<Option<Position>, FindError>
Expand description

The nearest point to harbor that crate::find_route’s open-water search can use as a from or to: harbor itself if that is already clear, otherwise the first point found searching outward in expanding rings. See this module’s own doc for the search itself and what it does not attempt.

Ok(None) when nothing was found within GATEWAY_MAX_RADIUS_NM: either harbor is nowhere near navigable water, or its gateway lies down a channel narrower than this search’s rays cross paths with.

§Errors

If the chart cannot be read.