4

Working under QGIS 3.16.4 and using the Modeler, I would like to create buffers for a polygons layer.

The polygons layer includes the buffer size as an attribute (e.g. "BUFFER_M") resulting from the field calculator (a previous step in the model).

enter image description here

Although I specified the polygons layer as the Input layer (Using algorithm output), there is no fields available (NULL) in the Expression Dialog.

enter image description here

I tried to fix the Distance with the expected BUFFER_M field as following: Pre-calculated Value > "BUFFER_M" in the Expression Dialog with no success.

enter image description here

All other steps in the model worked well but the buffers layer was generated with a Distance default value of 10,00 m.

Any ideas on how to specify the buffer size (Distance parameter) based on a field attribute of the input layer (vector layer)?

NB: the same problem when done manually as well (generated buffer of 10,00 m), however in this case the "BUFFER_M" field was available in the Expression Dialog.

4
  • If you want to use an attribute from another layer, how should QGIS know which buffer to use for which feature on your current layer? – Erik Mar 24 at 12:58
  • Not sure to understand. The buffer size attribute is already in the table of the layer containing each features on which I would apply the buffering (with values lines per lines). Would you suppose I need to specify, e.g. : 'buffer_size by id' in the Expression Dialog? – Jérémie Beghin Mar 24 at 13:23
  • You wrote "based on a field attribute from another vector layer" - which implies that you want to buffer layer A by values from layer B. – Erik Mar 24 at 14:22
  • 1
    I recognise it was unprecise, I should have said "from a field of the input layer". Edited now. – Jérémie Beghin Mar 24 at 14:30
4

Try the SAGA's Module 'Variable distance buffer'.

In the Buffer Distance field, please write the name of your field, that defines the buffer size.

result

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.