Trait geocoding::Reverse [] [src]

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

Reverse-geocode a coordinate.

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

Examples

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

Required Methods

Implementors