3

I have two line layers with almost the same attribute table. And I want to create a buffer with "variable distance buffer" from the line's attribute "raiometade" and "raio_metade".

Layer 1 is getting the right result (a buffer with distance of 2572 meters), but the layer 2 output is incorrect and I don't know why (it is generating an output buffer with distance of 100 meters).

Both lines are located in the same location and the only real difference is that Layer 1 was generated directly using the tool box (variable distance buffer) and layer 2 was generated using the following code on the python console:

 processing.run("saga:variabledistancebuffer", {'SHAPES':line,'DIST_FIELD':'raio_metade','DIST_SCALE':1,'NZONES':1,'DARC':5,'DISSOLVE       ':True,'POLY_INNER       ':False,'BUFFER':'TEMPORARY_OUTPUT'})

Table of layer 1:

enter image description here

Table of layer 2:

enter image description here

Buffer resulted from layer 1:

enter image description here

Buffer resulted from layer 2:

enter image description here

2
  • 1
    Do both layers have the same CRS?
    – Erik
    Feb 6, 2020 at 14:06
  • Yes, they do have the same CRS.
    – Kajo
    Feb 6, 2020 at 14:12

1 Answer 1

1

You can try using a virtual layer.

Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Feel free to add any field of interest from the layer.

select st_buffer(geometry,raio_metade) as geometry, raio_metade  
from line

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.