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)
    
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 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.
    – ArMoraer
    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. 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 )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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