how to get latitude and longitude from address in python

Solutions on MaxInterview for how to get latitude and longitude from address in python by the best coders in the world

showing results for - "how to get latitude and longitude from address in python"
Glynis
23 May 2017
1# install
2pip install geopy
3# import
4from geopy.geocoders import Nominatim
5# code
6app = Nominatim(user_agent="test")
7address = "First St SE, Washington, DC 20004, United States"
8location = app.geocode(address).raw
9location['lat'], location['lon']
10>>> ('38.8716329', '-77.005766')