4 releases (2 breaking)
new 0.3.0 | Feb 16, 2025 |
---|---|
0.2.0 | Dec 25, 2024 |
0.1.1 | Jul 14, 2023 |
0.1.0 | Jul 11, 2023 |
#502 in Web programming
105 downloads per month
200KB
3K
SLoC
Rust API client for Valhalla
This crate contains the types and functions for interacting with the Valhalla API.
These APIs are implemented:
- Turn-by-Turn Route
- Optimized Route
- Time-Distance Matrix
- Isochrone & Isodistance
- Map Matching
- Valhalla locate
- Elevation
- Expansion
- Status
Examples
use valhalla_client::Valhalla;
use valhalla_client::route::{Location, Manifest};
use valhalla_client::costing::{Costing};
let valhalla = Valhalla::default();
let amsterdam = Location::new(4.9041, 52.3676);
let utrecht = Location::new(5.1214, 52.0907);
let manifest = Manifest::builder()
.locations([amsterdam, utrecht])
.costing(Costing::Motorcycle(Default::default()));
let response = valhalla.route(manifest).unwrap();
println!("{:#?}", response);
// If the gpx feature is enabled, you can convert the response to a gpx::Gpx object
// let gpx = response.trip.into();
Dependencies
~8–19MB
~264K SLoC