//! Map index — pure-Rust S2 cell geometry and the bridge to the standard's //! address space. //! //! The geometry modules ([`cell_id`], [`covering`], [`lat_lng`], [`point`], //! [`projection`], [`region`], [`polygon`], [`edge`], [`metrics`]) are the S2 //! hierarchical, Hilbert-ordered decomposition of the sphere — the basis for the //! horizontal axis of a [`map_schema::CellKey`] and for turning a viewport into //! the set of cells a reader must fetch (SPEC §2, §4). They are pure Rust (no //! PROJ, no C), so the whole crate compiles to WASM unchanged. //! //! The [`bridge`] module connects this geometry to `map-schema`: it builds a //! `CellKey` from real coordinates and covers a viewport into the cell keys that //! drive [`map_schema::Directory::ranges_for`]. pub mod cell_id; pub mod covering; pub mod edge; pub mod lat_lng; pub mod metrics; pub mod point; pub mod polygon; pub mod projection; pub mod region; pub mod volume; pub mod bridge; // The upstream `polygon` module shipped with broken containment/area routines // (it fails its own tests in joule-s2) and never implemented `S2Region`. The // port corrects both algorithms (spherical winding-angle containment + van // Oosterom–Strackee signed area) and adds `impl S2Region for S2Polygon`, so the // coverer (SPEC §4) can cover an arbitrary boundary / footprint / geofence — not // just caps and rectangles. See `polygon.rs`. // Re-exports for convenience (mirrors the upstream joule-s2 surface). pub use cell_id::S2CellId; pub use covering::S2RegionCoverer; pub use lat_lng::S2LatLng; pub use point::S2Point; pub use polygon::S2Polygon; pub use region::{S2Cap, S2Rect, S2Region}; pub use bridge::{ alt_band, cell_key, cover_region, cover_viewport, cover_volume, schema_cell, time_bucket, ViewportCover, };