4

I am trying to use Voronoi polygons algorithm in QGIS in a dataset of points but strangely I am getting an overlap of polygons. These points correspond to the vertices of a set of polygons.

When using MMQGIS the polygons are correctly defined, however I can't use this plugin for the number of points I need to use (much higher number of points) and since I can't set a buffer in this algorithm.

Attached you will find some screenshots of the results I got: - Fig1 is the set of polygons from which were extracted the vertices - Fig2 are the voronoi polygons obtained from the native qgis algorithm - Fig3 are the voronoi polygons obtained from MMQGIS plugin

It is observed from the selection that there is an overlap of some polygons.

How can I avoid this?

  • Figure 1 - Polygons from which were extracted the vertices Polygons from which were extracted the vertices
  • Figure 2 - Voronoi output from QGIS native algorithm Voronoi output from QGIS native algorithm
  • Figure 3 - Voronoi output using MMQGIS plugin Voronoi output using MMQGIS plugin

Dataset of Points

5
  • 1
    Please share your points so that people can run and compare it.
    – raaj
    Sep 12, 2019 at 10:31
  • Both outputs look strange - points should bo somewhere inside the Voronoi-polygons, not on the border-line. Are you sure you didn't have some points selected and ran the command with "only selected objects"?
    – Babel
    Sep 12, 2019 at 12:30
  • Thank you @raaj for your comment. I have just included the dataset of points. The reason for the points being on the border line is that there are two points close to each others.
    – Mário
    Sep 12, 2019 at 15:18
  • Thank you for your comment @babel2. I add the dataset so that you can check.
    – Mário
    Sep 12, 2019 at 15:27
  • If you extracted the vertices of polygons that share a border, you might have some duplicate points. Make sure to remove the duplicates with the delete duplicate geometries tool before creating the Voronois.
    – csk
    Sep 12, 2019 at 20:09

2 Answers 2

1

Your Voronoi still looks strange: in a voronoi-polygon, points are always INSIDE of the polygon, but never on the borderline. I checked with your points to create simple voronoi-polygons (without buffer) - before, I used the delete duplicate geometries tool as proposed by csk.

Still, even after deleting duplicated geometries (which reduces the no. of points form 62 to 52), there appear to be still some double-points left. See here in the screenshot that represents the enlarged upper-right part of your point-layer:

enter image description here

I have labeled all points (black) and the voronoi polygons (black with white buffer). From the labels, you can see very clear that there are in fact two points where just one appears: in the upper part: 3 / 1 and in the lower part 0 / 4. That explains also the strange line drawn "between" these two points. They are extremely close, thus not identical, but almost. To delete these close points and just keep one, make a buffer around your points - a very small one, like 0.0005 and dissolve it. Than convert from multi- to single part geometries. Create centroids from the result and you are left with 45 points (from the original 62 and 52 after removing duplicates.). Now you can create voronoi-polygons (with buffer) that look perfect without duplicates:

enter image description here

1
  • Hi Babel, thank you for your answer. The points that you refer as being very close but not duplicated are real points that need to be considered. They are separated by approximately 0.04cm but are real points. If you perform a random perturbation of +- 0.005m on the points in the bottom the voronoi polygons are performed correctly. I do no know what is the problem with the original locatio of the points.
    – Mário
    Sep 13, 2019 at 23:37
0

On opening your data in QGIS and then going to

Vector > Geometry Tools > Voronoi Polygons,

and setting the buffer percentage to 200 and clicking on run, I got the following output. I do not see any two points in the same polygon.

enter image description here

2
  • if you zoom in the points that are in the frontier between two voronoi polygons you will see two points very close. But this is not the issue. Your result is the same as I got, there are several overlapping polygons. I know how to solve this, if you move randomly the points in the bottom of a small quantity (I used 0.005m) it works. But I can't figure out what was the problem. (I am using version 3.8.0)
    – Mário
    Sep 13, 2019 at 8:48
  • What is the coordinate reference system of your point data?
    – GBG
    Oct 23, 2019 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.