[Qgis-developer] Voronoi missing

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Oct 9 11:27:40 EDT 2009


On Fri, Oct 9, 2009 at 3:56 PM, Carson Farmer <carson.farmer at gmail.com> wrote:
> Hi Paolo,
>
>> In fTools there is a command for generating Delaunay triangles; it would
>> be
>> good (and presumably easy) to add Voronoi tesselation to it.
>
> Good: Certainly
> Easy: Not so much ;-)
> The code that I use to create the delaunay triangles is not my own, and as
> such is not designed
> to create nice voronoi polygons. It can certainly make voronoi lines, and I
> can add this easily,
> but polygons will require quite a bit more work. I will of course add this
> in due time, unless someone
> else has an all Python voronoi polygons implementation that they want to
> share? I stress all Python
> because fTools has no additional requirements beyond the base Python and
> QGIS libraries, and *must*
> stay that way...

 Don't you also run into the problem that voronoi polygons on the edge
head off to infinity? Saving that as a shapefile might be tricky. The
pragmatic approach is to clip to a rectangle, but that can exclude
whole polygons.

 How's this:

http://www.oxfish.com/python/voronoi.py

 - licence says its distributable as long as the license/copyright
note is included (AT+T Copyright)

Barry


More information about the Qgis-developer mailing list