[][src]Trait geocoding::Reverse

pub trait Reverse<T> where
    T: Float
{ fn reverse(
        &self,
        point: &Point<T>
    ) -> Result<Option<String>, GeocodingError>; }

Reverse-geocode a coordinate.

This trait represents the most simple and minimal implementation available from a given geocoding provider: some address formatted as Option.

Examples

use geocoding::{Opencage, Point, Reverse};

let p = Point::new(2.12870, 41.40139);
let oc = Opencage::new("dcdbf0d783374909b3debee728c7cc10".to_string());
let res = oc.reverse(&p).unwrap();
assert_eq!(
    res,
    Some("Carrer de Calatrava, 68, 08017 Barcelona, Spain".to_string())
);

Required methods

fn reverse(&self, point: &Point<T>) -> Result<Option<String>, GeocodingError>

Loading content...

Implementors

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

fn reverse(&self, point: &Point<T>) -> Result<Option<String>, GeocodingError>[src]

A reverse lookup of a point. More detail on the format of the returned String can be found here

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

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

fn reverse(&self, point: &Point<T>) -> Result<Option<String>, GeocodingError>[src]

A reverse lookup of a point. More detail on the format of the returned String can be found here

This method passes the format parameter to the API.

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

fn reverse(&self, point: &Point<T>) -> Result<Option<String>, GeocodingError>[src]

A reverse lookup of a point. More detail on the format of the returned String can be found here

This method passes the format parameter to the API.

Loading content...