LocalRoutingTask- Ordering of Routes and TotalCost property

3601
2
05-07-2015 06:33 PM
LinaYap1
New Contributor II

I am using LocalRouteTask, on ArcGIS Runtime SDK for .NET 10.2.5

I have a limited network dataset (the only impedance is Length), so I have not been able to make an observation on the following.

In any circumstances that the LocalRouteTask returns more than one Route in RouteResult, how are these routes ordered? Are they ordered by the cost (on the impedance attribute)?

Would like to know what does the property Route.TotalCost indicate? What is specified as "key". The routes I had solved only provides:

- TotalWait_Length (always 0)

- TotalViolation_Length (always 0)

I am assuming that Route.TotalCost to include the cost based on impedance attribute.

Eg. ImpedanceAttribute = "Slope"

So...Route.TotalCost["Slope"] will return the cost of the route

0 Kudos
2 Replies
AsserSwelam1
Occasional Contributor

Hi Lina,

We now support only one returned route for the RouteResults.

The TotalCost may vary depend on your settings, you will find more detailed description on what it is, how it is calculated and how to use the route cost in the links below.

ArcGIS Help1

ArcGIS Help2

ArcGIS Help3

Hope that helps.

Thanks,

Asser

0 Kudos
LinaYap1
New Contributor II

Hi Asser,

Thanks for the reply.

I am actually interested in "how" the cost value is being represented/provided through the runtime API.

Ie. taking a look at ArcGIS Desktop​, Route Properties section, is it safe to assume that Total_[ImpedanceAttribute] will be included in Runtime API: Route.TotalCost dictionary?

-Based on my observation, with the only impedance attribute (Length) I have, Route.TotalCost[Total_Length] is never provided along with any of the Route object.

-So then, I tried this: routeParameters.AccumulateAttributeNames.Add("Length") - which then throws an internal error when attempting to solve for the network routing

So will Route.TotalCost property actually be providing accumulated cost based on the impedance attribute? Am I missing any configuration?

Thanks in advance!

0 Kudos