<?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: Add first and last stop in Route Solver in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/add-first-and-last-stop-in-route-solver/m-p/121003#M1191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are your route analysis layer&amp;nbsp; optimization settings? That is, after you add the first stop, a second stop and then the first stop again, are you solving for best order? If yes, then it will redo the sequence and visit the first and last stop at the same time. You should set it to preserve first and last.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally for each unique route name, the stops are visited in sequence order. So each route for every unique routename can start and end at the same location not just one only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jay Sandhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Jan 2018 00:30:03 GMT</pubDate>
    <dc:creator>JaySandhu</dc:creator>
    <dc:date>2018-01-23T00:30:03Z</dc:date>
    <item>
      <title>Add first and last stop in Route Solver</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/add-first-and-last-stop-in-route-solver/m-p/121002#M1190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I m using ArcGIS 10.4.1 and NetworkAnalyst. The following part of code is used in order to solve a route layer. i am using the same starting and ending point. It works ok if i only have one route. But if i have more than one routes it doesn't work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;fieldMappings = arcpy.na.NAClassFieldMappings(outNALayer, stopsLayerName)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;fieldMappings["RouteName"].mappedFieldName = "Group_ID"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;#Add locations as Stops. T&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;#ADD FIRST STOP&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;BR /&gt;arcpy.na.AddLocations(outNALayer, stopsLayerName, inStops_1, fieldMappings1, "300 meters", "FID", [["roadNetwork_ND", "MIDDLE"], ["roadNetwork_ND_Junctions", "NONE"]], "MATCH_TO_CLOSEST", "CLEAR", "NO_SNAP", "", "", "")&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;arcpy.na.AddLocations(outNALayer, stopsLayerName, inStops_2, fieldMappings, "300 meters", "FID", [["roadNetwork_ND", "SHAPE"], ["roadNetwork_ND_Junctions", "NONE"]], "", "APPEND", "SNAP", "", "", "")&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;#ADD LAST STOP&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;arcpy.na.AddLocations(outNALayer, stopsLayerName, inStops_1, fieldMappings1, "300 meters", "FID", [["roadNetwork_ND", "MIDDLE"], ["roadNetwork_ND_Junctions", "NONE"]], "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "", "", "")&lt;BR /&gt;&lt;BR /&gt;#Solve the route layer.&lt;BR /&gt;arcpy.na.Solve(outNALayer)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;FYI The solved routes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/393301_image002.png" style="width: 620px; height: 411px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;the stops attribute table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/393311_image003.png" style="width: 620px; height: 172px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;the depots attribute table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;IMG alt="" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/393312_image001.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Do you have any suggestions for what should i do to adapt my code so that all the routes start and finish at the same point, (a company's depot)?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jan 2018 18:00:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/add-first-and-last-stop-in-route-solver/m-p/121002#M1190</guid>
      <dc:creator>sotokan80_</dc:creator>
      <dc:date>2018-01-19T18:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add first and last stop in Route Solver</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/add-first-and-last-stop-in-route-solver/m-p/121003#M1191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are your route analysis layer&amp;nbsp; optimization settings? That is, after you add the first stop, a second stop and then the first stop again, are you solving for best order? If yes, then it will redo the sequence and visit the first and last stop at the same time. You should set it to preserve first and last.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally for each unique route name, the stops are visited in sequence order. So each route for every unique routename can start and end at the same location not just one only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jay Sandhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 00:30:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/add-first-and-last-stop-in-route-solver/m-p/121003#M1191</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2018-01-23T00:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add first and last stop in Route Solver</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/add-first-and-last-stop-in-route-solver/m-p/121004#M1192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;My route analysis layer optimization settings&amp;nbsp; are&amp;nbsp;&lt;/SPAN&gt;"FIND_BEST_ORDER", and "PRESERVE_BOTH". My goal is to assign the same starting and ending to point to many routes without having to use VRP solver.&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;inStops_2 refers to a table with which has different routenames (see the attached&lt;SPAN&gt;&amp;nbsp;stops attribute table)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jan 2018 08:14:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/add-first-and-last-stop-in-route-solver/m-p/121004#M1192</guid>
      <dc:creator>sotokan80_</dc:creator>
      <dc:date>2018-01-23T08:14:47Z</dc:date>
    </item>
  </channel>
</rss>

