Qgis en - skitourenguru/Routes GitHub Wiki

"Heatmap" with vector layers

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

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

Snapping

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

snap_options

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.

snap1

While a point is nearby, Snapping cannot be done.

snap2

Since it's the last point of the segment, Snapping works

The Snapping icon is now a triangle.

Smoothing

If you have loaded the styles present in Routes/Styles/, you have already activated the smoothing option.

a. Interest of Smoothing

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.

smooth1 smooth2

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.

smooth3

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.

b. Activation

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

smooth_config

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.

c. Export the result

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

smooth_toolbox

The smooth algorithm of Qgis.

The Smoothlines we work with correspond exactly to the output file of the Qgis Smooth algorithm.

smooth_symbology smooth_export

View of segments with the Geometry | View of segments after the Smooth Generator algorithm

d. Simplification

If a smaller file is needed, it's always possible, after running this algorithm, to run the one called Simplify

smooth_simplify

View of segments after running the Smooth algorithm and the Simplify algorithm (Simplification method: Distance (Douglas-Peucker), Tolerance: 1 meter).

⚠️ **GitHub.com Fallback** ⚠️