Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to get latitude and longitude from address in python

# install
pip install geopy
# import
from geopy.geocoders import Nominatim
# code
app = Nominatim(user_agent="test")
address = "First St SE, Washington, DC 20004, United States"
location = app.geocode(address).raw
location['lat'], location['lon']
>>> ('38.8716329', '-77.005766')
 
PREVIOUS NEXT
Tagged: #latitude #longitude #address #python
ADD COMMENT
Topic
Name
3+2 =