[][src]Trait geocoding::Forward

pub trait Forward<T> where
    T: Float
{ fn forward(&self, address: &str) -> Result<Vec<Point<T>>, GeocodingError>; }

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.5761796, y: 48.1599218 })]
);

Required methods

fn forward(&self, address: &str) -> Result<Vec<Point<T>>, GeocodingError>

Loading content...

Implementors

impl<'a, T> Forward<T> for Opencage<'a> where
    T: Float + DeserializeOwned
[src]

fn forward(&self, place: &str) -> Result<Vec<Point<T>>, GeocodingError>[src]

A forward-geocoding lookup of an address. Please see the documentation for details of best practices in order to obtain good-quality results.

This method passes the no_annotations and no_record parameters to the API.

impl<T> Forward<T> for GeoAdmin where
    T: Float,
    T: Deserialize<'de>, 
[src]

fn forward(&self, place: &str) -> Result<Vec<Point<T>>, GeocodingError>[src]

A forward-geocoding lookup of an address. Please see the documentation for details.

This method passes the type, origins, limit and sr parameter to the API.

impl<T> Forward<T> for Openstreetmap where
    T: Float,
    T: Deserialize<'de>, 
[src]

fn forward(&self, place: &str) -> Result<Vec<Point<T>>, GeocodingError>[src]

A forward-geocoding lookup of an address. Please see the documentation for details.

This method passes the format parameter to the API.

Loading content...