Sample App for route optimisation

Using Google Map API to call the optimized route for A to B point, I generated a quick sample and placed on my portfolio.

User enters the address of origin and destination. Default is set as “driving” but can select the mean to walking, train or bicycle.

Virtual column generate Google Map URL and showing the best fitting route dynamically.

https://www.appsheet.com/samples/Sample-App?appGuidString=237580df-e851-4b3c-ae23-404436737444

13 Likes

Nice man!

2 Likes

Instead of address type field , latlon type data field should work as well.

1 Like

Google drive has a limit of 1000 queries per day, is there a way to add the google drive api to get more?

I have tried it with excel some time ago, when i entered a few locations and tried to get the best route.
Lets say i have an origin lication and then 5 addresses. What would be the best route to drive between those places. Would it be possible with this app as well?

We are just opening URL I don’t think this trick will be restricted by max daily usage etc.

1 Like

As far as I read google api docs, there is a way to add another parameter of waypoints in addition to origin and destination. However the sequence of waypoint which come first , second , third is just folllowing the order of list you place to parameters. URL won’t change the sequence at all. If we have sequence of point to go, a followed by b , c , d and finish at e, then yes we are able to calculate the same.

1 Like

I will look at your app closely later on. Meantime, you are truely a master in my eyes :+1:

3 Likes

Enjoy my tips, let me know if you need a help.

2 Likes

Will do, thanks.
I was trying for a while now to incoprate google drive with an app. My client has to plan routes to pick up employees and get them to their working sites. You can do it with google maps, insert the addresses and get a route. However, you need to insert the data manualy, every address. With excel, i built a vba matrix to calculate best route by distance. If i can load my addresses via appsheet to google maps and get the route back, that would be great

2 Likes

I updated my sample app a bit.
Can add waypoints as via points in addition to origin / destination.
Then URL will dynamically generate the route on google map. But after that, user can play around with google map to change the order/sequence of point they visit first, second etc. URL wont calculate the best opt route, but users have flexibility and free hands to change the sequences easily.

4 Likes

not testing how many waypoints we are able to add, but should have bar, depending on user device according to google documents.\

waypoints : Specifies one or more intermediary places to route directions through between the origin and destination . Multiple waypoints can be specified by using the pipe character ( | ) to separate places (for example, Berlin,Germany|Paris,France ). The number of waypoints allowed varies by the platform where the link opens, with up to three waypoints supported on mobile browsers, and a maximum of nine waypoints supported otherwise. Waypoints are displayed on the map in the same order they are listed in the URL. Each waypoint can be either a place name, address, or comma-separated latitude/longitude coordinates. Strings should be URL-escaped, so waypoints such as “Berlin,Germany|Paris,France” should be converted to Berlin%2CGermany%7CParis%2CFrance .

2 Likes

Add waypoints.
Select option, either to type the address manually, or pick up the pin from map, then place latlon (googlespredsheet convert latlong to Address using Script).

Then generate the route on google map.

After that, juggle the sequence on google map to play around.

3 Likes

This… is… brilliant! :exploding_head:

thank you cat


When used on a mobile device with Google Maps installed, the links will open in Gmaps with waypoints and everything.

Just epic sir!

2 Likes

Wow! I off course did not expected that ! Thank you I will try with my phone as well.

1 Like

Yes, Matt!

On my Iphone, link to google map activated the google map (app) with plots of selected address. And then I could play around, change the order of visiting points and google map looked after that, to re-calc the opt route. Thanks for heading me up.

4 Likes

Thank YOU for finding this capability and making this happen.
Snoopy thank you

1 Like

Here you can add up to 20 addresses and it will calculate the best route.


Maybe the have an API? :thinking:

1 Like

We have created our own Google Maps Direction API. If you sign up for a ‘proper’ account and give them credit card details your free queries actually increases. I’ve just checked last month and we did 24263 API calls which should have been $121.32. But it came under the limit set by the “Maps Free Tier”. The key change you have to make it to use the API key they give you in the script.

1 Like

I wrote a script in google sheets but the API didnt work. Google told me that google sheets dont support their own API