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!
