I'm trying to develop a plugin for QGIS where I want to extrapolate points to a surface. The plugin needs to handle 100,000 points rather quickly and following code works alright. The problem is the extent.
file_name&file_name_poly = string with the path to the files.
shpfile = path to shapefile with the points
extent = '%f,%f,%f,%f'% (shpfile.bbox[0],shpfile.bbox[2],
shpfile.bbox[1],shpfile.bbox[3])
processing.runalg("grass:v.voronoi", file_name + ".shp", False, True,
extent, -1, 0, 3, file_name_poly)
Here is a picture of the result, as you can see, the polygons to the left looks rather alright, but the polygons to right becomes huge.
So I wonder is it possible to set a maximum size for each polygon? Or is it somehow possible to set the extent as a polygon?
Edit!
I have tried to implement this solution hence the code became much slower and with the same problem. This picture is a part of the field, the dots are the original data points, the solid polygons are the ones from the grass processing voronoi algorithm and the dotted line polygons are from ST_DelaunayTriangles link.
This just a part of field, I wasn't able to run the complete field, since it was taking too long time. Hence, the problem remains that I can't set an outer boundary of the field.
Writing this post might solved the problem. The solution might be to do the grass voronoi diagram first and the make an st_within to remove the unnecessary parts afterwards.
I'll post again when I've tried that solution!