In QGIS I have a layer that is a MultiLineString that has many overlapping lines, which represent driving routes around the city which are generated using OSRM.

My data looks something like


where some segments are only recorded once, some twice, and some many more times (up to thousands of times).

How can I increase the width (line thickness) of segments of the routes based on the number of times they are overlapped?

I have a working solution using the JavaScript libraries OpenLayers and Turf but the solution is inefficient and cannot scale. See below for an example of the desired effect.


Answers that involve re-formatting the data or working in Python are within my scope.

  • Make sure each segment is a separate feature. Install the refFunctions plugin. Use data-defined settings for line width with the function intersecting_geom_count(). – csk Mar 6 at 18:49
  • Would you be satisfied increasing the brightness of overlapping lines? Have a look at this Q&A about creating a "heatmap" of lines: gis.stackexchange.com/questions/286082/… – csk Mar 6 at 21:12
  • @csk, no, I specifically would like to increase the width. I will try the instructions from your previous comment tonight. – DenverCoder9 Mar 6 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.