Python 3 Script to Convert Location or Address to Latitude and Longitude Coordinates Using geopy Module Full Project For Beginners



pip install geopy



After installing this library you need to make an file and copy paste the following code



# importing geopy library
from geopy.geocoders import Nominatim

# calling the Nominatim tool
loc = Nominatim(user_agent="GetLoc")

# entering the location name
getLoc = loc.geocode("Gosainganj Lucknow")

# printing address

# printing latitude and longitude
print("Latitude = ", getLoc.latitude, "\n")
print("Longitude = ", getLoc.longitude)

Leave a Reply