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):
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)
-
1Without 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 workKnightshound– Knightshound2016年06月06日 12:01:31 +00:00Commented Jun 6, 2016 at 12:01
-
1You can try to use Sextante (see this answer) instead of QgsGeometryAnalyser. It has a "segment" argument which might be useful.ArMoraer– ArMoraer2016年06月06日 12:05:59 +00:00Commented 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.Håvard Tveite– Håvard Tveite2017年03月25日 11:22:11 +00:00Commented Mar 25, 2017 at 11:22
1 Answer 1
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 )