Expand description
Automatic route generation: the shortest path [enc_store::check_leg]
calls safe between two positions.
Safety decisions belong to [enc_store::check_leg], the same function
route_check uses to validate a route a human drew.
This crate generates candidate waypoints and searches them:
gridlays a lattice of candidate positions over the area betweenfromandto, andhazardsmarks which of them a vessel cannot stand on, from a single chart query rather than one per candidate.searchfinds the shortest safe path over that lattice with A*.smoothstraightens the resulting zig-zag into a short waypoint list and callscheck_legon every straightened leg, so every leg this crate hands back is approved at the vessel’s real corridor, not the lattice’s approximation of it.
The lattice, hazard test and search generalize to weather routing: only the edge cost (distance here) would change to sailing time under a wind forecast.
Structs§
- Find
Options - What a route is being planned for, and how far around the direct line to search.
Enums§
- Find
Error - Everything that can go wrong finding a route.
- Land
Cache Error - Everything that can go wrong baking a chart’s land cache.
Functions§
- bake_
land_ cache - Bakes a land cache for
chart, covering whatever areadetect_coverage_areafinds plusRASTER_PADDING_DEG, and writes it to<chart.path()>.hazcache(orout, if given) – run once, ahead of time, byenc-check bake, never at route-query time. - find_
dock_ to_ dock_ route - A
check_leg-approved route between two harbours:from_harbor’s gateway,crate::find_route’s open-water search between the two gateways, thento_harbor’s gateway, combining twofind_gatewaycalls with the open-water search between them so a caller does not stitch them by hand. - find_
gateway - The nearest point to
harborthatcrate::find_route’s open-water search can use as afromorto:harboritself 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. - find_
gateway_ route - A
check_leg-approved route fromharborout tofind_gateway’s confirmed destination: the actual path there, not just the point, validated end to end fromharbor’s exact position onward. See this module’s own doc, “A second approach”, for how this compares tofind_gateway. - find_
route - The shortest route between
fromandtothatcheck_legcalls safe for the vessel described inoptions.