I have the following model: enter image description here

How do I break up the feature set of points (Input Locations) into start/end pairs, and iterate through each pair

  • Would you consider switching to arcpy Python scripting? It might be way easier to do then. – Alex Tereshenkov Jul 9 '14 at 15:05
  • I need to create a gpk from running the model. I don't know arcpy Python, but I'll give it a try. – Renee Cammarere Jul 9 '14 at 18:14

You would need to have a column in your input feature class which will represent the RouteName (i.e., feature1 and feature2 belong to routeA; feature3 and feature4 belong to routeB and so on).

After you've prepared the input feature class (or maybe you already have one), you would need to use the Add Locations GP tool to load the stops into an existing Route network analysis layer (RouteLayer in your model). The parameter you are interested in is field_mappings. In the Field column, choose what field should Network Analyst look for.

enter image description here

You can do the same from Python, for instance:

arcpy.na.AddLocations(RouteLayer, "Stops", input_fc,
                        "Name PointName #; RouteName MyRouteNameColumn #",

So you need to load all your stops just once in a model (no need to iterate anything). Your stops will be loaded with assigned RouteName to them and solved pair wise.

enter image description here

And after solving:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.