My questions is about creating an elongated buffer around various lines and these buffers should run right in the middle of two parallel lines. The problem is that the lines do not have an equal width at all points.
To give some more context, different weed control measures were used in different lanes, so I want to visualise the lanes as polygons/buffers so I can use them to extract data from different lanes/treatments.
Best Answer
To create "buffers" along the mid line between irregularily spaced lines, create voronoi polygons:
Densify lines and Extract vertices.
Create voronoi polygons for the densified points
Join the line id to the voronoi polygons, using Field calculator with this expression
overlay_intersects ('line',$id)[0]
Aggregate voronoi polygons based on line id (see screenshot 1)
To clip the large buffers at the margin, collect all lines in a multiline, buffer this and intersect it with the voronoi polygons (see screenshot 2 for the result). You can do this e.g. with this expression using Geometry by expression:
15
for buffer size at the end of line 3line
with the name of your line layerScreenshot 1, red: initial lines; blue with black dashed lines: buffers (one buffer in yellow is selected):
Screenshot 2: