Комментарии:
Thanks for the video. When you are calculating distance matrix, does google charge you based on number of API calls or on the basis of number of origins X number of destinations?
ОтветитьThanks. This tutorial has been super helpful. I keep getting the following index error when trying to iterate through the rows to get the distance and travel time:
<ipython-input-14-82106501bbfa> in <cell line: 1>()
3 direction_result = gmaps_client.directions(row['from_lat_long'], row['to_lat_long'],
4 mode = "driving", avoid = "ferries", departure_time = start_time)
----> 5 df.loc[index, 'distance'] = direction_result[0]['legs'][0]['distance']['value']
6 df.loc[index, 'travel_time'] = direction_result[0]['legs'][0]['duration']['value']
7 df.loc[index, 'distance_text'] = direction_result[0]['legs'][0]['distance']['text']
IndexError: list index out of range
Do you have any recommendations?
Hi, thank you for your videl. If I may ask, there are some option parameters in distance matrix api, such as we can set up trafifc_model as 'best_guess', 'pessimistic', 'optimistic'. can we set up these parameters?
ОтветитьHi, thanks your video, it is usefull to me could you share your source code?
Ответитьhi. thank you for your explanation about the distance matrix calculation. that's so helpful for me to understand. if i may ask, how can u get thos latlong data? can we use the geocode in gmaps api? please kindly enlighten me. thank you!
Ответить