Geographic Information Systems Asked by cl3 on October 25, 2020
I need to run network analysis routing (to calculate distance) on pairs of points with barriers. I have 3 feature classes:
Origins
Destinations
Barriers
All 3 of which share a common unique ID field called [RouteName], (which has a data type of Long.)
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 failure barrier).
I have set up the routing problem and it solves the route for each set of points using all barriers along the network. 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. I’m assuming I have to use the For Iterator but I’m not quite sure how to use the inline variable to do so.
Assuming your ID's go from say 1 to 10, you can use the FOR Iterator to create an ID value that is used to select the origin, destination, barrier using the select by attribute tool. It is that selection that feeds into the rest of the model logic. You'll want to use the ID value to create unique route layers which you could merge into a single dataset if required.
Remember all geoprocessing tools honour selections!
Answered by Hornbydd on October 25, 2020
To perform this "manually" I suggest using a Definition Query on each of the 3 featureclasses. Use the unique ID of the "run" {i.e. the matching set of Source, Destination, and Barrier} as the definition query value so that only one "run" is displayed. Then perform the route calculation for this "run."
Once you have it working for one run; perform the analysis in a loop (either in ModelBuilder or using Python.) For each "run" id in the loop index:
At the end of the loop, you can merge the run-specific outputs to a single output if it is meaningful to you to display the combined output. Otherwise, just compose the outputs in a TOC to show all the "runs" on one map.
Answered by JasonInVegas on October 25, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP