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:
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).. 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:
- selecting an origin location at time (submodel_origin);
- passing it to the Path Distance tools (which also takes as inputs a DEM and a SLOPE raster);
- step 2 should provide two rasters (namely, an anisotropic raster and a backlink raster) that with be feed into the Cost Path tool;
- 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);
- the output of the Cost Path is then converted into a polyline feature.