<?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: Batch Solving Many Routes in ArcGIS Network Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119539#M1168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay, I wonder if you can assist with my use case...I'm actually trying to use the closest facility solver to perform a large calculation, (2.5 million origins to 1 destination initially).&amp;nbsp; I'm running in ArcGIS Pro and using a Network Dataset stored in SQL server.&amp;nbsp; After 5 hours or so it fails with the empty geometry error message below &lt;SPAN style="font-size: 12.0pt;"&gt;which I presume is related to issues with the SDE Road Network being used.&amp;nbsp; Can you advise how to get around this as the network was built for the whole country and inevitably has some invalid geometries.&amp;nbsp; Perhaps a batch &lt;/SPAN&gt; approach is best but I am unsure how to go about this.&amp;nbsp; Any advice would be appreciated.&amp;nbsp; Regards, Francis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/402413_error.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Apr 2018 08:34:14 GMT</pubDate>
    <dc:creator>FrancisSenyah</dc:creator>
    <dc:date>2018-04-19T08:34:14Z</dc:date>
    <item>
      <title>Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119522#M1151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I periodically need to calculate the shortest walking distance for over 1.8 million routes (2 points per route).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;With such a large amount of routes I cannot use the desktop ArcGIS - loading that many locations isn't realistic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What would be the best practice? Creating a python script? Using ArcObjects? Something else?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been doing the calculations in smaller pieces (100K, more or less) in version 9.x but now, in version 10, I want to improve the process and do it in one "chunk".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have access to a strong workstation (20 GB RAM, 24 cores). How can I utilize all the processing potential?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no need for hierarchy, restrictions or preserving stop order and all I want is the distance - not the actual routes layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shahar.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 13:06:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119522#M1151</guid>
      <dc:creator>ShaharLevenson</dc:creator>
      <dc:date>2012-03-14T13:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119523#M1152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are several ways to do the batch solving, for example, use ArcObject or Python. A simple way is to create a route layer template which includes all your analysis settings, i.e. no hierarchy, uncheck all the restrictions. You can add a pair of origin and destination points into the route layer, solve and get the cost, and delete stops and the route from the layer afterwards. Repeat the procedure over all OD pairs, you will get the cost for all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a simple example with python assuming you have a text input file with contents like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ID,X1,Y1,X2,Y2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1,-117.195533,34.057058,-117.197204,34.055463&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2,-117.17157,46.736774,-117.261162,47.657173&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Open ArcMap, add a route layer MyRouteLayer, open python window and run the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, os, sys
arcpy.env.overwriteOutput = True

