<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: New route problem in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597022#M5755</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nick,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; With ArcGIS 10 (and earlier versions), the traversal result can be accessed only via ArcObjects. However, you can use a trick to add the traversal result as feature layers in ArcMap and then use the feature layers in Model Builder with any geoprocessing tools that work with feature layers. For this to work, &lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;In ArcMap, create a new VBA macro and copy this VBA code in the macro body.&lt;/LI&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub AddNATraversalResultToArcMap()
&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp; Dim pNetworkAnalystExtension As INetworkAnalystExtension
&amp;nbsp; Dim pNALayer As INALayer
&amp;nbsp; Dim pFLayer As IFeatureLayer
&amp;nbsp; Dim pTraversalResultQuery As INATraversalResultQuery
&amp;nbsp; Dim pNATraversalResultEdit As INATraversalResultEdit
&amp;nbsp; 
&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp; Set pNetworkAnalystExtension = Application.FindExtensionByName("Network Analyst")
&amp;nbsp; Set pNALayer = pNetworkAnalystExtension.NAWindow.ActiveAnalysis
&amp;nbsp; Set pTraversalResultQuery = pNALayer.Context.Result
&amp;nbsp; Set pNATraversalResultEdit = pTraversalResultQuery
&amp;nbsp; 
&amp;nbsp; 'Infer Geometry
&amp;nbsp; pNATraversalResultEdit.InferGeometry "", Nothing, New CancelTracker
&amp;nbsp; 
&amp;nbsp; 'Get the Edges and add as a layer
&amp;nbsp; Set pFLayer = New FeatureLayer
&amp;nbsp; Set pFLayer.FeatureClass = pTraversalResultQuery.FeatureClass(esriNETEdge)
&amp;nbsp; pFLayer.Name = pFLayer.FeatureClass.AliasName
&amp;nbsp; pMxDoc.FocusMap.AddLayer pFLayer
&amp;nbsp; 
&amp;nbsp; 'Get the Junctions and add as a layer
&amp;nbsp; Set pFLayer = New FeatureLayer
&amp;nbsp; Set pFLayer.FeatureClass = pTraversalResultQuery.FeatureClass(esriNETJunction)
&amp;nbsp; pFLayer.Name = pFLayer.FeatureClass.AliasName
&amp;nbsp; pMxDoc.FocusMap.AddLayer pFLayer
End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;LI&gt;Solve the Closest Facility layer and then run the macro. This will add two layers "Edges" and "Junctions" to ArcMap. The layer represents the edges and junctions traversed while finding routes.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Move these two layers below the Closest Facility layer in Table of Contents (TOC). This will ensure that the traversal layers are not broken when you reopen the map document.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; Save the map document.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; The traversal layers can be used in Model builder with any gp tools. Every time the Closest Facility layer is solved, the traversal layers are updated. &lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;Some caveats to keep in mind&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;The traversal layers are associated only with the existing closest facility layer. Any time you create a new layer, you need to remove the existing traversal layers and rerun the macro to create new layers.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;In your GP model, you need to re-use the same closest facility layer. Since there is no way to edit properties of existing closest facility layers using GP(a tool or via python), you cannot change any analysis properties (such as number of facilities to find) in your model. However, You can change them from layer properties in ArcMap.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Any time the solve fails to find a solution, the traversal layers are removed from the TOC. So you need to rerun the macro to add the traversal layers after a successful solve.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;As the traversal layers are just available in the TOC, you have to run the GP model from inside the map document containing the traversal layers.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;And hopefully some good news, at 10.1, the network analyst toolbox will have a new GP tool that takes a network analysis layer and saves the traversal layers as feature classes on disk avoiding all these issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Deelesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:37:45 GMT</pubDate>
    <dc:creator>DeeleshMandloi</dc:creator>
    <dc:date>2021-12-12T01:37:45Z</dc:date>
    <item>
      <title>New route problem</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597018#M5751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to network analyst, so having some trouble working with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some GPS points and want to construct the corresponding route. So, I started with exporting my GPS points to ArcMap and then used 'new route', and 'add locations' sequentially to snap my GPS points to the network. Till this point, everything seems alright but after this I don't know how to proceed. I also solved my route and got the route consisting all GPS points. This route gives me total length and doesn't get any attributes from the network.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my network I have few attributes, such as no. of lanes, functional class etc. and for my new route I want to find some coverage statistics such as, % of 2 lanes, 3 lanes.., % of functional class = 1, 2, 3 etc. Is there a way to get attributes from the network so that I can calculate some of these statistics for my route?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 22:08:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597018#M5751</guid>
      <dc:creator>NagendraDhakar</dc:creator>
      <dc:date>2010-09-27T22:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: New route problem</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597019#M5752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So it sounds like you can solve the route but need to analyze the results more.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One way can be to spatially select all the roads that overlap your route and then summarize them and the other can be to add the "traversal" results being stored in memory as a feature class to ArcMap and summarize them. The traversal results has every edge of the route with its network attributes. You can use the following link to see how to access the traversal result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000245000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000245000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jay Sandhu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Sep 2010 15:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597019#M5752</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2010-09-28T15:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: New route problem</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597020#M5753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So it sounds like you can solve the route but need to analyze the results more.&lt;BR /&gt;One way can be to spatially select all the roads that overlap your route and then summarize them and the other can be to add the "traversal" results being stored in memory as a feature class to ArcMap and summarize them. The traversal results has every edge of the route with its network attributes. You can use the following link to see how to access the traversal result:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000245000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000245000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Jay Sandhu&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Sep 2010 21:16:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597020#M5753</guid>
      <dc:creator>NagendraDhakar</dc:creator>
      <dc:date>2010-09-30T21:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: New route problem</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597021#M5754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jay,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I saw your post on this and was wondering if the only way to get at the traversal result is through ArcObjects?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the closest facility analysis and am building a process through model builder.&amp;nbsp; I would like a way to output to a traversal result layer for each route that is created through the closest facility process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nick&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So it sounds like you can solve the route but need to analyze the results more.&lt;BR /&gt;One way can be to spatially select all the roads that overlap your route and then summarize them and the other can be to add the "traversal" results being stored in memory as a feature class to ArcMap and summarize them. The traversal results has every edge of the route with its network attributes. You can use the following link to see how to access the traversal result:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000245000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000245000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Jay Sandhu&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 11:02:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597021#M5754</guid>
      <dc:creator>NickDeMerchant</dc:creator>
      <dc:date>2011-03-29T11:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: New route problem</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597022#M5755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nick,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; With ArcGIS 10 (and earlier versions), the traversal result can be accessed only via ArcObjects. However, you can use a trick to add the traversal result as feature layers in ArcMap and then use the feature layers in Model Builder with any geoprocessing tools that work with feature layers. For this to work, &lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;In ArcMap, create a new VBA macro and copy this VBA code in the macro body.&lt;/LI&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub AddNATraversalResultToArcMap()
