rgeocoder

A lightweight offline reverse geocoder implemented in Rust.


Keywords
reverse-geocoder, reverse-geocoding, geocoder, maturin, pyo3, python, rust
License
MIT
Install
pip install rgeocoder==0.1.6

Documentation

rgeocoder

PyPI version Documentation

A lightweight offline reverse geocoder implemented in Rust with pyo3 Python bindings.

Basic usage

pip install rgeocoder
>>> from rgeocoder import ReverseGeocoder
>>> rg = ReverseGeocoder()
>>> r = rg.nearest(41.891929, 12.511331)  # lat, lon
>>> print(r.name, r.cc)
'Rome IT'
>>> print(r.lat, r.lon)
41.89193 12.51133

Some locations include the first- and second-level administrative divisions:

>>> print(r.admin1)
'Latium'
>>> print(r.admin2)
'Citta metropolitana di Roma Capitale'

See http://download.geonames.org/export/dump/readme.txt for more information on the dataset.

License

MIT License

Credits

Rust implementation of the algorithm originally based on code from llambda/rust-reverse-geocoder.

Inspired by and meant to act as an alternative to thampiman/reverse-geocoder.