7 releases (stable)
3.0.1 | Jul 12, 2022 |
---|---|
3.0.0 | Mar 2, 2022 |
2.0.1 | Jan 11, 2021 |
2.0.0 | May 2, 2020 |
1.0.1 | Mar 29, 2020 |
#66 in Science
1,004 downloads per month
Used in 2 crates
2MB
139 lines
reverse_geocoder
A fast, offline reverse geocoder.
Documentation
https://docs.rs/reverse_geocoder/
Usage
Add this to your Cargo.toml
:
[dependencies]
reverse_geocoder = "3.0"
Benchmark
cargo bench
on M1:
> cargo bench
search time: [416.30 ns 416.39 ns 416.49 ns]
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
A library for fast, offline reverse geocoding. The location data are from GeoNames.
Usage
use reverse_geocoder::{Locations, ReverseGeocoder, SearchResult};
fn main() {
let loc = Locations::from_memory();
let geocoder = ReverseGeocoder::new(&loc);
let coords = (40.7831, -73.9712);
let search_result = geocoder.search(coords).unwrap();
println!("Distance {}", search_result.distance);
println!("Record {}", search_result.record);
}
Dependencies
~2–2.8MB
~47K SLoC