pub struct OpenRouteServiceClient { /* private fields */ }Expand description
Client for OpenRouteService - Routing and directions
Provides access to:
- Route directions and navigation
- Isochrones (reachability analysis)
- Geocoding and reverse geocoding
§Example
ⓘ
use ruvector_data_framework::OpenRouteServiceClient;
let client = OpenRouteServiceClient::new(None);
let route = client.get_directions((8.681495, 49.41461), (8.687872, 49.420318), "driving-car").await?;
let isochrones = client.get_isochrones((8.681495, 49.41461), vec![300, 600], "foot-walking").await?;
let geocode = client.geocode("Heidelberg").await?;Implementations§
Source§impl OpenRouteServiceClient
impl OpenRouteServiceClient
Sourcepub fn new(api_key: Option<String>) -> Self
pub fn new(api_key: Option<String>) -> Self
Create a new OpenRouteService client
§Arguments
api_key- Optional API key (free tier: 2000 requests/day) Get key from https://openrouteservice.org/dev/#/signup
Sourcepub async fn get_directions(
&self,
start: (f64, f64),
end: (f64, f64),
profile: &str,
) -> Result<Vec<SemanticVector>>
pub async fn get_directions( &self, start: (f64, f64), end: (f64, f64), profile: &str, ) -> Result<Vec<SemanticVector>>
Get directions between two points
§Arguments
start- Start coordinates (longitude, latitude)end- End coordinates (longitude, latitude)profile- Routing profile: “driving-car”, “cycling-regular”, “foot-walking”, etc.
§Example
ⓘ
let route = client.get_directions(
(8.681495, 49.41461),
(8.687872, 49.420318),
"driving-car"
).await?;Sourcepub async fn get_isochrones(
&self,
location: (f64, f64),
range: Vec<i32>,
profile: &str,
) -> Result<Vec<SemanticVector>>
pub async fn get_isochrones( &self, location: (f64, f64), range: Vec<i32>, profile: &str, ) -> Result<Vec<SemanticVector>>
Get isochrones (reachability polygons)
§Arguments
location- Center point (longitude, latitude)range- Time ranges in seconds (e.g., vec![300, 600, 900] for 5, 10, 15 minutes)profile- Travel profile: “driving-car”, “cycling-regular”, “foot-walking”
§Example
ⓘ
let isochrones = client.get_isochrones(
(8.681495, 49.41461),
vec![300, 600, 900],
"foot-walking"
).await?;Auto Trait Implementations§
impl Freeze for OpenRouteServiceClient
impl !RefUnwindSafe for OpenRouteServiceClient
impl Send for OpenRouteServiceClient
impl Sync for OpenRouteServiceClient
impl Unpin for OpenRouteServiceClient
impl !UnwindSafe for OpenRouteServiceClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more