1

I am using QGIS 2.18.14. I want to create line through contour lines with fixed segments, automatically. I already tried manually with 'Advanced Digitizing Tools'. It works fine but too slow. The goal is, if I enter the length of the segment e.g. 100m, automatically connect contour lines from a given point to a point target, Or from the selected contour line to the other selected contour line. I think this is possible with some python script but I am beginner in python scripting. I would be pleased with the answer that this could be done, so I would somehow, step by step, solve it. Equidistance of contour lines is 10 m. enter image description here enter image description here

ahmadhanb
  • 40,826
  • 5
  • 51
  • 105
Frodo
  • 2,407
  • 1
  • 18
  • 36
  • So you actually want a line that climbs up the hill with a constant slope. I do not know how to do that but i wonder if it could be solved better by using DEM raster instead of contour lines. – user30184 Jan 10 '18 at 19:34
  • Not only up the hill, it would be good both uphill and downhill. I have already asked similar questions with the dem raster. https://gis.stackexchange.com/questions/131702/connect-two-contour-lines-with-calculated-line-length; https://gis.stackexchange.com/questions/193671/connect-two-points-with-fixed-longitudinal-slope-over-dem-qgis – Frodo Jan 10 '18 at 19:44
  • 1
    Naturally both ways, I was thinking about something like building a road that you can drive with a tractor. There and back. – user30184 Jan 10 '18 at 20:07
  • 1
    https://pcjericks.github.io/py-gdalogr-cookbook/raster_layers.html#create-least-cost-path – csk Jan 10 '18 at 21:44
  • Thanks @csk, cost path is based on terrain slopes, but I'm limited by the longitudinal slope of my path, between 1-12%. My path represents the road. For every % I know length of segment. The least cost path is the cheapest variant but often does not meet the criteria of the road. – Frodo Jan 11 '18 at 06:23
  • What if you update the slope raster so that everything above 12% is set to some very high value which would make the use of those pixels very expensive? – user30184 Jan 11 '18 at 21:26
  • Terrain slopes are cross section of roads not longitudinal. Do you have an example? – Frodo Jan 12 '18 at 06:13
  • I believe you know your area better than me. I was thinking about slope raster that can be created for example with GDAL DEM tools http://www.gdal.org/gdaldem.html but perhaps such a raster is not usable for your task because the slope value of each raster cell is an absolute number which does not tell anything about the direction of slope. – user30184 Jan 12 '18 at 10:20

0 Answers0