Last active
May 8, 2019 18:00
-
-
Save koffisani/04cfafe5988093837a7f1f49ac5bc082 to your computer and use it in GitHub Desktop.
Request Geocoding Open Street Map Nomatim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
url = 'https://nominatim.openstreetmap.org/reverse' | |
## Sample data | |
lon_value=1.19116 | |
lat_value=6.2169 | |
params = dict( | |
format='jsonv2', | |
lat=lat_value, | |
lon=lon_value, | |
addressdetails=1, | |
zoom=18 | |
) | |
resp = requests.get(url=url, params=params) | |
data = resp.json() ## returns a dict | |
print(data['address']['suburb']) ## You can get data easily. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment