I am trying to create a line style for a multiline geometry. I am hoping to create a linetype which looks like the following enter image description here

The Points are not an issue, its the line/lines entering and exiting at the nodes. I was looking to use the Geometry Generator to solve the issue, by creating a buffer, based on the midpoint of each section of the multiline geometry, less the length of the start line and end line and using dissolve to create the line.

The dataset is a PostGIS vector dataset, I cant duplicate or break the lines into individual lines.

1 Answer 1


You can use the following expression together with geometry generator. Use Linestring as geometry type.

intersection(buffer(nodes_to_points( $geometry),2000),$geometry)

Adjust the buffer distance to your needs.

enter image description here

tested in QGIS 3.6

  • Well done. I was working on a similar answer but I couldn't find the function nodes_to_points() because I was searching for "vertex" instead of "note" in the expression builder. So my method required exporting the vertices as a separate layer.
    – csk
    Commented Mar 25, 2019 at 17:31
  • MrXsquared, Thank you very much for this, much appreciated!! Commented Mar 26, 2019 at 9:54

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.