AnsweredAssumed Answered

Add first and last stop in Route Solver

Question asked by sotriant on Jan 19, 2018
Latest reply on Jan 23, 2018 by sotriant

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. 


fieldMappings =, stopsLayerName)

fieldMappings["RouteName"].mappedFieldName = "Group_ID"


#Add locations as Stops. T


#ADD FIRST STOP, stopsLayerName, inStops_1, fieldMappings1, "300 meters", "FID", [["roadNetwork_ND", "MIDDLE"], ["roadNetwork_ND_Junctions", "NONE"]], "MATCH_TO_CLOSEST", "CLEAR", "NO_SNAP", "", "", ""), stopsLayerName, inStops_2, fieldMappings, "300 meters", "FID", [["roadNetwork_ND", "SHAPE"], ["roadNetwork_ND_Junctions", "NONE"]], "", "APPEND", "SNAP", "", "", "")


#ADD LAST STOP, stopsLayerName, inStops_1, fieldMappings1, "300 meters", "FID", [["roadNetwork_ND", "MIDDLE"], ["roadNetwork_ND_Junctions", "NONE"]], "MATCH_TO_CLOSEST", "APPEND", "NO_SNAP", "", "", "")

#Solve the route layer.



FYI The solved routes


the stops attribute table


the depots attribute table



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)?