I am using closest facility analysis, in model builder, to find the closest grocery store and farmer’s market (facilities) to each apartment building (incident) in a neighborhood. The farmer’s markets and grocery stores are in separate shape files, and I want to somehow iterate within closest facility so that first it searches for the closest grocery store to each apartment, then finds the closest farmers market to each apartment. I am able to get this to work when there is only one facility (grocery store), but when I try to add in a second facility, the model gets stuck in an infinite loop. I am not sure first of all how to iterate (what operation to use- for loop? while loop?), and secondly, where the iteration should come in the model. Below is
a screenshot of the model so far, where I've used a While loop, but I haven't been able to get it to work. In the model, apartments is the input labeled "Petworth_Apt". Any help is much appreciated, thanks!
This is just a liitle bit out of my comfort zone, but the while block probably ought to be replaced with one of the new iterator tools.
Some ideas:
With Iterators, all the processes will get run each time it iterates. So the solution here is typically to break the functions up into separate models and then link them with another model.
Integrating a model within a model—Help | ArcGIS for Desktop
Modelbuilder Iterator Examples
Some questions so folks can further understand your process:
Chris Donohue, GISP