How to get Route Failure Details

515
9
08-23-2010 12:29 PM
ManishGohil
New Contributor III
Hi ,
We have network dataset that will route the over size vehicle with the list of restriction.If for the given Vehicle dimension if there is failure at some point becuase of restriction then what will be the best way to get the route failure details .
I know one option is the INetworkQuery to query the source feature using the EID(Edige Id) but don't know how get the list of the Edge Id of the route that we can get without restriction

Any help will be appreciated
Thanks
Manish Gohil
Tags (2)
0 Kudos
9 Replies
MichaelRice
New Contributor III
May I ask why you ultimately need this information? Perhaps there is a better way to achieve your goals.

The reason I ask this is because, unfortunately, the Route solver does not have such information directly available to it to report to the end user, in the event that a valid route cannot be found.

During the search for a path, the solver queries the network dataset to see which edges from a given junction can be accessed. This query will only return valid edges, based on the restrictions being applied. Therefore, the solver has no knowledge of any invalid edges which were filtered by the network dataset, since they were never returned to the solver.

If absolutely necessary, there are several ways you can try and get the information you are needing, each with different tradeoffs:

  1. Enumerate all edges from the network dataset and, based on the current analysis restrictions, maintain a list of which edges are restricted (i.e., which edges return "true" for one or more of your applied restriction attributes). Depending on your network size, however, this may not really be a scalable solution.

  2. Create a restriction attribute with a custom evaluator (based on custom programming logic) to act as a proxy for all of your other restriction attributes. Essentially, this would just be a single evaluator which could "forward" any restriction attribute queries on to the other restriction attributes for a given edge. If any of these forwarded calls return "true" (i.e., to indicate a restricted edge), then the proxy evaluator can simply log this edge's EID information internally. This approach is more complex than the prior approach, but it will result in only those subsets of restricted edges which actually prevented a route from being found.

0 Kudos
MichaelRice
New Contributor III
One other possibility would be to simply turn off your restriction attributes in your analysis layer, and then solve to find a path (which you should be able to, assuming your network is connected). Then, simply iterate over those edges along that path to see which ones are restricted for your intended restriction attributes. I don't know if this is exactly what you are looking for, though.
0 Kudos
ManishGohil
New Contributor III
Hello Michael,
Thanks for the reply.
There is a requrement in the automated permitting system that when there is no route found for the give vehicle dimension may be the weight is two high for some of the bridges then we need to provide those bridge information that this bridge is not satisfying the vehicle weight or the Height is too high for the underpass clearance.

We can do your suggested approach but if you can suggest in this direction then it will be good:
If i solve the routing by turning off the restriction then it will return the route and direction but i don't know how to interate through each and every edge that participate in the result route.

Thanks
Manish Gohil.
0 Kudos
MichaelRice
New Contributor III
You must solve the route and then access the "traversal result" of the route programmatically. The traversal result is really just a collection of three feature classes: Edges, Junctions, and Turns. These three classes represent the individual edges, junctions, and turns, respectively, that were traversed to produce your current route solution.

Here is a link which provides some of the relevant interfaces for programmatically accessing this information, including some sample code for retrieving and adding the traversal result feature classes as layers in your map:

http://resources.esri.com/help/9.3/ArcGISDesktop/ArcObjects/esriNetworkAnalyst/INATraversalResultQue...

If you only have (or are only concerned about) restrictions on the edges of your network, then you can simply get the Edges feature class from the traversal result and iterate through this list of edges. To do this, you would need to get a feature cursor from this Edges feature class and iterate through the cursor. Each feature should have the appropriate field values (e.g., EID, FromPosition, and ToPosition) with which you can query the appropriate edge element from INetworkQuery, so that you can test each edge for restrictions as necessary.

Note that the "position" field values, FromPosition and ToPosition, are assigned with respect to the digitized direction of the edge's source feature. You can use this information to infer the direction of the edge. Specifically, if FromPosition < ToPosition, then the edge is traversed in the "Along-Digitized" direction. If FromPosition > ToPosition, then the edge is traversed in the "Against-Digitized" direction.

Please let me know if you need any further help.
0 Kudos
PatrickStevens
Esri Contributor
If it helps, and if you are using ArcMap 10.0, here is a link to an Add-In for generating the traversal result:

Network Analyst Traversal Result Add-In

Instructions for installing and running the Add-in are at the link.  Basically, after your route has successfully solved, you click the button for the Add-in and the three in-memory traversal result feature classes (Edges, Junctions, and Turns) are generated and added to the table of contents.
0 Kudos
ManishGohil
New Contributor III
Hello Patrick,
The Add-In is working fine with the ArcMap 10 and i am able to get each edge and junction details.
I am developing web application and for accessing Network dataset i am using published ArcGIS Map  Service .
I am using NAServerProxy Instance for solving a route
My development reference is the this :
http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/developer/samples/Web_Applications/ArcGIS...

If i have to get the INALayer using this approach then which way i can get it?
Please suggest

Thanks
Manish Gohil
0 Kudos
ManishGohil
New Contributor III
Hello Patrick,
The Add-In is working fine with the ArcMap 10 and i am able to get each edge and junction details.
I am developing web application and for accessing Network dataset i am using published ArcGIS Map Service .
I am using NAServerProxy Instance for solving a route
My development reference is the this :
http://resources.esri.com/help/9.3/arcgisserver/adf/dotnet/developer/samples/Web_Applications/ArcGIS...

If i have to get the INALayer using this approach then which way i can get it?
Please suggest

Thanks
Manish Gohil
0 Kudos
DmitryKudinov
Occasional Contributor
Hi Manish,

.Net ADF API is deprecated since ArcGIS 10.0. I would recommend you to build a custom GP tool which would take a solved Route Layer and export its traversal result as output.

Next, you can create a GP model which would take all the input parameters, solve route, call your custom tool, and export the traversal result.

Final step then would be publishing this model as a Geo Processing service which can be consumed by your clients via multiple APIs including REST.

You might find these documents useful:

- http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/00010000049w000000.htm
- http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/0093/009300000029000000.h...


Regards,

Dmitry
0 Kudos
ManishGohil
New Contributor III
Hello Michael,
Thanks for your help i am done my development with the approach you have suggested.


Thanks again,
Manish Gohil
0 Kudos