I was trying to find the optimized route using google direction api by providing the waypoints.Below are the waypoints i have used statring point: LHR first waypoint: Hounslow second waypoint: harlington
When I tried to find the optimized track using http://findthebestroute.com/RouteFinder.html below is the response which is the obvious answer and correct.
But now i would like to perform same in my own application using directionservice api provided by google. I have prepared the above request as following
Request Url: http://maps.googleapis.com/maps/api/directions/json
Request Method: GET
Status Code: 200
Params: {
"origin": "LHR",
"mode": "driving",
"sensor": "false",
"departure_time": "1375789483",
"units": "metric",
"waypoints": "optimize:true|hounslowl|harlington"
}
and i am getting the wrong response as following which suggest me LHR to Hounslow and to harlingston. I don't know what's wrong with the request i have made. Any help is strongly appreciable.

Sorry to answer to my own question. But since i was having great problem with the above scenario, I hope this has happened to other as well. This is for those who are having same problem and wasting time to find the desired answer.
I was searching for the answer to the question for almost 2 days. And finally found that there is no direct one step method to calculate the result and get the way point in sorted order. But there is way by sending multiple optimize route request to google.
Before I explain this simple logic, let's first figure out the required parameter that you need to set
Now the thing is you first need to set the origin and find the best final destination to obtain the optimized track.
For eg. if you are have number of way points say A, B, C, D. It is true that this order may not remain same after we find the optimized track. So first we need to decide that from where we want to begin the route let's assume B, then we need to calculate three optimized track assuming remining one of the point is final destination. Meaning
seeing at the result we have three possible track with different distance value and time. Now you simply can select your optimized track based on time optimization or distance optimization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With