Skip to main content

Reverse geocode the given latitude / longitude

Project description

Reverse Geocode

Reverse Geocode takes a latitude / longitude coordinate and returns the country and city. Example usage:

>>> import reverse_geocode
>>> coordinates = (-37.81, 144.96), (31.76, 35.21)
>>> reverse_geocode.search(coordinates)
[{'city': 'Melbourne', 'country_code': 'AU', 'country': 'Australia'},
 {'city': 'Jerusalem', 'country_code': 'IL', 'country': 'Israel'}]

The module has a set of known geocoded locations and uses a k-d tree to efficiently find the nearest neighbour. This can be useful when you need to reverse geocode a large number of coordinates so a web API is not practical.

As this is a point based and not a polygon based lookup it will only give a rough idea of the location/city

Install

Supports python 2 & 3:

pip install reverse-geocode
pip3 install reverse-geocode

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reverse_geocode-1.6.tar.gz (2.0 MB view hashes)

Uploaded Source

Built Distribution

reverse_geocode-1.6-py3-none-any.whl (2.0 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page