I am using ArcGIS Runtime for .NET, 10.2.6, and using LocalRouteTask to execute routing analysis.
I would like to indicate some scaled-cost polygon barriers for routing.
I had created a set of polygon barriers to be added to the route analysis, and then added the following attributes:
- polygonGraphic.Attributes[BarrierType] = 1;
Adding this line do allow me to route across the polygon barriers. Then, to consider the scaled cost, I had tried adding the following attributes (my impedance attribute is "Length"):
- polygonGraphic.Attributes["Attr_Length"] = 2;
- polygonGraphic.Attributes["Length"] = 2;
The returned result, do show a route across the barrier, but I am not sure if the cost were actually considered.
Checking the attributes of the polygonbarriers:
- RouteResult.PolygonBarriers[index].Attributes["AddedCost"] : always an empty dictionary
- RouteResult.PolygonBarriers[index].Attributes["Status"] : always 0
- RouteResult.PolygonBarriers[index].Attributes["BarrierType"] : value=1.
Any advice? Thanks in advance.
It looks like you are taking the right approach, but it would really useful if you could provide a more complete example we can test. Include the data if possible, otherwise we can test against various runtime network datasets.
I was asked a question similar to this recently. I also have a ready-to-run application that can display this issue in-house and it leverages our San Diego data for the online/offline routing. Everything appears to work fine when using an Online Routing Service, but when leveraging a LocalRouteTask I've noticed that the Cost attributes always return zero and it appears that the solver is ignoring scaled cost polygons. I've attached the sample I've written.
We have been experiencing the same issue where LocalRoutes cost attributes always return zero. Calls to Route.GetTotalLength and the property Route.TotalTime return 0. Has there been any resolution for this issue or is there a current bug/ticket I can follow or track. Thanks. Freddie Gibson
Hi Jason Graves,
I have logged a bug for this issue and it appears that we will be addressing this issue in a future release. If you have access to Esri Support please log a ticket and we can get you attached to the bug I logged for this issue.