A lightweight offline reverse geocoding module for Python implemented in Rust.
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.51133Some locations include 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.
Initially forked from llambda/rust-reverse-geocoder for the Rust implementation of the algorithm.
Inspired by and meant to act as a dependency-free alternative to NumPy/SciPy-based thampiman/reverse-geocoder.