try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; costDic1 = {}
&amp;nbsp;&amp;nbsp;&amp;nbsp; f = open(r"C:\temp\OriginDestinations.txt", 'r+')
&amp;nbsp;&amp;nbsp;&amp;nbsp; layer1 = "MyRouteLayer" #an open in-memory layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; for line in f:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; twoPs = line.split(",")
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # if the line contains number
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if twoPs[0].isdigit():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPoint = arcpy.Point()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DPoint = arcpy.Point()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointGeometryList = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPoint.X = twoPs[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPoint.Y = twoPs[2]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DPoint.X = twoPs[3]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DPoint.Y = twoPs[4]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointGeometry = arcpy.PointGeometry(OPoint)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointGeometryList.append(pointGeometry)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointGeometry = arcpy.PointGeometry(DPoint)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointGeometryList.append(pointGeometry)&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myPoints = "Mypoints"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(pointGeometryList, myPoints) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.na.AddLocations(layer1,"Stops",myPoints)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Solve_na(layer1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # get the cost info from the layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(lyrName + "\\Routes")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; costDic1[twoPs[0]] = row.Total_TravelTime
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete stops and route from the layer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteRows_management(lyrName + "\\Stops")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteRows_management(lyrName + "\\Routes")
&amp;nbsp;&amp;nbsp;&amp;nbsp; f.close 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Output the result to a txt file&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; fOut = open(r"C:\temp\Out.txt", 'w')
&amp;nbsp;&amp;nbsp;&amp;nbsp; for costKey in costDic1.keys():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line = str(costKey) + "," + str(costDic1[costKey])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fOut.writelines(line)
&amp;nbsp;&amp;nbsp;&amp;nbsp; fOut.close

except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Exception"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can modify the code to open the template layer on disk and run it outside ArcMap. Hope this helps!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anna&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:58:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119523#M1152</guid>
      <dc:creator>NaAn</dc:creator>
      <dc:date>2021-12-11T06:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119524#M1153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Anna,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much! I changed a few lines in the code and it works.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm learning now how to run it outside of ArcMap, as you suggested.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A question:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I have many routes, there may be a case in which a route between two points isn't possible. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I make the code "skip" the problematic route instead of stopping with an exception?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Mar 2012 12:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119524#M1153</guid>
      <dc:creator>ShaharLevenson</dc:creator>
      <dc:date>2012-03-18T12:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119525#M1154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can throw an exception when no solution is found: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Solve_na(layer1)
except (RuntimeError):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "No solution is found for " + str(layer1)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anna&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:58:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119525#M1154</guid>
      <dc:creator>NaAn</dc:creator>
      <dc:date>2021-12-11T06:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119526#M1155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,Anna,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, I have the same problem as described in this thread. The difference is that I developed my code in VBA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I load points into route layer and get the shortest path in a loop. When the route is not possible, the program just stopped and error messages jump out. How can I skip this problematic route and make the program run into the next iteration? Thank you a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;You can throw an exception when no solution is found: &lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Solve_na(layer1)
except (RuntimeError):
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "No solution is found for " + str(layer1)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Anna&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:58:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119526#M1155</guid>
      <dc:creator>XiangHe1</dc:creator>
      <dc:date>2021-12-11T06:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119527#M1156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Xiang,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You may use this line to continue the loop in VBA:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On Error Resume Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anna&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2012 16:29:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119527#M1156</guid>
      <dc:creator>NaAn</dc:creator>
      <dc:date>2012-05-30T16:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119528#M1157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anna&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping you can help. I am new to python coding and have tried to create a script to solve and display multiple routes between OD pairs simultaneously. In my particular case the origins are also the destinations. The script used is as shown below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Name: MakeRouteLayer_MultiRouteWorkflow.py&lt;BR /&gt;# Description: Calculate the home-work commutes for cyclists and save&lt;BR /&gt;# the output to a feature class&lt;BR /&gt;# Requirements: Network Analyst Extension&lt;/P&gt;&lt;P&gt;#Import system modules&lt;BR /&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;try:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Check out the Network Analyst extension license&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.CheckOutExtension("Network")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Set environment settings&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Set local variables&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inNetworkDataset = "C:/Users/michael.vorster/Google Drive/Masters/Thesis/Model Info/NMBM Roads/5km &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Zone/roads_in_5km_classification/Commuter_Perspective_ND.nd"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inStops_Home = "C:/Users/michael.vorster/Google Drive/Masters/Thesis/Model Info/Cadastral/ArcGIS/Allotment &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Centroids/Allotment_Centroids.shp"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inStops_Work = "C:/Users/michael.vorster/Google Drive/Masters/Thesis/Model Info/Cadastral/ArcGIS/Allotment &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Centroids/Allotment_Centroids.shp"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outNALayerName = "CycleRoutes"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outRoutesFC = "C:/Users/michael.vorster/Google Drive/Masters/Thesis/Model Info/Route Data/outRoutes"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;impedanceAttribute = "Commuter"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Create a new Route layer. Optimize on Commuter, but compute the&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#distance travelled by accumulating the Length attribute.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outRouteResultObject = arcpy.na.MakeRouteLayer(inNetworkDataset, outNALayerName, impedanceAttribute, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"FIND_BEST_ORDER", "PRESERVE_BOTH", "", ["Commuter", "Length"], "NO_UTURNS", "", "NO_HIERARCHY", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"", "TRUE_LINES_WITH_MEASURES","")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Get the layer object from the result object. The route layer can now be&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#referenced using the layer object.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;outNALayer = outRouteResultObject.getOutput(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Get the names of all the sublayers within the route layer.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;subLayerNames = arcpy.na.GetNAClassNames(outNALayer)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Store the layer names that we will use later&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stopsLayerName = subLayerNames["Stops"]&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;routesLayerName = subLayerNames["Routes"]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Before loading the commuters' home and work locations as route stops, set&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#up field mapping. Map the "ALLOTMENT" field from the input data to&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#the RouteName property in the Stops sublayer, which ensures that each&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#unique ALLOTMENT will be placed in a separate route. Matching&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#ALLOTMENT from inStops_Home and inStops_Work will end up in the same&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#route.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldMappings = arcpy.na.NAClassFieldMappings(outNALayer, stopsLayerName)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fieldMappings["RouteName"].mappedFieldName = "ALLOTMENT"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Add the commuters' home and work locations as Stops. The same field mapping&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#works for both input feature classes because they both have a field called&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#"ALLOTMENT"&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.na.AddLocations(outNALayer, stopsLayerName, inStops_Home, fieldMappings, "300 meters", "FID", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[["Commuter_Perspective_ND", "SHAPE"], ["Commuter_Perspective_ND_Junctions", "NONE"]], "", "", "SNAP", "", "", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"")&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.na.AddLocations(outNALayer, stopsLayerName, inStops_Work, fieldMappings, "300 meters", "FID", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[["Commuter_Perspective_ND", "SHAPE"], ["Commuter_Perspective_ND_Junctions", "NONE"]], "", "", "SNAP", "", "", &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#Solve the route layer.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.na.Solve(outNALayer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# Get the output Routes sublayer and save it to a feature class&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RoutesSubLayer = arcpy.mapping.ListLayers(outNALayer, routesLayerName)[0]&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.management.CopyFeatures(RoutesSubLayer, outRoutesFC)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print "Script completed successfully"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;except Exception as e:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# If an error occurred, print line number and error message&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;import traceback, sys&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tb = sys.exc_info()[2]&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print "An error occured on line %i" % tb.tb_lineno&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print str(e)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script runs through the python window and the route layer is created. &amp;nbsp;The stops are added to the map but there are no&amp;nbsp;routes displayed. There is also no route information in the attribute table. I suspect this has to do with the fact that the origins and destinations are the same points. I understand that the route info from point "A" to point "A" is zero (0) but there should be info for&amp;nbsp;"A to B" and "A to C", "A to D"....etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help with the above would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 19:22:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119528#M1157</guid>
      <dc:creator>MichaelVorster</dc:creator>
      <dc:date>2017-09-12T19:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119529#M1158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you trying to achieve? Are you trying to get a distance matrix for all points that you have? In that case the route solver is the wrong approach. It will only solve the routes for stop pairs loaded with the same ROUTENAME property, which I think in your case is stop A to stop A and then then Stop B to Stop B, etc. It is not going to solve Stop A to Stop B, unless you load that pair as well. So if you want all pairs, use the OD Cost Matrix and load your locations as origins and destinations and solve. It will solve and give you a complete matrix of travel times. But it only computes a straight line route shape (for speed). And in case you need the actual route geometry of the shortest paths, then use the Closest Facility solver.&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, 12 Sep 2017 21:24:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119529#M1158</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2017-09-12T21:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119530#M1159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm actually looking for a combination of the OD Cost Matrix and Closest Facility solvers. The OD Cost Matrix gives me everything I need except the actual routes. The resulting attribute table is perfect and if I could get the actual routes then I would be a very happy man.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the Closest Facility solver as well but experienced the same problem as with the python code in my original post (i.e. no routes were generated, just points). I suspect this is because the origins and destinations are the same points and are all located on the same layer. I could go through the process of moving each of the points onto a new layer and then solving the routes between a single origin on one layer and multiple destinations on another but this is extremely time consuming, especially if there are lots of points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to use the OD Cost Matrix coding but to change to the output shape from a STRAIGHT_LINE to a TRUE_LINE_WITH_MEASURES?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 04:57:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119530#M1159</guid>
      <dc:creator>MichaelVorster</dc:creator>
      <dc:date>2017-09-13T04:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119531#M1160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;CF is like OD. One difference is that by default it is set to find ONE closest. You need to change it to find the number of locations you have. It will give you all the routes. Look at the TargetFacilityCount parameter when you are doing the make CF layer.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/closest-facility.htm#GUID-EF26707F-5627-46AA-96EB-4F305175CEB0" title="http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/closest-facility.htm#GUID-EF26707F-5627-46AA-96EB-4F305175CEB0"&gt;Closest facility analysis—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jay Sandhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 15:48:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119531#M1160</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2017-09-13T15:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119532#M1161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are an absolute legend. Thanks for the help! I just ran the CF solver and it seems to be working just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 16:48:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119532#M1161</guid>
      <dc:creator>MichaelVorster</dc:creator>
      <dc:date>2017-09-13T16:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119533#M1162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping you can help me with something else. I am now trying to calculate the straight line or Euclidean distances between the same points. My reasoning for doing this is so that I can get the ratio of straight line distance to route distance for each of the OD pairs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the Euclidean distances between all OD pairs I was going to use the, "Generate Near Table" tool but for some reason it is not available in my ArcToolbox. Are you aware of another method I can use to get the straight line distances?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Sep 2017 15:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119533#M1162</guid>
      <dc:creator>MichaelVorster</dc:creator>
      <dc:date>2017-09-17T15:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119534#M1163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Within ArcGIS, the Generate Near Table tool is the best way to compute Euclidean distances. &amp;nbsp;The other way would be to script it up in python. You can project the point data to the right projection and then run the Add XY Coordinates tool. Then&amp;nbsp;with the X,Y coordinates, you will have to compute the straight line distance and write it out.&lt;/P&gt;&lt;P&gt;Jay Sandhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2017 16:55:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119534#M1163</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2017-09-20T16:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119535#M1164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you replies.&lt;/P&gt;&lt;P&gt;I tried to get the distances&amp;nbsp;for 36&amp;nbsp;shipping routes (36 origin ports and 36 destinations), I get a reasonable map, but only get one route solved, from port 1 to port 72. Do you know why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, can CF or OD matrix do the same thing for every port pair? instead of the closest one/all the combinations between those ports, but to the designated port within each port pair?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Zhaojun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 19:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119535#M1164</guid>
      <dc:creator>zhaojunwang</dc:creator>
      <dc:date>2017-10-19T19:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119536#M1165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CF and OD return routes to locations within the specified distance cutoff or number specified. They do not honor "pairs". To find routes between pairs of locations, you can either solve each pair independently OR better way is to load them into a single route but set a common ID as the ROUTENAME property. That way you can load in 72 stops as 36 route pairs and solve in one route solver. More details here:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/route.htm" title="http://desktop.arcgis.com/en/arcmap/latest/extensions/network-analyst/route.htm"&gt;Route analysis—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&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>Thu, 19 Oct 2017 21:03:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119536#M1165</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2017-10-19T21:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119537#M1166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried Newroute, and set common ID for origin ports and destination ports, but the routes solved to be only 1, not 36, do you know the possible reason?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Zhaojun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Oct 2017 15:55:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119537#M1166</guid>
      <dc:creator>zhaojunwang</dc:creator>
      <dc:date>2017-10-22T15:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119538#M1167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And there is an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warning: The output geometry for "Location 1 - Location 86" in "Routes" has no M values because the maximum M value is larger than the largest M value that can be supported by the M domain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Oct 2017 15:56:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119538#M1167</guid>
      <dc:creator>zhaojunwang</dc:creator>
      <dc:date>2017-10-22T15:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119539#M1168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay, I wonder if you can assist with my use case...I'm actually trying to use the closest facility solver to perform a large calculation, (2.5 million origins to 1 destination initially).&amp;nbsp; I'm running in ArcGIS Pro and using a Network Dataset stored in SQL server.&amp;nbsp; After 5 hours or so it fails with the empty geometry error message below &lt;SPAN style="font-size: 12.0pt;"&gt;which I presume is related to issues with the SDE Road Network being used.&amp;nbsp; Can you advise how to get around this as the network was built for the whole country and inevitably has some invalid geometries.&amp;nbsp; Perhaps a batch &lt;/SPAN&gt; approach is best but I am unsure how to go about this.&amp;nbsp; Any advice would be appreciated.&amp;nbsp; Regards, Francis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/402413_error.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Apr 2018 08:34:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119539#M1168</guid>
      <dc:creator>FrancisSenyah</dc:creator>
      <dc:date>2018-04-19T08:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119540#M1169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Francis,&lt;/P&gt;&lt;P&gt;The "operation attempted on empty geometry" error message may not have anything to do with the SDE network dataset. It could be that you have run out of some computer resource (memory or disk space).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ArcGIS Pro, Closest Facility computes the shortest route and then generates the route geometry to write to the output Routes feature class and also generates the driving directions and writes them to the output directions feature class. It is will generate a lot of data for 2.5 million routes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, for a 2.5 million to 1 case, it will be solving 2.5 million routes. At a minimum, you could flip these so that you have a 1 to 2.5 million case and switch the default "Towards Facility" to "Away from Facilities" to get the same answer but the solver will only need to do ONE route solve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So let me ask, do you need the output route geometry and directions? Or do you simply need the shortest time/distance between these locations? If you do not need the actual route geometry, then use the Origin-Destination Cost Matrix solver. It will be much quicker with less overhead.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/analysis/networks/od-cost-matrix-analysis-layer.htm" title="https://pro.arcgis.com/en/pro-app/help/analysis/networks/od-cost-matrix-analysis-layer.htm"&gt;OD cost matrix analysis layer—ArcGIS Pro | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&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>Thu, 19 Apr 2018 18:29:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119540#M1169</guid>
      <dc:creator>JaySandhu</dc:creator>
      <dc:date>2018-04-19T18:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Batch Solving Many Routes</title>
      <link>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119541#M1170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay, Very helpful.&amp;nbsp; Based on this I'm thinking it's a memory issue.&amp;nbsp; I'll switch the solve direction in the 1st instance as the geometry and directions would be helpful for quality assurance more than anything.&amp;nbsp; But if this proves inpractical - the Cost Matrix will also be suitable for us so I will give that a go next.&amp;nbsp; Many Thanks, I'll report back with anything of note.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 06:57:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-network-analyst-questions/batch-solving-many-routes/m-p/119541#M1170</guid>
      <dc:creator>FrancisSenyah</dc:creator>
      <dc:date>2018-04-20T06:57:43Z</dc:date>
    </item>
  </channel>
</rss>

