QGIS 3 Visualisation – Adding Marker at End of Arrow Line with Offset

qgisqgis-3visualisation

I have a line layer for arrows in QGIS 3, and I'd like to display a marker at the end of each arrow. I tried to add a marker line on top of my arrow with a marker placed only on the last vertex, but it overlaps with the end arrow.

I suppose the ideal way would be somehow to define that I want to display my arrow line at eg 0.8 length, but not sure how to do that. A simple line visualization has a trim options, but there is nothing like that for an arrow line, and I cannot make a simple line curved.

This is how it looks now.

enter image description here

I would like to avoid the visible overlap.

Best Answer

Move the symbol layer containing the point symbol below the line representing the arrow:

enter image description here

To avoid overlap at all and to make the arrow-line shorter, you can set the symbol layer type to geometry generator and use this expression, where 0.98 represents an end-point at 98% of the total line's length from the start point:

line_substring (
    $geometry, 
    0, 
    $length*0.98)

This, however, results in the arrow not pointing to the real end point any more as the end-point of the initial line in fact is shifted:

initial line dotted in black, arrow in blue enter image description here

To overcome this, change the expression for geometry generator to:

line_substring (
    smooth($geometry, 1),
    0,
    $length*0.95)

enter image description here