1

I have a line layer which I want to represent as dash line with fixed position. I made a custom dash model with map units for space and dash :

enter image description here

But when I display it, the dashes move with the view :

enter image description here

Is there a way to fix the render of the dash line layer from the start point of the line ?

1
  • It's a simple straight line starting at a reference point (on an airfield runway) and ending to the opposite of the runway. The spacing between dashes is 1.3m and the dashes are 1.5m long. In fact, when the starting point is included in the view, it stays fixed but when I move the view out this starting point, the lines update and start to move.
    – dmjf08
    Oct 7, 2022 at 17:04

1 Answer 1

2

This seems to be working:

Use a Geometry Generator expression for the symbol:

 apply_dash_pattern( geometry:=$geometry,
 pattern:=array(10, 5))

This will create a multiline with segments 10 m long, and a gap of 5 meters (if your crs have units in meters).

enter image description here

The grey dashes stay in the same location relative to the white crossing when panning: enter image description here

2
  • Thank you for your answer. apply_dash_pattern appears to be a QGIS 3.24 new feature. What is the difference with the dash line style I used ?
    – dmjf08
    Oct 12, 2022 at 9:25
  • Nice! Apply dash pattern is creating a multiline geometry from the input line
    – BERA
    Oct 12, 2022 at 9:55

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.