-2

I've been doing some work on preparing an optimal route in python and I have circa 60 latitude longitude points in a pandas dataframe that I would like to turn into a route displayed on google maps. I don't need directions from google, just to display a route through my already ordered waypoints.

It would be great if I could do this in code but even a manual hack/solution would be acceptable. I understand there's a max 10 limit to number of waypoints in the browser but there are ways round it. I tried to generate a url like this https://www.google.com/maps/dir/lat1,long1/lat2,long2/lat3,long3 ... and so on up to 60. This does display the points in google maps but doesn't draw a route.

I think based on what I've read it's possible to write some javascript to chunk all these up and plot it but (although I did try to adapt a couple of scripts) that's beyond my capabilities at the moment.

Any thoughts on best approach?

Cheers

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
Al___
  • 51
  • 1
  • 3
  • 1
    Can you show the scripts that you tried to adapt? – General Grievance Apr 14 '21 at 19:44
  • @Calculuswhiz I based it on the link below. I know this predates the API key changes so I adapted it to add my key but I continually got errors. I then tried to take some other basic frameworks for google maps and then slowly augment with bits of this code but every time I solved one error I would get a different one. https://github.com/rhiever/optimal-roadtrip-usa/blob/gh-pages/major-landmarks.html#L93 – Al___ Apr 14 '21 at 19:52
  • Not really sure what you are trying to do overall, but you can easily write a GPX file from your points and upload it to somewhere like https://www.gpxeditor.co.uk/ to have it displayed on a map. – Mark Setchell Apr 14 '21 at 21:11
  • possible duplicate of [Want to Display Direction Between 100 Address on Google Maps](https://stackoverflow.com/questions/31337710/want-to-display-direction-between-100-address-on-google-maps) – geocodezip Apr 15 '21 at 00:29
  • related question: [Google Maps API to get bus route](https://stackoverflow.com/questions/15315347/google-maps-api-to-get-bus-route) – geocodezip Apr 15 '21 at 00:30

1 Answers1

-1

Neither Google or Bing Maps supports this. Take a look at Azure Maps. It supports routing with up to 150 waypoints and has a lot more advanced routing options than either of the other two platforms. Here are some details:

https://azure.com/maps

https://learn.microsoft.com/en-us/azure/azure-maps/how-to-use-best-practices-for-routing

https://learn.microsoft.com/en-us/rest/api/maps/route/getroutedirections

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
  • OP did not ask for API recommendations, even though the question is tagged with multiple API tags. Your answer though is VLQ. – MrUpsidown Apr 15 '21 at 11:09
  • They did ask about Bing Maps which is from Microsoft. Azure Maps is the newer mapping platform from Microsoft. – rbrundritt Apr 15 '21 at 15:46