[GIS] Python Script that calls the Voronoi Polygons Function

pyqgispython-2.7qgis-pluginsvoronoi-thiessen

I've been looking to see if there was a way to call Voronoi Polygons function found in Vector/Geometry Tools, directly from the code but I have not found one. Does this currently exist? Is there a way to call these functions within python coding?

Best Answer

BJEBN has suggested a function from the processing toolbox. Here's how to use it: As per http://qgis.org/de/docs/user_manual/processing/console.html

From the console you can get a list of all the algorithms available which contain the word "Voronoi" by typing:

import processing
processing.alglist("Voronoi")

Then you could find out how to use what appears the most appropriate function with:

processing.alghelp("qgis:voronoipolygons")

Then simply use the algorithm in your script as follows:

processing.runalg("qgis:voronoipolygons",inputlayer,"output_file.shp")
Related Question