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.



2 Answers 2


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.

  • 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
    Commented Jun 8, 2020 at 13:36
  • It should be easy to choose a white color scheme for the output layer.
    – root676
    Commented Jun 8, 2020 at 14:01
  • Thank you @root676 this was a perfect solution! Hopefully more people will stumble upon this solution.
    – Lundqan
    Commented Jun 10, 2020 at 7:25

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).

  • 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
    Commented Jun 8, 2020 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.