I have a layer containing multiple lines representing flown tracks of airplanes. My goal is to create maps to analyse the flow of traffic in certain airspaces.
I would like to merge all parallel, or near parallel line, segments that are within a certain distance of each other (say, 1 nautical mile).
The new, merged, lines should contain an attribute containing the number of original lines that have been merged. For example, if 5 parallel lines are merged to one, the new merged line should have a count attribute of 5, which would allow me to style it accordingly.
Consider the following schematic example:
Three individual lines, two of which have a common parallel segment.
The common part of the green and orange lines have been merged to a single line (red). The new red line will have a count attribute of 2.
Note: in this example, the red line will be an average of the two original line segments. The remaining green and orange line segments do not have to connect exactly to the new red line. In other words, the topology does not have to be intact, since the result will only be used for visual representation.
Basically, I am trying to create something like this:
How would I go about achieving a result like this in QGIS? Bear in mind the actual dataset is much larger than my example above, so the solution should be scalable.
I came across this tutorial which does something very similar to what I am trying to do. However, I would like to be able to do it using QGIS.