<?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 How to access Network Analyst output sublayers using python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-access-network-analyst-output-sublayers/m-p/69140#M5642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to figure out how to grab and manipulate Network Analyst output sublayers using python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For instance, I've successfully run an OD cost matrix calculation using python geoprocessing. I get the "Lines" output sublayer. This is probably just a stupid problem, but I can't seem to figure out how to work with the Lines sublayer (or just what the syntax should be to refer to it) in python after I create it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Create fields in the Lines layer corresponding to my unique stop ids that I put in the origin and destination sublayers and then join the Lines layer to the origin and destination layers so I can grab the stop ids.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Export the Lines layer attributes table, including the new fields with the stop id, to a csv&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do all this by hand, but I want to do it in python, and I'm really stuck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Nov 2011 19:30:43 GMT</pubDate>
    <dc:creator>MelindaMorang1</dc:creator>
    <dc:date>2011-11-09T19:30:43Z</dc:date>
    <item>
      <title>How to access Network Analyst output sublayers using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-network-analyst-output-sublayers/m-p/69140#M5642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to figure out how to grab and manipulate Network Analyst output sublayers using python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For instance, I've successfully run an OD cost matrix calculation using python geoprocessing. I get the "Lines" output sublayer. This is probably just a stupid problem, but I can't seem to figure out how to work with the Lines sublayer (or just what the syntax should be to refer to it) in python after I create it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Create fields in the Lines layer corresponding to my unique stop ids that I put in the origin and destination sublayers and then join the Lines layer to the origin and destination layers so I can grab the stop ids.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Export the Lines layer attributes table, including the new fields with the stop id, to a csv&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do all this by hand, but I want to do it in python, and I'm really stuck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 19:30:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-network-analyst-output-sublayers/m-p/69140#M5642</guid>
      <dc:creator>MelindaMorang1</dc:creator>
      <dc:date>2011-11-09T19:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Network Analyst output sublayers using python</title>
      <link>https://community.esri.com/t5/python-questions/how-to-access-network-analyst-output-sublayers/m-p/69141#M5643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the layer name that you are after is lines, you should be able to just get it with networkAnalystLayerName+'\\Lines' (where networkAnalystLayerName is the name of the layer you are doing the network analyst stuff on) , i.e.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# if NA_Layer is the variable for your network analyst layer
arcpy.Solve_na(NA_Layer)
lines = NA_Layer + '\\Lines'
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you will probably need to copy features (i.e. arcpy.CopyFeatures_management(lines)) and do your modifications on the output of copy features.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:38:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-access-network-analyst-output-sublayers/m-p/69141#M5643</guid>
      <dc:creator>StacyRendall1</dc:creator>
      <dc:date>2021-12-10T22:38:54Z</dc:date>
    </item>
  </channel>
</rss>

