Friday, 15 May 2015

qgis - Voronoi polygons that run out to infinity?


I have been working on implementing the voronoi.py script (Bill Simon's translation of Steve Fortune's code). According to the QGIS link it is basically the same code that I am working with, but the way to generate the polygons that can extend to infinity differs between the two. In the QGIS case, I presume that some bounding rectangle is generated at some extent beyond the site point extents. In my case, I generate false site points as a circle surrounding the site points of interest. The circle points have a radius twice the diameter of the extent of the site points. The results between the two are shown in the attached figure, QGIS implementation on the left and my implementation on the right. Voronoi examples.


As one can see, the QGIS implementation produces weird polygons which have no site points (see site 473 as an example in both implementations). This is obvious wrong, but I am not sure whether my implementation is correct either. Since I don't have access to an ArcInfo license for ArcMap, I can't compare it what ArcMap generates natively and I can't see a way to a way to attach the site point shapefile for someone to test. So if anyone has any commentary on my use of an "infinity circle" to help force edge polygons versus an "infinity rectangle", I would appreciate it. Better still, if anyone is interested in testing the output on some other GIS platform I can provide the shapefile of the site points I used.




It appears part of the problem is that the polygons beyond the site points overlap, so when symbolized without a fill, then appear as distinct polygons. The following figure shows what happens when the polygon about site 473 and 415 are selected. So the original questions remain, but there is a new wrinkle.




It is a bug (or an "incompleteness"), the correct results in QGIS if a buffer of 0% is used. What still needs to be resolved is whether a dense pattern of circular "infinity points" will yield the same result as rectangular "infinity edges".



enter image description here



Answer



I was able to confirm that my implementation at least compares to ArcGIS (but requires an ArcInfo license). The QGIS implementation is in error if a buffer distance is used. For those using ArcGIS with an ArcView license, the toolset for Voronoi and/or Delaunay can be found as the Triangulation Tools.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...