Get direction between two points on Google Map in Python

Viewed 22

I am trying to get a direction between two locations on the Google map in python 3.x. but I get this error and I don't know how I should handle it. I get the first location from the user:

### Input a postcode from the dataframe
data=str(input("Enter a Building Number in the UK: "))
df2=df.loc[df['OrganisationID'] == data]
df2

uk_map = folium.Map(location=(53.73589575092651, -1.7988921945289895), zoom_start=6)
for index,row in df2.iterrows(): 
 folium.Marker(location=(df2['latitude'], 
                         df2['longitude']), 
               popup=df['geocode']).add_to(uk_map)

display(uk_map)

So, the first location should be in uk_map variable, and for the second location I am using Location2= (51.142150, 0.313660). How can I get direction from 1 to 2?

0 Answers
Related