2

I have came across an unexpected "issue" while working with the Esri JS API and ArcGIS Server Network Analysis service.

Once user submits the route solving task to the server, I'm appending the polylineBarriers to the RouteParameters. These polylines are pretty much the barriers affecting the route analysis. I'm also setting the "returnPolylineBarriers" to "true", in hope to get all the polylineBarriers that were encountered during the route solving task.

But I was fairly disappointed when I realized that this parameter just returns all the polyline barriers that I've submitted, even if these might be not obstructing the route at all.

My question is, is there any way I could get the array of all polyline barriers that affected the final solved path?

3
  • I'm not aware of any way to do this; it would have to be an output of the solver itself and since they're modifications to the network and not the solver I don't know of one that does. The only way I can think would be to run the analysis without barriers and then intersect the non-obstructed route with the barrier lines to see which affected. However even this wouldn't be guaranteed to work, since perhaps only one barrier would affect the initial route, but in avoiding that one it ends up running into a second, etc. Then there's the barrier type, cost or restrictive, and does that matter.
    – Chris W
    Commented May 6, 2015 at 7:17
  • exactly my thoughts. That the intersect is not guaranteed to return the correct number of encountered barriers. I'd have thought that the algorithm used for the routing would somehow stack the encountered obstructions. I imagine this wouldn't much difficult to implement once you have the source code. thanks though.
    – belzebu
    Commented May 6, 2015 at 7:46
  • Well, that's the thing - I don't know that it actually 'encounters' them. They are alterations to the network edges, so in theory they're set/applied before the solver ever even starts as modifications of edge properties. I think you would need to see source or something to know exactly how it's implemented (if they are 'encountered' and trackable). resources.arcgis.com/en/help/main/10.2/index.html#//… might give some clues.
    – Chris W
    Commented May 6, 2015 at 7:52

1 Answer 1

1

So I've contacted the ESRI Support and the response was

They [ESRI Redlands] have advised "that the solve route task excludes all edges that intersect barriers from it's calculations. Thus the solver never encounters any barriers when trying to solve the route and therefore cannot return which barriers were obstructing the route. This would also explain why all barriers are returned when including the returnBarriers parameter.

Enhancement request has been logged.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.