Siddhartha Paul
Siddhartha Paul
  • Видео 3
  • Просмотров 27 898
How to Plot Directions in Google Maps using Python | Route Plot | GMAPS
Creating route and direction plots in Google Maps using python. Used route generated from Travelling Salesman Problem (TSP) as an example.
Просмотров: 11 406

Видео

How to Calculate Distance Matrix using Google Maps in Python | Python | Google Maps
Просмотров 12 тыс.Год назад
* Calculating point-to-point distance and travel time using google maps API in Python. * A demo for solving a Travelling Salesman Problem (TSP) with the distance matrix. Links: Google Maps Platform: mapsplatform.google.com Direction API Documentaton: developers.google.com/maps/documentation/directions/get-directions
Travelling Salesman Problem (TSP) in Python | OR-Tools | kepler.gl
Просмотров 4,1 тыс.2 года назад
This video shows how we can solve a Travelling Salesman Problem (TSP) in python using open-source Google OR-Tools. Also, how can we plot & visualize the route using kepler.gl? Links * OR-Tools: developers.google.com/optimization/routing/tsp * Kepler.gl: docs.kepler.gl/docs/keplergl-jupyter * GitHub Link: github.com/paulsiddhartha0/travelling_salesman_problem.git * Cities Lat Long Data Set: www....

Комментарии

  • @bhagirathsinhjadeja2917
    @bhagirathsinhjadeja2917 2 месяца назад

    🎉🎉good product 🎉🎉 need interface where we can select in from and to position

  • @AGI-Bingo
    @AGI-Bingo 7 месяцев назад

    Hi there! Does this solution also take trafic into account or at least knows how long a route takes more than just a length bases calculation?

  • @congnghehay7187
    @congnghehay7187 7 месяцев назад

    Hi Paul, currently I get stuck with this idea: I have 1 depot and 9 customer (and I also have a dynamic customer list that will occur in each iteration). So can I ask you about the way to arrange my data files for the problem? In your video, I see that you set the "from_node" and "to_node" columns, so I think it will be hard for me to follow this since when there is a dynamic customer, their lat and long will be insert into the data file and create a new distance matrix of all nodes. So I hope to receive your response soon. Thank you very much

  • @JawidAfkar
    @JawidAfkar 7 месяцев назад

    Hi bro i have a probleem with my code can i contact you by whatsapp please? Thank you

  • @KingDevilAura
    @KingDevilAura 8 месяцев назад

    ...

  • @ismailelabbassi7150
    @ismailelabbassi7150 9 месяцев назад

    cool

  • @sterben1957
    @sterben1957 10 месяцев назад

    Suppose I need to deliver products to 20+ places based on their lat-longs from the depot, Is TSP going to help optimize the routes and determine how many vehicles do I need? Basically Can it optimize routes, vehicle numbers simultaneously?

    • @paulsiddhartha
      @paulsiddhartha 9 месяцев назад

      Yes you can use a capacity vehicle routing formulation with large capacity. This would automatically optimize for distance and vehicle count (assuming homogeneous vehicle type).

  • @PythonisLove
    @PythonisLove 11 месяцев назад

    So this is arc constraint problem?

  • @devendrachavan765
    @devendrachavan765 11 месяцев назад

    how can i save coordinates of routes

    • @paulsiddhartha
      @paulsiddhartha 9 месяцев назад

      you can use dictionaries with node id as key and coordinates as values.

  • @babaramdeventerprises5896
    @babaramdeventerprises5896 Год назад

    Do we need to generate route_plan xcel on our own, what data should we include can you please share route_plan ?

    • @payal.0902
      @payal.0902 11 месяцев назад

      No need to generate xcel file.. it's there in git hub link

  • @sharjeelakhtar8532
    @sharjeelakhtar8532 Год назад

    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?

    • @paulsiddhartha
      @paulsiddhartha 9 месяцев назад

      Basically, each origin-destination pair is considered as one call. So its number of origins X number of destinations unless you prune efficiently.

  • @zheshipeng
    @zheshipeng Год назад

    Very useful. Thanks a lot!

  • @princeireye
    @princeireye Год назад

    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?

  • @syrena7335
    @syrena7335 Год назад

    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?

    • @paulsiddhartha
      @paulsiddhartha Год назад

      yes, you can setup these parameters as follows: direction_result = gmaps_client.directions(source, destination , mode="driving", avoid="ferries", departure_time=now, transit_mode = 'bus', traffic_model='optimistic')

  • @keysonfire0
    @keysonfire0 Год назад

    how can you display the distance travelled in the TSP solution?

    • @paulsiddhartha
      @paulsiddhartha Год назад

      you can use the following piece of code for r in range(len(route)-1): print('%s-->%s (%d)'%(route[r], route[r+1], distance_dict[route[r],route[r+1]]))

  • @23bpm7rpm7
    @23bpm7rpm7 Год назад

    Can you share the code ??

  • @Micro_Learner
    @Micro_Learner Год назад

    Can you share the code ??

  • @sambitkumarsahu139
    @sambitkumarsahu139 Год назад

    Hi Siddhartha ............I found this video really helpful for my Project...Kindly share the link of the python code

  • @hdkhung
    @hdkhung Год назад

    Hi, thanks your video, it is usefull to me could you share your source code?

  • @fikrifikri-up4jx
    @fikrifikri-up4jx Год назад

    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!

    • @paulsiddhartha
      @paulsiddhartha Год назад

      Yes, you can use geocode in gmaps API. You can refer to ruclips.net/video/mXGyH8_FcMQ/видео.html In "source" and "destination", you can just enter the location names instead of the lat longs. Also, you can use gmaps "geocode" API to get the lat, longs. E.g. "geocode_result = gmaps.geocode("Kolkata") print(geocode_result[0]['geometry']['location'] ['lat'], geocode_result[0]['geometry']['location']['lng'])" Hope this helps.