7

I've traced several lines that represent people's paths. Some of these lines overlap several times. I would like to get a view showing for each segment of my lines the number of line overlaps.

example1

example2

The methods I have used until now are:

  1. convert the lines into points (via Qchainge plug-in) and then create a heatmaps.
  2. using a procedure that shows the result in vector format (but very long):

Starting from the original layer "orig":

  • From "orig" create a layer of segments called "seg" by using Explode lines (QGIS).
  • From "seg" extract the center points of each segment, called "centr" using Point along lines with parameter 0.5 (QGIS).
  • from "centr" delete duplicates, call "centruniq" using Delete duplicate geometries (QGIS)
  • From "centruniq" create buffers of 50 cm called buff using Buffer (QGIS).
  • Run Count points analysis in polygon (QGIS) with input "buffer" and "centr", call output "count".
  • To "seg" element duplicates, call "seguniq" using Delete duplicate geometries (QGIS)
  • Join attributes from location of "seguniq" with count call final using intersects: segment vector with total number of passages attribute ("orig" elements)
  • style by category

I would like to ask if there was a faster solution that would allow me to display the number of line overlaps?

1

1 Answer 1

4

This may reduce the steps in the workflow.

(1) Explode lines (same as your first step)

(2) On the Exploded layer, Count the number of overlaps using an expression:

count('Explode', group_by:=geom_to_wkt($geometry))

Some use-cases will be:

(A) To set the line width:

enter image description here

(B) To use it for the label:

enter image description here


Input

enter image description here

Output

enter image description here

Your Answer

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

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