multiple locations with useTraffic

5 posts / 0 new
Last post
cmj
multiple locations with useTraffic

I am using the directions route api to get the time for two different routes.  Each route uses multiple locations so that I can precisely plan out each route and offer a comparison.  I find that when using multiple locations that the useTraffic  = true, with timeType = 1, does not return a result where useTraffic =  true in the response options.  

 

I can get an appropriate response when I specify a to and from request.

 

The multiple location request returns everything else as expected, just not with traffic enabled.  This results in the same travel time being returned regardless of time. 

 

Is there a limitation on useTraffic and a multiple location route plan?

 

Thanks!


MQBrianCoakley
No, traffic influenced
No, traffic influenced routing should work for more than two locations. Can you post a sample request that is not returning the expected result?

cmj
Samples below.  Options

Samples below.  Options returned for those with useTraffic and timeType come back as options not enabled.  Anecdotally, I do not recall the total ime for the requests without the options changing.

Route A without useTraffic and timeType
http://www.mapquestapi.com/directions/v2/route?key=###&json={locations:["36.261101,-115.216498","36.253099,-115.24684","36.170447, -115.192643","36.129955, -115.18878","36.1294,-115.145964","36.111925,-115.141846"]}

"options": {
      "mustAvoidLinkIds": [],
      "drivingStyle": 2,
      "countryBoundaryDisplay": true,
      "generalize": -1,
      "narrativeType": "text",
      "locale": "en_US",
      "avoidTimedConditions": false,
      "destinationManeuverDisplay": true,
      "enhancedNarrative": false,
      "filterZoneFactor": -1,
      "timeType": 0,
      "maxWalkingDistance": -1,
      "routeType": "FASTEST",
      "transferPenalty": -1,
      "walkingSpeed": -1,
      "stateBoundaryDisplay": true,
      "maxLinkId": 0,
      "arteryWeights": [],
      "tryAvoidLinkIds": [],
      "unit": "M",
      "routeNumber": 0,
      "doReverseGeocode": true,
      "shapeFormat": "raw",
      "maneuverPenalty": -1,
      "useTraffic": false,
      "returnLinkDirections": false,
      "avoidTripIds": [],
      "manmaps": "true",
      "highwayEfficiency": 22,
      "sideOfStreetDisplay": true,
      "cyclingRoadFactor": 1,
      "urbanAvoidFactor": -1
    },

Route A with useTraffic and timeType
http://www.mapquestapi.com/directions/v2/route?key=###&json={locations:["36.261101,-115.216498","36.253099,-115.24684","36.170447, -115.192643","36.129955, -115.18878","36.1294,-115.145964","36.111925,-115.141846"]}&useTraffic=true&timeType=1

    "options": {
      "mustAvoidLinkIds": [],
      "drivingStyle": 2,
      "countryBoundaryDisplay": true,
      "generalize": -1,
      "narrativeType": "text",
      "locale": "en_US",
      "avoidTimedConditions": false,
      "destinationManeuverDisplay": true,
      "enhancedNarrative": false,
      "filterZoneFactor": -1,
      "timeType": 0,
      "maxWalkingDistance": -1,
      "routeType": "FASTEST",
      "transferPenalty": -1,
      "walkingSpeed": -1,
      "stateBoundaryDisplay": true,
      "maxLinkId": 0,
      "arteryWeights": [],
      "tryAvoidLinkIds": [],
      "unit": "M",
      "routeNumber": 0,
      "doReverseGeocode": true,
      "shapeFormat": "raw",
      "maneuverPenalty": -1,
      "useTraffic": false,
      "returnLinkDirections": false,
      "avoidTripIds": [],
      "manmaps": "true",
      "highwayEfficiency": 22,
      "sideOfStreetDisplay": true,
      "cyclingRoadFactor": 1,
      "urbanAvoidFactor": -1
    },

Route B without useTraffic and timeType
http://www.mapquestapi.com/directions/v2/route?key=###&json={locations:["36.261101,-115.216498","36.253099,-115.24684","36.168585,-115.159054","36.114641,-115.177612","36.111925,-115.141846"]}

    "options": {
      "mustAvoidLinkIds": [],
      "drivingStyle": 2,
      "countryBoundaryDisplay": true,
      "generalize": -1,
      "narrativeType": "text",
      "locale": "en_US",
      "avoidTimedConditions": false,
      "destinationManeuverDisplay": true,
      "enhancedNarrative": false,
      "filterZoneFactor": -1,
      "timeType": 0,
      "maxWalkingDistance": -1,
      "routeType": "FASTEST",
      "transferPenalty": -1,
      "walkingSpeed": -1,
      "stateBoundaryDisplay": true,
      "maxLinkId": 0,
      "arteryWeights": [],
      "tryAvoidLinkIds": [],
      "unit": "M",
      "routeNumber": 0,
      "doReverseGeocode": true,
      "shapeFormat": "raw",
      "maneuverPenalty": -1,
      "useTraffic": false,
      "returnLinkDirections": false,
      "avoidTripIds": [],
      "manmaps": "true",
      "highwayEfficiency": 22,
      "sideOfStreetDisplay": true,
      "cyclingRoadFactor": 1,
      "urbanAvoidFactor": -1
    },

Route B with useTraffic and timeType
http://www.mapquestapi.com/directions/v2/route?key=###&json={locations:["36.261101,-115.216498","36.253099,-115.24684","36.168585,-115.159054","36.114641,-115.177612","36.111925,-115.141846"]}&useTraffic=true&timeType=1

 "options": {
      "mustAvoidLinkIds": [],
      "drivingStyle": 2,
      "countryBoundaryDisplay": true,
      "generalize": -1,
      "narrativeType": "text",
      "locale": "en_US",
      "avoidTimedConditions": false,
      "destinationManeuverDisplay": true,
      "enhancedNarrative": false,
      "filterZoneFactor": -1,
      "timeType": 0,
      "maxWalkingDistance": -1,
      "routeType": "FASTEST",
      "transferPenalty": -1,
      "walkingSpeed": -1,
      "stateBoundaryDisplay": true,
      "maxLinkId": 0,
      "arteryWeights": [],
      "tryAvoidLinkIds": [],
      "unit": "M",
      "routeNumber": 0,
      "doReverseGeocode": true,
      "shapeFormat": "raw",
      "maneuverPenalty": -1,
      "useTraffic": false,
      "returnLinkDirections": false,
      "avoidTripIds": [],
      "manmaps": "true",
      "highwayEfficiency": 22,
      "sideOfStreetDisplay": true,
      "cyclingRoadFactor": 1,
      "urbanAvoidFactor": -1
    },


cmj
I should clarify my above

I should clarify my above statement " Anecdotally, I do not recall the total time for the requests without the options changing."

If I run the request every day at the same time, or even a differetn time, for a week, I always get the same total time.  This is odd in that Saturday is different than Wednesday, especially when you consider the route.  As I said this is anecdotale.  I'll schedule inquires and data logging to ensure my anecdotale statement is correct.


MQBrianCoakley
Are you grabbing time or
Are you grabbing time or realTime from the response? The time parameter should not change. It is purely the mathematical calculation of distance, speed limit, and some maneuver penalties. The realTime parameter will indicate how long the route takes given traffic.