A library for fast, offline reverse geocoding. The location data are from GeoNames.
Usage
First, add this to your Cargo.toml
[]
= "^1.0.1"
Next:
use reverse_geocoder::{Locations, ReverseGeocoder};
fn main() {
let loc = Locations::from_memory();
let geocoder = ReverseGeocoder::new(&loc);
let coords = (45.0, 54.0);
let search_result = geocoder.search(coords).expect("Search error.");
println!("Distance {}", search_result.distance);
println!("Record {}", search_result.record);
}