<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Iteration with closest facility analysis in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/iteration-with-closest-facility-analysis/m-p/724131#M3668</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some ideas:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Iterators, all the processes will get run each time it iterates.&amp;nbsp; So the solution here is typically to break the functions up into separate models and then link them with another model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The &lt;EM&gt;Build Network&lt;/EM&gt; probably only needs to be run once, so break that out into a separate model (Model 1).&lt;/LI&gt;&lt;LI&gt;Based on what you are trying to accomplish, the &lt;EM&gt;iteration&lt;/EM&gt; looks like it should be run against the apartment shapefile.&amp;nbsp;&amp;nbsp; Most of the processes will be in this model (Model 2).&lt;/LI&gt;&lt;LI&gt;Not sure with your specific tests, but if you find that running the Solve for each apartment to then find &lt;SPAN style="text-decoration: underline;"&gt;both&lt;/SPAN&gt; the closest farmers market and the closest grocery store doesn't work in a single model, one solution may be to create two models - one that iterates apartments to find closest farmers markets and then a separate model that iterates apartments to find closest grocery stores (so maybe Model 3 besides Model 2).&amp;nbsp; Caveat - if there is a correlation that I am not seeing where the closest grocery store influences in some way the closest farmers market chosen for the apartment searched, then there may be additional changes needed.&lt;/LI&gt;&lt;LI&gt;To tie multiple models together, you can create another model - the "main run model".&amp;nbsp; When in Edit mode in Modelbuilder, drag in the existing models into this model from ArcCatalog.&amp;nbsp; Then connect them.&amp;nbsp; Make the inputs and outputs Parameters so the information will be "share-able" between the models.&amp;nbsp; Preconditions can be set to ensure they trigger in the correct order.&amp;nbsp; Once you have all this set up, to run the process you would run this "main model run", which will then run all the other models (Main Run Model).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/integrating-model-within-a-model.htm" title="https://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/integrating-model-within-a-model.htm"&gt;Integrating a model within a model—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Modelbuilder Iterator Examples&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/En/Arcgisdesktop/10.0/Help/index.html#//00400000001n000000.htm" title="http://help.arcgis.com/En/Arcgisdesktop/10.0/Help/index.html#//00400000001n000000.htm"&gt;ArcGIS Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some questions so folks can further understand your process:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What version of ArcGIS are you using?&lt;/LI&gt;&lt;LI&gt;Which language are you using for coding the &lt;EM&gt;While&lt;/EM&gt; loop?&amp;nbsp; Or is a Modelbuilder&lt;EM&gt; Iterator&lt;/EM&gt; being employed?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Dec 2015 17:21:06 GMT</pubDate>
    <dc:creator>ChrisDonohue__GISP</dc:creator>
    <dc:date>2015-12-01T17:21:06Z</dc:date>
    <item>
      <title>Iteration with closest facility analysis</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-with-closest-facility-analysis/m-p/724129#M3666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="color: #000000; font-family: Arial;"&gt;&lt;SPAN style="font-size: 14.6667px;"&gt;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 &lt;/SPAN&gt;&lt;SPAN style="font-size: 14.6667px; line-height: 22.0001px;"&gt;shape files&lt;/SPAN&gt;&lt;SPAN style="font-size: 14.6667px;"&gt;, 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 &lt;/SPAN&gt;&lt;SPAN style="font-size: 14.6667px; line-height: 22.0001px;"&gt;infinite &lt;/SPAN&gt;&lt;SPAN style="font-size: 14.6667px;"&gt;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.&amp;nbsp; Below is &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="color: #000000; font-size: 14.6667px; font-family: Arial;"&gt;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! &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="color: #000000; font-size: 14.6667px; font-family: Arial;"&gt;&lt;IMG alt="image.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/150052_image.png" style="width: 620px; height: 388px;" /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 02:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-with-closest-facility-analysis/m-p/724129#M3666</guid>
      <dc:creator>CathrynHunt</dc:creator>
      <dc:date>2015-12-01T02:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Iteration with closest facility analysis</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-with-closest-facility-analysis/m-p/724130#M3667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 13:15:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-with-closest-facility-analysis/m-p/724130#M3667</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2015-12-01T13:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Iteration with closest facility analysis</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/iteration-with-closest-facility-analysis/m-p/724131#M3668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some ideas:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Iterators, all the processes will get run each time it iterates.&amp;nbsp; So the solution here is typically to break the functions up into separate models and then link them with another model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The &lt;EM&gt;Build Network&lt;/EM&gt; probably only needs to be run once, so break that out into a separate model (Model 1).&lt;/LI&gt;&lt;LI&gt;Based on what you are trying to accomplish, the &lt;EM&gt;iteration&lt;/EM&gt; looks like it should be run against the apartment shapefile.&amp;nbsp;&amp;nbsp; Most of the processes will be in this model (Model 2).&lt;/LI&gt;&lt;LI&gt;Not sure with your specific tests, but if you find that running the Solve for each apartment to then find &lt;SPAN style="text-decoration: underline;"&gt;both&lt;/SPAN&gt; the closest farmers market and the closest grocery store doesn't work in a single model, one solution may be to create two models - one that iterates apartments to find closest farmers markets and then a separate model that iterates apartments to find closest grocery stores (so maybe Model 3 besides Model 2).&amp;nbsp; Caveat - if there is a correlation that I am not seeing where the closest grocery store influences in some way the closest farmers market chosen for the apartment searched, then there may be additional changes needed.&lt;/LI&gt;&lt;LI&gt;To tie multiple models together, you can create another model - the "main run model".&amp;nbsp; When in Edit mode in Modelbuilder, drag in the existing models into this model from ArcCatalog.&amp;nbsp; Then connect them.&amp;nbsp; Make the inputs and outputs Parameters so the information will be "share-able" between the models.&amp;nbsp; Preconditions can be set to ensure they trigger in the correct order.&amp;nbsp; Once you have all this set up, to run the process you would run this "main model run", which will then run all the other models (Main Run Model).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/integrating-model-within-a-model.htm" title="https://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/integrating-model-within-a-model.htm"&gt;Integrating a model within a model—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Modelbuilder Iterator Examples&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.arcgis.com/En/Arcgisdesktop/10.0/Help/index.html#//00400000001n000000.htm" title="http://help.arcgis.com/En/Arcgisdesktop/10.0/Help/index.html#//00400000001n000000.htm"&gt;ArcGIS Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some questions so folks can further understand your process:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;What version of ArcGIS are you using?&lt;/LI&gt;&lt;LI&gt;Which language are you using for coding the &lt;EM&gt;While&lt;/EM&gt; loop?&amp;nbsp; Or is a Modelbuilder&lt;EM&gt; Iterator&lt;/EM&gt; being employed?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris Donohue, GISP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 17:21:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/iteration-with-closest-facility-analysis/m-p/724131#M3668</guid>
      <dc:creator>ChrisDonohue__GISP</dc:creator>
      <dc:date>2015-12-01T17:21:06Z</dc:date>
    </item>
  </channel>
</rss>

