#reverse #geocoding #geocoder #location

reverse_geocoder

Offline reverse geocoder library

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

Download history 216/week @ 2023-01-18 261/week @ 2023-01-25 204/week @ 2023-02-01 231/week @ 2023-02-08 273/week @ 2023-02-15 544/week @ 2023-02-22 362/week @ 2023-03-01 231/week @ 2023-03-08 264/week @ 2023-03-15 212/week @ 2023-03-22 175/week @ 2023-03-29 118/week @ 2023-04-05 97/week @ 2023-04-12 500/week @ 2023-04-19 156/week @ 2023-04-26 235/week @ 2023-05-03

1,004 downloads per month
Used in 2 crates

MIT/Apache

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

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