pub trait Forward<T> where
T: Float + Debug, {
fn forward(&self, address: &str) -> Result<Vec<Point<T>>, GeocodingError>;
}
Expand description
Forward-geocode a coordinate.
This trait represents the most simple and minimal implementation available
from a given geocoding provider: It returns a Vec
of zero or more Points
.
Examples
use geocoding::{Coordinate, Forward, Opencage, Point};
let oc = Opencage::new("dcdbf0d783374909b3debee728c7cc10".to_string());
let address = "Schwabing, München";
let res: Vec<Point<f64>> = oc.forward(address).unwrap();
assert_eq!(
res,
vec![Point(Coordinate { x: 11.5884858, y: 48.1700887 })]
);