solverforge_maps/lib.rs
1//! Generic map and routing utilities for VRP and similar problems.
2//!
3//! # Quick Start
4//!
5//! ```no_run
6//! use solverforge_maps::{BoundingBox, Coord, NetworkConfig, RoadNetwork, RoutingResult};
7//!
8//! #[tokio::main]
9//! async fn main() -> RoutingResult<()> {
10//! let locations = vec![
11//! Coord::try_new(39.95, -75.16)?,
12//! Coord::try_new(39.96, -75.17)?,
13//! ];
14//!
15//! let bbox = BoundingBox::from_coords(&locations).expand(0.1);
16//! let config = NetworkConfig::default();
17//!
18//! let network = RoadNetwork::load_or_fetch(&bbox, &config, None).await?;
19//! let matrix = network.compute_matrix(&locations, None).await;
20//! let route = network.route(locations[0], locations[1])?;
21//!
22//! println!("Matrix size: {}", matrix.size());
23//! println!("Route: {:?}", route);
24//! Ok(())
25//! }
26//! ```
27
28pub mod geometry;
29pub mod routing;
30
31pub use geometry::{decode_polyline, encode_polyline, EncodedSegment};
32pub use routing::{
33 haversine_distance, BBoxError, BoundingBox, CacheStats, ConnectivityPolicy, Coord, CoordError,
34 NetworkConfig, NetworkRef, Objective, RoadNetwork, RouteResult, RoutingError, RoutingProgress,
35 RoutingResult, SnappedCoord, SpeedProfile, TravelTimeMatrix, UNREACHABLE,
36};