4

I am looking for a method to buffer geometries by passing a list of buffer amount values in QGIS. The resulting polygon layers should be suffixed with the buffer amount by some way. By passing i.e. (10,13,15) I would expect the following result (drawn with inkscape):

enter image description here

What I have tried so far:

  • None of the tools available in QGIS (menu-bar and geoprocessing) accept input of such list.
  • The 'Multi Ring Buffer' plugin only computes equidistant buffers.
  • The following script does work so far, but QgsGeometryAnalyser.buffer() seems to lack a parameter for how many segments to approximate (thus, I'm getting nice 20-hedrons when buffering a point)

    radiouses = [10.0, 13.0, 15.0]
    for r in radiouses:
     shapeout = 'c:\\temp\\point_buf_%s' % r
     QgsGeometryAnalyser.buffer(iface.mapCanvas.currentLayer(), shapeout, r, False, False, -1)
    
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jun 6, 2016 at 11:50
3
  • 1
    Without knowing how your buffer column is laid out it's a little tricky but having a quick look GRASS might be a good option. Have a look at "v.buffer.column". If you us this tool inside QGIS graphical modeler you'll be able to automate the whole thing and give each output it's own title. Little long winded but it might work Commented Jun 6, 2016 at 12:01
  • 1
    You can try to use Sextante (see this answer) instead of QgsGeometryAnalyser. It has a "segment" argument which might be useful. Commented Jun 6, 2016 at 12:05
  • The Multi-distance buffer QGIS Plugin allows the specification of a set of buffer distances, so if manual input is an option, that plugin should solve your problem. Commented Mar 25, 2017 at 11:22

1 Answer 1

2

Instead of using QgsGeometryAnalyser, you could try calling the Processing function:

import processing
radiouses = [10.0, 13.0, 15.0]
for r in radouses:
 shapeout = 'c:\\temp\\point_buf_%s' % r
processing.runalg("qgis:fixeddistancebuffer", iface.activeLayer(), r, 99, False, shapeout )
answered Jun 6, 2016 at 12:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.