[GIS] Automating procedure to calculate least-cost path to destination locations from multiple source locations using ArcGIS Desktop

arcgis-10.1arcgis-desktopcost-pathmodelbuildershortest path

I have 2 sets of locations represented by two point shapefiles in ArcGIS 10.1. My aim is to calculate the least cost path from each source location (let's call it A) to the destination locations (let's call them B) implementing the Tobler's hiking function and using ArcGIS path distance and cost path tools, as described for instance in this site:

http://www.mapaspects.org/node/3744

When it comes to calculating the least-cost path between just one A and all the Bs, I have no problem. But, since the procedure has to be repeated n times, being n equal to the number of As location, I am badly wondering if there is any way in ArcGIS to automate the procedure.


I tried to follow @Sam3000's very useful suggestion. I built a main model containing the Path Distance and the Cost Path tools (see attached image), and two submodels (nested into the main model) each iterating feature selection on the origin and destination locations respectively. But arcgis returns "ERROR 000581: Invalid parameters. Failed to execute (Path Distance).enter image description here. Now, from what I can hypothesize looking at what happen when I run the whole model, is that arcGIS is first running the first submodel (Submodel_origin; bottom-left in the attached image) on its own, that is without passing its output (row-by-row) to the Path Distance tool (which is part of the main model). Maybe, there is setting that I am missing as to the way in which the operations performed by the different chunks must related to each other.

What this model should do in principle, as I have conceived it, is:

  1. selecting an origin location at time (submodel_origin);
  2. passing it to the Path Distance tools (which also takes as inputs a DEM and a SLOPE raster);
  3. step 2 should provide two rasters (namely, an anisotropic raster and a backlink raster) that with be feed into the Cost Path tool;
  4. along with the 2 rasters in the previous step, another submodel (Submodel_destination) should select one destination location at time to be feed into step (3);
  5. the output of the Cost Path is then converted into a polyline feature.

Best Answer

I recently came up against a very similar challenge and produced the model below using ArcGIS ModelBuilder. Model

The key part here is the "Iterate Feature Selection" element. It will output each of the source points one at a time as a selection, which you can then turn into an individual feature class using copy features (as I have done) if you wish, or simple carry out the operation on the selection. In this case I am performing a Path Distance analysis, however you could easily perform a Cost Path Analysis instead.

Your Challenge

Your task would require you to iterate through both sources and destinations, which would require intigrating an almost identical model to iterate through destination points as the primary model goes through the source points, see here for more.

Finally, do consider right clicking on the tool you wish to use and choosing "Batch", which allows you to run the same tool many times over without interaction. It does still require quite a bit of setting up however, so I prefer model builder myself, but for one tool it is worth considering, here is an example for using "Clip":

enter image description here

Related Question