I have previously asked for help regarding this issue Finding least cost path in QGIS?, but obviously people do not know exactly the problem related to road design
I used the least cost path, this time in ArcGIS, and got the result as shown below. Other lines are automatically generated with the module least cost path, where the cost raster use slope raster.You can see that the obtained trajectory can not possibly be as roads.
Red lines represent the paths that I hand-drew under rule: In my case a roads may not have longitudinal slope greater than 10%, can be between 1-10%.
What is the longitudinal slope of the terrain?
If the height difference between two contour lines 10m, longitudinal gradient of 10% is the line that connects the two contour lines at 100m, for 8% distance is 125m …
the formula looks like this: K = E / L-slope
K- step
e – equidistance
L – longitudinal slope of road
Is it possible to use longitudinal slope as raster cost for road design?
If we solve this, we finally resolve the issue of the optimal network paths.
Best Answer
Connecting 2 points on contours by straight line is not going to work, as seen on your second picture line crosses same contour twice. I also very much doubt that any out of the box tools can help you. You'll need to invest heavily in scripting.
Funny enough people in the past were able to solve this task by tracing footsteps of heavily loaded donkey. Smart and laizy (or other way around) animal is able to pick the most efficient = same gradient = path on it's way home. This is why I called relevant tool DonkeyTheDesigner. I applied it on subset of your contours and after 3 iterations found that 1:33 gradient is the best option to go between 2 points shown:![enter image description here](https://i.stack.imgur.com/GqIpJ.png)
I am not willing to share the code for free but general workflow is as follows:
Picture below explains algorithm and also shows line manually drawn by you, - RULE:
Yes, my donkey is climbing ...