Optimal route with timed waypoints - google-maps-api-3

I want to plan a route for a delivery truck with a number of stops along the way where some of the stops need to be timed. I have tried to figure out a way that makes use of the Directions service and the Distance service without making a ton of requests. If someone has got a solution in theory I can probably put together the code myself. Thanks!

Related

Zip Codes along driving route

I know that there is a Google API that can provide directions and/or driving distance between 2 points.
Is there a way to get all of the zip codes that the route passes through, or within a specified distance from the route?
The application has to do with deliveries. E.G. a truck is making a delivery from point A to point B. I would like to get all of the zip codes along the route in order to determine which other deliveries can be done in the same trip.
I've only found one post for something similar, but it's old, the links aren't valid any more and I would think there is something else out there.

Here Routing API with no instructions

im looking to reduce the size of the responses when calculate route, currently im using maneuverAttributes=sh so the response is long, but there are fields im not using at all, like instruction text and street names, i didn´t find how to avoid those in the response. It is possible?
Also, there is any "definition" setup i can make for the route shape? my intention is to receive a approximate of the route shape, using only the legs is way to generic, but the points for the route shape are way too detailed for my use case, and i want to reduce the response size and memory use in the app.

Get nearest intersection using HERE Maps APIs

I want to measure the distance to the next intersection/traffic light based on a gps location(s).
I DON’T have a route (i.e. no destination point) but I can get gps locations every second (while on the move).
Is it possible to get the information using HERE APIs?
I understand that there is no direct way (specific api) to do it, but I would appreciate any idea that will fulfill my needs.
The general idea that I came up with was getting at least 2 gps points to understand the direction, then getting link_id for current location and try to get the next links in same direction/road and find if any of them are intersections...
I didn’t find a way to do it. Any ideas?
There is no direct API for this however there is an idea that you have to crawl along the link into the direction determined like you outlined (or better by sending the last few GPS points to our Route Matcher (aka RME)) until you reach an intersection.
And this can be achieved with a concept of "electronic horizon" in SDK. It takes your current road link and driving direction and then crawls forward over the upcoming links until an intersection comes (or even beyond taking the most probable choice). mobile SDK has this "electronic horizon" feature.
https://developer.here.com/documentation/android-premium/dev_guide/topics/electronic-horizon.html

Maximum number of avoid areas exceeds limit using avoid areas

I am trying to get a route between two points using avoid areas with Routing API HERE maps and I am having the error "Maximum number of avoid areas exceeds limit".
Below you could find the request I am using:
https://route.cit.api.here.com/routing/7.2/calculateroute.json?app_id=#####&app_code=#####g&waypoint0=geo!39.4640023,-0.3850572&waypoint1=geo!39.476885,-0.3801068&mode=fastest;car;traffic:disabled&avoidareas=39.45315053433366,-0.3745426849935516;39.45244111598196,-0.3758222574575006!39.45646192309658,-0.3727107307399733;39.456087897102364,-0.3738696063317133!39.45594467628818,-0.37061955378352013;39.455610302758494,-0.37146705481229625!39.46063897809171,-0.3637087111174383;39.460208373008,-0.36463342201032306!39.46027406507121,-0.3644229889377801;39.45945896807123,-0.36512131930616654!39.45778290983732,-0.36235345142498465;39.45722411730335,-0.36284132909356276!39.458055076124936,-0.3685070306751628;39.45796969111227,-0.369566281083658!39.45960790790132,-0.36670532495457014;39.45880954421065,-0.3687782227883713!39.46786419209955,-0.3788290555558871;39.466598324440575,-0.37952348064968555!39.46629280916266,-0.37952060299424345;39.46579450682472,-0.3798614186868332!39.447906189702366,-0.3865406097869585;39.44771727050539,-0.38799155376945255!39.447906266440604,-0.3860336486039068;39.44767149909636,-0.3866130855790714!39.45518409583871,-0.3836551666444044;39.454907307568014,-0.38405749286187724!39.45964221683283,-0.38704088462136754;39.45899783260966,-0.38824034688297143!39.46042754674725,-0.3884778363064053;39.45992759234617,-0.3890550711354175!39.46052328505597,-0.38689531313812037;39.459738005168106,-0.38822226990415315!39.46193614040639,-0.389429648171608;39.46154553298938,-0.3900677999760695!39.46191503182935,-0.39018276482275266;39.46111159154079,-0.3909970310465749!39.4639823644881,-0.39148296845987174;39.46280010046198,-0.39256505432368666!39.467739617727254,-0.38146113326699044;39.46706936907706,-0.3821015492686101!39.46976679855793,-0.3846784165944088;39.46901057325898,-0.3860335643592155!39.469205752460745,-0.38845565289929074;39.46871087077631,-0.38937325235434783!39.47401789680908,-0.39616459840290014;39.4733842284781,-0.396270815957154!39.47423647867104,-0.39540645561031434;39.47401789680908,-0.39616459840
I would like to know if this limitation is because I am using a free trial plan or because the API have this limitation. In this case any idea to solve this limitation?
Below you could find the here guide to use Avoid areas, if someone is interested.
https://developer.here.com/rest-apis/documentation/routing/topics/example-route-avoiding-an-area.html
Thanks,
This is an API limitation. Trial credentials don't limit the functionality of available service.

Add many routes using Google Maps Directions Service Over Query Limit

I have an application that requires having many (sometimes over 50) dynamic routes added to the google map. Using the DirectionsService, I am able to add right around 10 routes or so before the requests start to fail with the status of "Over Query Limit". I was wondering if anyone has encountered this situation and has found a way to deal with it. It seems that even if I pause between requests, I am still failing for anything over the first 10. Not sure if there is a request limit for a single map instance?
Any help with this would be much appreciated!
According to the documentation, you can only get up to 2 requests per second. If your code do that slower than 2 per second, that should be fine.
I used the setInterval(function(){.... to test it and yup, if you do it slow enough it seems to work.
http://jsfiddle.net/bd1qdLv3/

Resources