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?
-
1this code may help you github.com/qgis/Quantum-GIS/blob/master/python/plugins/fTools/…geogeek– geogeek2013年04月11日 22:59:08 +00:00Commented Apr 11, 2013 at 22:59
-
Hmm, the code does offer some insight. However, what needs to be imported so the in-built functions like computeVoronoiDiagram() can be used?NothingToSay– NothingToSay2013年04月12日 00:28:01 +00:00Commented Apr 12, 2013 at 0:28
-
sorry i have never used this script, i've found it just by googling for you.geogeek– geogeek2013年04月12日 00:32:31 +00:00Commented Apr 12, 2013 at 0:32
-
Oh alright, thanks for the help. I'll tinker with it see if there is a way to make it work.NothingToSay– NothingToSay2013年04月12日 00:40:04 +00:00Commented Apr 12, 2013 at 0:40
-
cant you use the processing tool? i.e. grass:v.voronoi and qgis:voronoipolygonsGeoPy– GeoPy2013年10月01日 15:32:43 +00:00Commented Oct 1, 2013 at 15:32
1 Answer 1
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")
Explore related questions
See similar questions with these tags.