Hi,
I have a dataset of 34 sites, and need to calculate the least cost path of each site to every other site in the dataset.
I have managed to successfully run a model, however because I am using the same site input file for both site origin and site destination, the least cost path is each site to itself.
Is there a quick way to tell arcgis to not calculate the distance of a site to itself?
I am using arcgis 10.1.
Any help would be greatly appreciated, as I don't want to create 33 dummy destination files, with each origin point removed.
Thanks,
Kat
Hi Kat,
It sounds to me that you could solve this by using an iterator to loop over field values. In that case you would be executing your model several times, with only changing source and destinations.
Suppose you have a field with unique values (1 - 34) of your sources/destinations, then you can use the 'Iterate Field Values' for 33 times (skip the last). Each iteration will give you the value of a single source. By using this value in the definition query (UniqueValue = iterationValue) of the tool 'Make Feature Layer (Data Management)' you can create a source layer (not a physical file) that only contains this single location. Use the Make Feature Layer tool again with a different definition query (UniqueValue > iterationValue) to create the destination layer. Execute the cost distance with these layers.
Some reading on iterators:
A quick tour of using iterators
Examples of using iterators in ModelBuilder
Kind regards,
Xander
Could you please expand on what you mean by the "definition query" of the Make Feature Layer tool?
Also, should this tool be input into the model or should the temporary field be created beforehand?