Solving a routing problem using model builder, without using all stops and barriers at once

595
1
10-19-2020 02:07 PM
Clarson
New Contributor III

need to run network analysis routing (to calculate distance) on pairs of points with barriers. I have 3 feature classes:

  • Origins (415 records)

  • Destinations (415 records)

  • Barriers (415 records)

All 3 of which share a common unique ID field called [RouteName], (which has a data type of Long). Basically, each Routing has 1 start, 1 stop, and 1 barrier. The barriers represent culvert failures on a road network. I would like to calculate how much travel distance is added to get from the origin (on one side of the failure barrier) to the destination (on the other side of the barrier).

I am trying to find a way to for the routing to look at each Origin, Destination, and Barrier set (sharing a common [RouteName] attribute) individually to calculate the route, while ignoring all other Origins, Destinations & Barriers on the road network. For each routing solution, I only want to use one origin, one destination, and one barrier.

I have a model set up that successfully routes for one [RouteName] set using the "Select Layer By Attribute" tool in Model Builder. I have attached photos of my current model and my test result for using the expression "[RouteName]=21" in the select Layer by attribute tool for my Origins, Destinations and Barriers. 

What I would like to do is be able to set the model to run through each "set" of [RouteName] (Origin, Destination, & Barrier all sharing the same value) and output/append that successful routing to a new feature class with the set's [RouteName} as an attribute. in the end of the model I would have 415 different routes, one for each trio of points. 

Can anybody help?

0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

You need to explore model iterators, you can then loop over your routes to select 1 start/stop/barrier, on each loop you create your selections that feed into the add locations tool then solve and append results

0 Kudos