none
How to get travel time in future date through Bing Maps Route API RRS feed

  • Question

  • I have a similar question as this one:

    I am requesting route data for future date which is specified through time parameter e.g. time =YYMMDDhhmm from bing map API

    Below is the example url :

    http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=462/2,LalBahadurShastriRd,PantanchaGate,SadashivPeth,Pune,Maharashtra&wp.1=Swargate%20ST%20Stand,%20Satara%20Road,%20Swargate,%20Pune,%20Maharashtra%20411042&travelMode=Driving&limit=D&time=201602112300&key=Bing map key

    I am not getting whether it is providing data of future date only.

    Kindly reply.

    I have a similar question as the above.  I tried to get travel time between two locations during different days (Weekday vs. Weekend), the Bing map showed the travel time should be 34 minutes and 28 minutes(weekend).  But from the Jason output files, the travel duration data are almost the same. ["travelDuration":1461,"travelDurationTraffic":1718]. Just couple of seconds difference.  I expected at least about 6 minutes (300 seconds) difference.  Please see below for the Route API I used, please let me know if this is the right way to use the API with time field as the original question mentioned.  Thanks!

    Weekday:

    http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=7100%20Corporate%20Dr%2CPlano%2CTX%2075024&wp.1=909%20Hidden%20Ridge%2CIrving%2CTX%2075038&travelMode=Driving&limit=D&time=201602121700&key=

    Weekend:

    http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=7100%20Corporate%20Dr%2CPlano%2CTX%2075024&wp.1=909%20Hidden%20Ridge%2CIrving%2CTX%2075038&travelMode=Driving&limit=D&time=201602131700&key=

    Friday, February 12, 2016 9:02 PM

Answers

  • 1718 seconds - 1461 seconds = 257 seconds difference

    This is a little over 4 minutes difference which isn't that far off from 6 minutes. If you look at the full travel time of the route, this works out to a 7% difference which is pretty minor. The routing engine is using estimates to try and predict the traffic. These are estimates for the future, you won't get 100% accuracy.


    http://rbrundritt.wordpress.com

    Friday, February 12, 2016 9:25 PM
  • Ok, "time" isn't a documented URL parameter for that service. It's called "dateTime": https://msdn.microsoft.com/en-us/library/ff701717.aspx

    http://rbrundritt.wordpress.com

    • Proposed as answer by Ricky_Brundritt Tuesday, February 16, 2016 4:14 PM
    • Marked as answer by PHZhou Tuesday, February 16, 2016 8:52 PM
    Tuesday, February 16, 2016 4:14 PM

All replies

  • 1718 seconds - 1461 seconds = 257 seconds difference

    This is a little over 4 minutes difference which isn't that far off from 6 minutes. If you look at the full travel time of the route, this works out to a 7% difference which is pretty minor. The routing engine is using estimates to try and predict the traffic. These are estimates for the future, you won't get 100% accuracy.


    http://rbrundritt.wordpress.com

    Friday, February 12, 2016 9:25 PM
  • Thanks for your reply.  I may should clarify my question.

    For the 2 Route queries, I passed in different times.  But I can not see the difference from the output Jason files.  In both files I got the same travel time range: ["travelDuration":1461,"travelDurationTraffic":1718].

    So basically there are only two kinds of travel time predictions, travelDuration and travelDurationTraffic.  No matter what start time I passed in.  But in the Bing Maps website, I saw on Weekday it showed moderate traffic and gave travel time as 34 minutes and in weekend, it showed light traffic and gave travel time as 28 minutes.  What's the logic behind this?  I assume it parsed the JASON file I got and extract the travel time, is this the case?

    I am wondering if I should pass in the time in a different format and through a different field.  Thanks!

    Friday, February 12, 2016 9:46 PM
  • Ah. Try set the route optimization in your requests to timeWithTraffic. The default is just time.

    http://rbrundritt.wordpress.com

    Saturday, February 13, 2016 12:19 AM
  • I added the optimization, but still can not see the difference from the JSON outputs.  My feeling is that the "Leave At" time input was not taken/passed in at all.  Is the start time supported with the current version?

    For one query I passed the start time as time=201602131700 (Feb 16th, Tuesday, 5PM)

    the other start time is: time=201602131700 (Feb 20th, Saturday, 5PM) -- Traffic is light from the Bing Maps

    But in the out put JASON files, both showed  

    "travelDistance":35.261,"travelDuration":1621}],"trafficCongestion":"Mild","trafficDataUsed":"Flow","travelDistance":35.261,"travelDuration":1461,"travelDurationTraffic":1621}]}]

    Please see below for the URL I passed in:

    http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=7100%20Corporate%20Dr%2CPlano%2CTX%2075024&wp.1=909%20Hidden%20Ridge%2CIrving%2CTX%2075038&travelMode=Driving&optmz=timeWithTraffic&routeAttributes=excludeItinerary&time=201602161700&key

    The other URL is exactly the same except the "Time=" part, which a weekend date is given.

    Thank you for your input.

     
    Monday, February 15, 2016 4:01 PM
  • Ok, "time" isn't a documented URL parameter for that service. It's called "dateTime": https://msdn.microsoft.com/en-us/library/ff701717.aspx

    http://rbrundritt.wordpress.com

    • Proposed as answer by Ricky_Brundritt Tuesday, February 16, 2016 4:14 PM
    • Marked as answer by PHZhou Tuesday, February 16, 2016 8:52 PM
    Tuesday, February 16, 2016 4:14 PM
  • Thank you so much so your help.  I finally got this to work with the below URL:

    http://dev.virtualearth.net/REST/V1/Routes/Driving?wp.0=7100%20Corporate%20Dr%2CPlano%2CTX%2075024&wp.1=909%20Hidden%20Ridge%2CIrving%2CTX%2075038&travelMode=Driving&optmz=timeWithTraffic&routeAttributes=excludeItinerary&timeType=Departure&dateTime=2016/02/16%2017:00:00&key=

    Thanks a lot!!

    Tuesday, February 16, 2016 8:57 PM
  • Hi,

    We have checked and found that it is working. But we want to confirm REST service "http://dev.virtualearth.net/REST" is supported or will get deprecated after June 2016.

    Is there any way to get the travel time in Bing map V8.

    Thanks!

      


    Balasaheb

    Thursday, December 15, 2016 10:19 AM