python nominatim get latitude from address

Solutions on MaxInterview for python nominatim get latitude from address by the best coders in the world

showing results for - "python nominatim get latitude from address"
Claudia
26 Jan 2021
1>>> from geopy.geocoders import Nominatim
2>>> geolocator = Nominatim(user_agent="specify_your_app_name_here")
3>>> location = geolocator.geocode("175 5th Avenue NYC")
4>>> print(location.address)
5Flatiron Building, 175, 5th Avenue, Flatiron, New York, NYC, New York, ...
6>>> print((location.latitude, location.longitude))
7(40.7410861, -73.9896297241625)
8>>> print(location.raw)
9{'place_id': '9167009604', 'type': 'attraction', ...}
10