# Thread: Going up and down hill

1. ## Going up and down hill

Hi

I am working on making a cost path analysis, and was wondering if there are any simple ways, or advanced ones, to change the value used for the terrain when going uphill or downhill.
For example it should be favorable to go downhill, resulting in a low value, while going up hill should give a high value in the cost path calculation.

Thanks.

2. ## Re: Going up and down hill

Originally Posted by wasaviking
I am working on making a cost path analysis, and was wondering if there are any simple ways, or advanced ones, to change the value used for the terrain when going uphill or downhill.
The Cost Path tool recognizes flow direction rasters.

This is from the tool help:

Cost Path can also be used to derive the path of least resistance down a digital elevation model (DEM). In this case, use the DEM for the Input cost distance raster and the output from the Flow Direction tool for the Input cost backlink raster. Valid flow direction raster values are 1, 2, 4, 8, 16, 32, 64, and 128; valid values in the back link raster are 1, 2, 3, 4, 5, 6, 7, and 8. Both of these rasters are acceptable.

3. ## Re: Going up and down hill

I know about the flow direction tool, but I don't see it working in this case.
The flow direction tool finds the least friction path downwards from a point, but not from one point to another. I would like to implement the terrain in the analysis a way, so that it is prefered to travel downhill over uphill, resulting in an overall lower cost.

4. ## Re: Going up and down hill

Originally Posted by wasaviking
I know about the flow direction tool, but I don't see it working in this case.
The flow direction tool finds the least friction path downwards from a point, but not from one point to another. I would like to implement the terrain in the analysis a way, so that it is prefered to travel downhill over uphill, resulting in an overall lower cost.
As the help for Cost Path describes, it's the elevation surface you use for cost:

Cost Path can also be used to derive the path of least resistance down a digital elevation model (DEM). In this case, use the DEM for the Input cost distance raster and the output from the Flow Direction tool for the Input cost backlink raster.

The Cost Path tool is the one you use for the "one point to another" analysis. (Flow Direction is used as a pre-processing step to provide the needed information to Cost Path.)

5. ## Re: Going up and down hill

I am fairly sure that I have followed the steps from the guide, but the result is not what you say it should be, nor do I understand how it should be possible.

As you can see from the image the cost path follow the hill downwards instead of connecting the two points.
When I use the flow direction as the backlink I don't see how the cost path could ever reach my second point. The flow direction points downwards the hill, not toward the second point, as it would be the case when using a normal backlink raster.

7. ## Re: Going up and down hill

With your picture this makes more sense to me what you're trying to do.

Just using the elevation as your cost surface won't do what you want?

8. ## Re: Going up and down hill

I have used a layer representing the slopes instead of the actual DTM since this is more relevant to my problem, and have got this result.

This may be a viable result, but it avoids steep slopes all together instead of having a changed value depending on going uphill or downhill.