none
Distance Matrix does not return Result when StartTime is specified RRS feed

  • Question

  • I would like to use the Bing Maps Distance Matrix to create a travel plan based on departure times from several locations. I can successfully calculate the travel distance and time as long as the StartTime parameter is not given in the request. When I specify this parameter I do not get any results. Now, Bing Maps says in order to get the departure time for a location this parameter, StartTime, must be specified. Please help how to use this parameter, as well as the format for the input datetime value.
    Thursday, October 18, 2018 1:28 AM

All replies

  • Hi Chasing D,

    The documentation at https://msdn.microsoft.com/en-us/library/mt827298.aspx shows

    startTime Optional for Driving, but required if making asynchronous Driving request. Specifies the start or departure time of the matrix to calculate and uses predictive traffic data. This should be a date string in a format that can be parsed by DateTimeOffset.Parse. This option is only supported when the travel mode is set to driving.

    Example: startTime=2017-06-15T8:00:00-07:00

    Sincerely,

    IoTGirl

    Thursday, October 18, 2018 4:20 AM
    Owner
  • Hi I am having the same issue with Distance Matrix. I am providing the startDate in the right format (If I provide the startDate in wrong format, the request fails). But in this case the request succeeds (with 200 OK) but gives me zero for all distances and times that I am querying. The request gives correct values if I don't use the startTime. Below is my query. Any help will be appreciated

    https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=12.96234,77.6376&destinations=12.98235,77.63502;12.98583,77.64489&travelMode=driving&key=<MY_API_KEY>&timeUnit=minutes&startTime=2017-06-15T08:00:00-07:00

    Friday, February 1, 2019 4:20 PM
  • Hi Krishna,

    Can you try a startDate in the future?  Ours was provided as a format sample but I suspect the 200 is due to having a start in the year 2017 rather than 2019.

    Sincerely,

    IoTGirl

    Wednesday, February 6, 2019 4:10 PM
    Owner
  • Hi,

     Thanks for the response. I too mentioned the date as a reference. I tried with future dates. But that gives me same error (I tried https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=12.96234,77.6376&destinations=12.98235,77.63502;12.98583,77.64489&travelMode=driving&key=<MY_API_KEY>&timeUnit=minutes&startTime=2019-06-15T08:00:00-07:00 ) and got same result

    Sunday, February 10, 2019 2:58 PM