Qgis en - skitourenguru/Routes GitHub Wiki
It's possible to create a pseudo heatmap using vector layer symbology. This is useful when you have many GPS tracks. To do this:
-
Right-click on the vector layer > Properties > Symbology
-
At the bottom of the menu, expand the Layer Rendering panel
-
To the right of Blending mode and under Feature, expand the menu and choose Addition.
Then you need to carefully choose a color that gives a good result.
"Heatmap" of individual GPS data. We can clearly see that the skiers all take roughly the same path (on the left of the image), before diverging, then converging again (on the right).
As we are working on a network, it should be forbidden to attach two segments to the same vertex, except at their endpoints. This constraint is integrated into the snapping tool.
-
Project > Snapping Option
-
Choose Advanced Configuration from the dropdown menu to the right of the magnet. Choose as Type: Line Endpoints; as Tolerance: 20; as Units: meters
Snapping option, with the correct settings
This also makes it easy to find the point to connect when reaching the arrival point or a crossing point.
While a point is nearby, Snapping cannot be done.
Since it's the last point of the segment, Snapping works
The Snapping icon is now a triangle.
If you have loaded the styles present in Routes/Styles/, you have already activated the smoothing option.
To make segments easier to work with, it can be smart to work with the Smooth option. This allows for a line between two points, but a curve between three.
Three points without smooth | Three points with smooth
This can be applied to existing segments. Be careful, if your tracks contained few points, the new line may deviate significantly from the old one.
Offset between the smooth line and the points.
When working directly with smooth lines, we no longer need to worry about points. Only the lines interest us.
-
Right-Click on the Segments layer > Properties > Symbology
-
Under the Single Symbol tab, choose Simple Line.
-
In the Symbol layer type dropdown menu, choose Geometry Generator
-
In the Geometry type dropdown menu, choose LineString / MultiLineString
Enter the expression:
smooth($geometry,4)
What needs to be entered to activate the smoothline option
Then enter in Simple Line under Geometry Generator the color and size of your segments.
Now the segments are smooth lines. But this is just symbology. For your segments to be actually as they appear:
-
Toolbox > Vector geometry > Smooth
-
You need to enter under Iterations: 4, which corresponds to the 4 we entered in the Geometry Generator formula.
-
Run
The smooth algorithm of Qgis.
The Smoothlines we work with correspond exactly to the output file of the Qgis Smooth algorithm.
View of segments with the Geometry | View of segments after the Smooth Generator algorithm
If a smaller file is needed, it's always possible, after running this algorithm, to run the one called Simplify
View of segments after running the Smooth algorithm and the Simplify algorithm (Simplification method: Distance (Douglas-Peucker), Tolerance: 1 meter).