6

I have a layer with multiple lines, one city area commuting to another. This means that on some roads there are multiple lines lying on top of each other, which at some point will split. I also have some roads going next to each other.

I would like to create a sort of line density map based on these lines in which the value of the line segment is based on the amount of lines on top of eachother or within 10 meters.

I have tried a couple of solutions but none of them seem to work. I have tried to join the lines to a more simple line layer, but it seemed to join on the wrong lines.

I have tried to split the lines into points and then connect to points to a more simple line layer, yet again some of them join on the wrong lines.

L

HyPhens
  • 516
  • 2
  • 19
Lundqan
  • 63
  • 4
  • Those lines that are going next to each other, do they overlap between each other or each time they are unique in its geometry? – Taras Jun 08 '20 at 12:14
  • Just as another idea: https://gis.stackexchange.com/a/384736/88814 and https://gis.stackexchange.com/a/412040/88814 – Babel Dec 10 '22 at 21:42

2 Answers2

3

You could try to create a 10m Buffer around your line segments. With the respective geometry operation you should be able to then give the buffer a value according to how many lines overlap with the buffer. Then you could assign the value of the buffer to the corresponding line segment (like fill a field in the line segment according to which buffer it overlaps with).

Chris P
  • 1,639
  • 14
  • 26
  • Clever! And I suppose I would have to split the lines or buffered lines like every 100 meter or so, since the value will differ along the way? – Lundqan Jun 08 '20 at 09:33
3

To solve this task you can use the native Line Density algorithm that ships with the QGIS processing toolbox since version 3.12. It outputs a raster layer showcasing a density value based on a radius analysis. It is documented here.

root676
  • 2,385
  • 2
  • 22
  • 29
  • Thank you, it works quite well. The only problem is the black background. I am only intrested in the actual lines that the Line Density creates. – Lundqan Jun 08 '20 at 13:36
  • It should be easy to choose a white color scheme for the output layer. – root676 Jun 08 '20 at 14:01
  • Thank you @root676 this was a perfect solution! Hopefully more people will stumble upon this solution. – Lundqan Jun 10 '20 at 07:25