I am using QGIS 2.6.1-Brighton.

Can you find errors in my attempt to make Voronoi polygons using Python Console and suggest improvements?

I have tried the following scripts but got the errors.

output=processing.runalg("qgis:voronoipolygons",vlayer1, 0.000 ,"output_file.shp")

Nothing happened

import processing
Error: Wrong number of parameters
ALGORITHM: Voronoi polygons
    INPUT <parameters>
    BUFFER <parameters>
    OUTPUT <OutputVector>

  File "<input>", line 1
SyntaxError: invalid syntax
  • 2
    Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works.
    – Ian Turton
    Sep 8, 2020 at 14:32

1 Answer 1


Use full path for output. And I suggest you to use runandload method instead of runalg in this case. It adds the output to "Layers" panel.

import processing 
output = processing.runandload("qgis:voronoipolygons", vlayer1, 0, "C:/path/to/output.shp")

# or for temporary layer
output = processing.runandload("qgis:voronoipolygons", vlayer1, 0, None)

Please review QGIS 2 section in this answer.

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.