QGIS Symbology – Combining Single Line and Offset Arrow Line

geometry-generatorqgissymbology

I am making a flow map where I want to have a double geometry: a single line and a centered offset arrow line.
For the moment, I use a buffer but of course I don't get the desired effect of an arrow of constant length. With the buffer the length of the arrow depends on the segment.

enter image description here

difference(
  difference(
     make_line(
       start_point($geometry),
       centroid(
          offset_curve(
             $geometry, 
             length($geometry)/100.0
          )
       ),
    end_point($geometry)
    ),
    buffer(start_point($geometry), 0.1)
  ),
  buffer(end_point( $geometry), 0.1)

)

enter image description here

Best Answer

Use Marker Line instead of Geometry Generator. Set the Marker placement to On central point of segments, and set the line offset. Then you can define two symbols inside the marker, first a line like this:

1

And then a triangle like this:

2

The result:

3