I'm using the Cost Path tool in ArcGIS Desktop 10.3 to draw thalwegs (line of lowest elevation) on a channel network DEM, but running into some problems. In the most simplified case, the raw DEM is used as the cost distance, and the results of Flow Direction are used as the back link (as suggested by ESRI here), which works. The example below shows the output Cost Path over the Flow Direction, with the destinations drawn as polygons.
Unfortunately, this is a bit over-simplified, mainly because flow direction requires a Fill operation, and so discards pools in the raster and allows the cost path to "cut corners". I created a weighted raster to account for both slope and proximity to deeper areas, and Cost Distance works fine with this and produces a back link raster which looks good. But running Cost Path with the new cost distance and cost back links simply fills the destination polygons, with no connections drawn between them. For example, here is the weighted raster with the output cost path:
As you can see, the destinations themselves are weighted (as usual), but no path is drawn between them. The strange thing is, any Cost Path I run with Flow Direction as the back link always works, but it also gives me the same output path regardless of the cost raster used. But any time I use the back link produced by other tools, it fails to draw a path.
Some things that I have tried that did not solve this:
- ensuring geographic projection, processing extent, snap raster, and cell size are identical
- reclassing the Back Link to the same scale as Flow Direction (1, 2, 4, 8 .. 128)
- running Cost Back Link separately from Cost Direction
- using Path Distance instead of Cost Distance or Path Distance Back Link instead of Cost Back Link
- trying the process on a smaller raster (the original is already only 1421 x 1619)
- trying Cost Path between two destinations only
- redrawing the destination polygons so they are fully within the raster bounds
None of these things have worked.
I'm also aware of a similar function in the River Bathymetry Toolkit Add-In, but that only works in 10.2.
Here's some clarification on why using flow direction as the back link fails for my needs. This is based on a high-resolution (1 m) bathymetry DEM from sonar data. The top panel in the image below show the results of simple flow direction in a cost path overlaid on the DEM. Several corners are cut to produce the straightest path by excluding areas over pools. In order for flow direction to work, Fill must first be run, which effectively sets all pools and large swaths of the bottom to a constant elevation. The areas filled by this operation are illustrated in the second panel. The third panel demonstrates the final method I settled on, use of slope as the cost surface, and the line is clearly a better representation of the thalweg here.