QGIS: Create line vector between line without drawing

You can do this in at least three different ways. On the screenshot, I numbered the three versions accordingly; red lines are original lines, black lines are created with solution 1.

Solution 1 and 2 include both times using the same QGIS expression: offset_curve( $geometry, [distance]) - replace [distance] with a value for the offset in map units.

  1. Use geometry generator: For visualization purpose only, without creating an actual geometry, use an additional symbol layer on the original line layer, set this symbol layer to geometry generator / geometry type: line and paste the expression from above. Change settings for distance to see changes in realtime.

  2. To create a new layer with actual geometry of the shifted lines, use Menu Processing / Tollbox / Geometry by expression. Set your original line as input, geometry type as line and again paste the expression from above.

  3. Copy the line(s) you want to shift, than use the Move feature tool from the Advanced Digitizing Toolbar (if it is not visible, got to Menu View / Toolbars and checkt the box for Advanced Digitizing Toolbar. Like in solution 2, you get the actual geometry of the new lines. Like in solution 1, they will be on the same layer (thus you don't need to create a new layer). However, carefully consider what that means for attributes, because they will be copied as well.

enter image description here


You can build an algorithm using the tools below. Needs some tweaking with the expressions to get 100 %:

  1. Densify by interval
  2. Extract vertices
  3. Voronoi polygons
  4. Polygons to line
  5. Explode lines
  6. Extract by expression to select line with a length below some threshold
  7. Extract by location to select segment that are close to the input layer

enter image description here

enter image description here