I have built a Model (with 2 sub-models) that is meant to follow the following logic for preparing data for use in Network Analysis route solving (Stops):
- 2 input point feature classes (Origin points and Destination points)
- For each Origin (i.e. A/B/C/D) and Destination (i.e. W/X/Y/Z) point combination, generate a Route Name (i.e. A_W, A_X, A_Y, A_Z). Each Origin point goes to many destinations and needs to be copied with the unique Route Name applied to each copy to match a destination point that gets the same Route Name applied.
- Append all Origin and Destination points to an output feature class (Stops)
The final table will have what was originally 4 Origins copied in 4 times each with the unique route name to each Destination, plus each destination point copied in 4 times to pair with each origin location (A_W, A_X, A_Y, A_Z, B_W, B_X, ..., D_Y, D_Z).
Graphics below show the main model which has input parameters for selecting the Origin and Destination feature classes, then a sub-model which iterates through each Origin location, and that has within it another sub-model which iterates through each Destination location to achieve the required value creation and data copying.
The issue I've found is that whilst the model works as expected for the first Origin point, generating unique Origin/Destination combinations for all destinations, it doesn't then continue on to do the same for the next Origin location (the point of the first sub-model/iterator), resulting in the output FC only having a portion of the data required.
Sorry if this is very wordy, but couldn't figure out how to write it any more clearly. Ultimately, I'm trying to create the required data for generating multiple routes in one hit using Network Analyst.
Lindsay Raabe
GIS Officer
Forest Products Commission WA