--- id: reverse-geocode version: "1.6.6" license: lgpl license_treatment: copyleft maintenance: active --- # reverse-geocode — Reverse geocode the given latitude / longitude License: copyleft · Maintenance: active · Downloads: 366.7K/mo ## What it is and what it does Reverse Geocode is a Python library that maps latitude/longitude coordinates to their nearest known geographic location (country, state, city) using offline lookup rather than a web API. It structures geonames data into a k-d tree for efficient nearest-neighbor searches, making it practical for bulk geocoding tasks where calling an external service would be impractical or undesirable. The package depends on numpy and scipy for its spatial indexing and numerical operations. Results are returned as dictionaries containing country code, country name, state, city, population, and exact coordinates of the matched location. You can filter results by minimum population to prefer larger cities over nearby smaller ones, though the package notes that point-based lookup gives only a rough approximation compared to polygon-based geographic systems. Use it for: - Batch reverse geocoding thousands of GPS coordinates from a dataset without hitting rate limits or API costs - Finding the nearest city to a set of sensor readings or IoT device locations in an offline or air-gapped environment - Filtering location results by population threshold to prioritize major cities over small towns in proximity searches - Building location-aware analytics on historical coordinate data where real-time API access is not available ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Reverse Geocode converts latitude/longitude coordinates to the nearest known country, state, and city using a k-d tree lookup against geonames data, without requiring a web API. Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a specific problem (offline bulk reverse geocoding) that web APIs handle poorly. The LGPL license is permissive for non-modifying use. Install it if you need to map coordinates to cities at scale without external dependencies. ## Install pip install reverse-geocode uv add reverse-geocode poetry add reverse-geocode ## Installing reverse-geocode Before you install: Low friction install with only numpy and scipy as runtime dependencies. The package is actively maintained with a recent commit on 2026-08-01 and has been stable since its first release in 2015. License in practice: Licensed under LGPL (copyleft), which requires that derivative works and modifications remain under the same license; using this package in proprietary software is permissible if you do not modify it, but modifications must be shared under LGPL terms. Quickstart: pip install reverse-geocode import reverse_geocode melbourne_coord = -37.81, 144.96 result = reverse_geocode.get(melbourne_coord) print(result) Verify before relying: - Whether the package supports batch processing of very large coordinate sets efficiently - How frequently the underlying geonames data is updated in the package - Accuracy limitations beyond the note that it is point-based rather than polygon-based ## Package facts - License: lgpl (copyleft) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 366.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags reverse geocoding coordinates, lat lon to city lookup, latitude longitude to location, nearest city from coordinates, offline geocoding, k-d tree location search, geonames lookup, geolocation, offline-lookup, spatial-indexing [View on SkillFed](https://skillfed.io/packages/reverse-geocode) · [View on PyPI](https://pypi.org/project/reverse-geocode/)