Alternate route in routing application

4427
5
03-25-2015 09:20 PM
SandeepKumar
New Contributor II

I am working on a routing application using silverlight for arcgis.I have successfully achieved routing in my application,but i am able to create only single route.My requirement is to create 3 possible routes from source to destination.Please someone help to get out from this problem.

Tags (2)
0 Kudos
5 Replies
AsserSwelam1
Occasional Contributor

Hi Sandeep,

You can achieve this by using the first route results you get to do another route using the first result as a barrier for the next route, then using the first and second results as a barriers to get a third route.

Take a look at BaseRouteParameters Class Members and the Routing With Barriers sample for help.

-Asser

Asgharkhan
Occasional Contributor

Wow ! new esri GURU ,

Thanks A lot

Please Follow me ,

0 Kudos
SandeepKumar
New Contributor II

Thanks for your reply.....But my requirement is to achieve alternate route without human intervention....The example you gave shows adding barriers using point click on map.How can i consider the first route as barrier using code in silverlight..can you give some other example or can suggest the steps to achieve this?

AsserSwelam1
Occasional Contributor

Hi Sandeep,

Actually the returned route results contain the Route and it is a Polyline Geometry. And the Barriers parameter is a type if Enumerable(Graphics) so you will add the returned line to the Barriers parameter then do another Route task with the new parameter. Then the returned results will be another polyline route. So now you have two possible routes. Then do the same using the two routes you got to create a third route. And then show each route on the map to show the user the three possible routes.

No user interaction needed in this to achieve that.

Thanks,

Asser

SandeepKumar
New Contributor II

Hi Asser,

We have implemented the concept of alternate route in our application by using the approach, you suggested. Thanks for your kind support.

Thanks,

Sandeep

0 Kudos