Skip to main content

navcore_enc_store/
lib.rs

1//! Read-only queries against a chart GeoPackage.
2//!
3//! The second layer of the navigation core, and the first that touches a file.
4//! Above [`nav_math`], below anything that knows what a route is: this
5//! answers "what lies in this corridor of water, and is it safe for a
6//! vessel with this safety contour", and nothing else.
7//!
8//! # Why not the vector tiles
9//!
10//! The display pipeline's tiles are unusable here. Tippecanoe cuts geometry
11//! at tile boundaries, quantises it onto a grid, generalises per zoom level
12//! and drops features out of overfull tiles -- all correct for drawing, all
13//! fatal for deciding whether a line crosses a rock. The GeoPackage is the
14//! same source data with whole geometries and full precision.
15//!
16//! # Why no SpatiaLite
17//!
18//! The bounding-box prefilter is a plain SQL join against the R-Tree index
19//! every GeoPackage already carries; the exact geometry test happens here in
20//! Rust. That keeps the chart a file with no extensions to install, which is
21//! what lets the same file be read on every client platform.
22//!
23//! # What the mariner decides
24//!
25//! The file itself carries no notion of what is safe. The safety
26//! contour is supplied by the caller ([`Vessel`]) and is the same
27//! value the chart is drawn with, so there is one source of truth for
28//! which water counts as safe.
29
30#![forbid(unsafe_code)]
31
32mod check;
33mod corridor;
34mod store;
35
36pub use check::{Finding, Severity, Vessel, check_leg};
37pub use corridor::{Leg, Sailing, Segment};
38pub use store::{Attribute, ChartStore, Feature, StoreError};