&amp;nbsp; Dim pMxDoc As IMxDocument
&amp;nbsp; Dim pNetworkAnalystExtension As INetworkAnalystExtension
&amp;nbsp; Dim pNALayer As INALayer
&amp;nbsp; Dim pFLayer As IFeatureLayer
&amp;nbsp; Dim pTraversalResultQuery As INATraversalResultQuery
&amp;nbsp; Dim pNATraversalResultEdit As INATraversalResultEdit
&amp;nbsp; 
&amp;nbsp; Set pMxDoc = ThisDocument
&amp;nbsp; Set pNetworkAnalystExtension = Application.FindExtensionByName("Network Analyst")
&amp;nbsp; Set pNALayer = pNetworkAnalystExtension.NAWindow.ActiveAnalysis
&amp;nbsp; Set pTraversalResultQuery = pNALayer.Context.Result
&amp;nbsp; Set pNATraversalResultEdit = pTraversalResultQuery
&amp;nbsp; 
&amp;nbsp; 'Infer Geometry
&amp;nbsp; pNATraversalResultEdit.InferGeometry "", Nothing, New CancelTracker
&amp;nbsp; 
&amp;nbsp; 'Get the Edges and add as a layer
&amp;nbsp; Set pFLayer = New FeatureLayer
&amp;nbsp; Set pFLayer.FeatureClass = pTraversalResultQuery.FeatureClass(esriNETEdge)
&amp;nbsp; pFLayer.Name = pFLayer.FeatureClass.AliasName
&amp;nbsp; pMxDoc.FocusMap.AddLayer pFLayer
&amp;nbsp; 
&amp;nbsp; 'Get the Junctions and add as a layer
&amp;nbsp; Set pFLayer = New FeatureLayer
&amp;nbsp; Set pFLayer.FeatureClass = pTraversalResultQuery.FeatureClass(esriNETJunction)
&amp;nbsp; pFLayer.Name = pFLayer.FeatureClass.AliasName
&amp;nbsp; pMxDoc.FocusMap.AddLayer pFLayer
End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;LI&gt;Solve the Closest Facility layer and then run the macro. This will add two layers "Edges" and "Junctions" to ArcMap. The layer represents the edges and junctions traversed while finding routes.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Move these two layers below the Closest Facility layer in Table of Contents (TOC). This will ensure that the traversal layers are not broken when you reopen the map document.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; Save the map document.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt; The traversal layers can be used in Model builder with any gp tools. Every time the Closest Facility layer is solved, the traversal layers are updated. &lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;BR /&gt;&lt;SPAN&gt;Some caveats to keep in mind&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;The traversal layers are associated only with the existing closest facility layer. Any time you create a new layer, you need to remove the existing traversal layers and rerun the macro to create new layers.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;In your GP model, you need to re-use the same closest facility layer. Since there is no way to edit properties of existing closest facility layers using GP(a tool or via python), you cannot change any analysis properties (such as number of facilities to find) in your model. However, You can change them from layer properties in ArcMap.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Any time the solve fails to find a solution, the traversal layers are removed from the TOC. So you need to rerun the macro to add the traversal layers after a successful solve.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;As the traversal layers are just available in the TOC, you have to run the GP model from inside the map document containing the traversal layers.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;And hopefully some good news, at 10.1, the network analyst toolbox will have a new GP tool that takes a network analysis layer and saves the traversal layers as feature classes on disk avoiding all these issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Deelesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:37:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/new-route-problem/m-p/597022#M5755</guid>
      <dc:creator>DeeleshMandloi</dc:creator>
      <dc:date>2021-12-12T01:37:45Z</dc:date>
    </item>
  </channel>
</rss>

