Expand description
Generic map and routing utilities for VRP and similar problems.
§Quick Start
use solverforge_maps::{BoundingBox, Coord, NetworkConfig, RoadNetwork, RoutingResult};
#[tokio::main]
async fn main() -> RoutingResult<()> {
let locations = vec![
Coord::new(39.95, -75.16),
Coord::new(39.96, -75.17),
];
let bbox = BoundingBox::from_coords(&locations).expand(0.1);
let config = NetworkConfig::default();
let network = RoadNetwork::load_or_fetch(&bbox, &config, None).await?;
let matrix = network.compute_matrix(&locations, None).await;
let route = network.route(locations[0], locations[1])?;
println!("Matrix size: {}", matrix.size());
println!("Route: {:?}", route);
Ok(())
}Re-exports§
pub use geometry::decode_polyline;pub use geometry::encode_polyline;pub use geometry::EncodedSegment;pub use routing::haversine_distance;pub use routing::BBoxError;pub use routing::BoundingBox;pub use routing::CacheStats;pub use routing::Coord;pub use routing::CoordError;pub use routing::NetworkConfig;pub use routing::NetworkRef;pub use routing::Objective;pub use routing::RoadNetwork;pub use routing::RouteResult;pub use routing::RoutingError;pub use routing::RoutingProgress;pub use routing::RoutingResult;pub use routing::SnappedCoord;pub use routing::SpeedProfile;pub use routing::TravelTimeMatrix;pub use routing::UNREACHABLE;