2

Is there a possibility in QGIS 3 to render line thickness by M values on every vertex?

The new Interpolated Line symbol layer type introduced in version 3.20 seems suitable for the task, but so far looks like it supports just interpolationt between line start and end points. There is no option to use M-values.

Example line below. I would like to interpolate between the line vertices of width e.g. 10 - 20 m thick.

line with 8 vertices and different m values

6
  • So, the line should become gradually thicker/thinner between two vertices with different values?
    – Erik
    May 31, 2022 at 7:00
  • you would need to cut you lines every 10-20 m and sample the M-value for these segments.
    – Vincé
    May 31, 2022 at 7:12
  • @Erik Yes, that's the idea. Actually a workaround could be to use Points along geometry and symbolise points with line szmbol and M value controlled stroke width. But there is no nice join style on the edges.
    – Albine Pro
    May 31, 2022 at 10:34
  • Is buffer_by_m expression answer your question : docs.qgis.org/3.22/en/docs/user_manual/expressions/… ? or maybe create a new line layer with single lines instead of polylines. May 31, 2022 at 11:19
  • 2
    You can for your line layer add a symbol layer with a geometry generator function, polygone type and as expression, use buffer_by_m($geometry). May 31, 2022 at 11:51

1 Answer 1

2

To do this :

  1. Go in the Layer Properties > Symbology tab
  2. Add a symbol layer (or use the default one) and select as Symbol layer type : Geometry Generator and as Geometry type Polygon / MultiPolygon
  3. As expression for the geometry generator, enter : buffer_by_m($geometry)

The result is very similar to Interpolated Line, work as you wanted and attached to the polyline layer, so the geometry is polyline, only the render is a polygon.

Below a screenshot of a comparison between Interpolated Line (light green) and buffer_by_m (hashed blue) :

comparison between interpolated line and buffer_by_m

Your Answer

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

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