I am digitizing lines and have to keep certain distances to other lines while digitizing. Normally I would just use a buffer to generate these prohibited areas and snap to these polygons while digitizing. But I have only access to wms-layers so I cannot use snapping. Therefore I would like to adjust the rubberband so I could always see a 5,10 and 20m distance-(rubberband)line while digitizing.

Is it possible to adjust more than just the color for the rubberband so I could always see these distances while digitizing? Here is a example screenshot to show how it could look like (dotted line=digitized line, other three lines = distance lines). enter image description here

  • I'm using 2.18.0 and it looks like in QGIS>Preferences>Digitizing that you can adjust the rubberband line width, but not with any amount of true accuracy like you're needing, as the line width appears to be in pixel size.
    – JohnR
    Apr 18, 2017 at 19:10

1 Answer 1


This might be worth trying. First created a temporary new linestring layer. This is for guide purposes only and can be deleted after the main digitising is complete.

Quickly (accurately!) draw a line along where you want to avoid. By the look of your image that would be the road verge (blue line). Then under Style of the layer properties add a new simple line and change the Symbol Layer Type to 'Geometry generator'. Set Geometry Type to 'Linestring/MultiLineString'. In the expression box write:


The second line is now offset by so much either to the left or right. When I did this on my computer using OSGB1936 coordinate system, the line was offset to ~5m (+- 0.1m).(I'm guessing this could get complicated if not using meters but I wouldn't know personally).

I repeated the previous step to create another two lines with this as the expression:


This offsets two lines at 10m and 20m.

If these line are created on the wrong side then just change them to negative numbers and the lines will be generated on the other side of your original.

You won't be able to snap to these lines but it'll give a good enough guide to digitize against.

geometry generator to offset lines by certain distance

The buffers in the image were also created using the geometry generator so I could get a decent guide (buffer($geometry,5))

  • Thanks for the answer.but the translate operation adds a shift in x and y direction so the offset to the original line will vary depending on the x/y-direction of the line(see i.stack.imgur.com/6ebSw.png ). Apart from that I need to see the distances already during the digitizing. The geometry-generator will only be visible if I end digitizing a feature
    – Thomas B
    Apr 26, 2017 at 13:51
  • This method is only to create the lines for you to follow, not for your main digitizing task. First create a temporary line along the verge and add the generated style. Then when it comes to properly digitizing you trace along the the generated style of your temporary layer. once you've finished digitizing just delete the other layer. Apr 26, 2017 at 13:57
  • For creating lines to follow i would prefer a multi-buffer as the translate-operation does only work out for straight lines. In this screenshot i.stack.imgur.com/6ebSw.png you can see that the distance to the source-line varies depending on the orientation. As the lines we have to keep the distances to are several hundred kilometers long it is not reasonable to digitize all these lines. I guess a custom digitize tool could fit the need.
    – Thomas B
    May 8, 2017 at 11:31

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.