Crates.io | valhalla-client |
lib.rs | valhalla-client |
version | 0.1.1 |
source | src |
created_at | 2023-07-11 01:10:36.518653 |
updated_at | 2023-07-14 20:54:16.615709 |
description | API client for the Valhalla routing engine |
homepage | |
repository | https://github.com/jelmer/valhalla-client-rs |
max_upload_size | |
id | 913431 |
size | 40,508 |
This crate contains the types and functions for interacting with the Valhalla API.
At the moment, only the routing API is implemented.
use valhalla_client::{Valhalla, Location, Manifest};;
let valhalla = Valhalla::default();
let manifest = Manifest {
locations: vec![Location::new(4.9041, 52.3676), Location::new(5.1214, 52.0907)],
costing: valhalla_client::Costing::Bicycle,
..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();