none
Direction question

    Question

  • Hi,

    We have used below API to get the direction between addresses. It is working when we pass addresses count less than 25 but when we pass addresses more than 25 then it gives error.  

    https://dev.virtualearth.net/REST/V1/Routes/Driving?

    Can we get the direction between more than 25 addresses.

    Waiting for your reply.

    Thanks!

     


    Balasaheb

    Monday, January 7, 2019 6:42 AM

All replies

  • Hi Balasaheb,

    This limit is documented at https://docs.microsoft.com/en-us/bingmaps/rest-services/routes/calculate-a-route

    "You can have a maximum of 25 waypoints, and a maximum of 10 viaWaypoints between each set of waypoints. The start and end points of the route cannot be viaWaypoints."

    Sincerely,

    IoTGirl


    Monday, January 7, 2019 5:39 PM
    Owner
  • Hi,

    Thanks for your reply.

    Is there any way to get direction between more than 25 addresses.

    Thanks!

     


    Balasaheb

    Tuesday, January 8, 2019 1:07 PM
  • With Bing Maps the only option would be to make multiple route calls and to combine the responses together.

    I recommend taking a look at Azure Maps which supports up to 150 waypoints per route request.


    Tuesday, January 8, 2019 6:33 PM
  • Hi Balasaheb,

    As Ricky mentions, there is a sample on GITHUB you can review at https://github.com/Microsoft/BingMapsRESTToolkit/blob/master/Source/Requests/RouteRequest.cs

    This sample also shows the over 25 option he mentions using viaWaypoints.  

    https://dev.virtualearth.net/REST/v1/Routes?wayPoint.1=wayPoint1&viaWaypoint.2=viaWaypoint2&waypoint.3=wayPoint3&wayPoint.n=wayPointn&heading=heading&optimize=optimize&avoid=avoidOptions&distanceBeforeFirstTurn=distanceBeforeFirstTurn&routeAttributes=routeAttributes&maxSolutions=maxSolutions&tolerances=tolerance1,tolerance2,tolerancen&distanceUnit=distanceUnit&mfa=mfa&key=BingMapsKey
    
    

     NOTE: that viaWaypoints can not be the start or end and only 10 or less are allowed between Waypoints.

    Sincerely,

    IoTGirl

    Wednesday, January 9, 2019 4:41 AM
    Owner