Bug report #15825

Algorithm Voronoi polygons float division by zero

Added by Raul Nanclares over 7 years ago. Updated over 5 years ago.

Assignee:Victor Olaya
Affected QGIS version:2.18.0 Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23745


Hi, found this bug when trying to create voronoi polygons. The algorithm failed with this error:

2016-11-08T11:03:51 2 Uncaught error while executing algorithm
Traceback (most recent call last):
File "/usr/share/qgis/python/plugins/processing/core/GeoAlgorithm.py", line 203, in execute
File "/usr/share/qgis/python/plugins/processing/algs/qgis/VoronoiPolygons.py", line 110, in processAlgorithm
total = 100.0 / len(c.polygons)
ZeroDivisionError: float division by zero


Associated revisions

Revision 62cb3815
Added by Alexander Bruy about 7 years ago

[processing] prevent divizion by zero (fix #15825)


#1 Updated by Alexander Bruy about 7 years ago

  • Status changed from Open to Closed

#2 Updated by Luca Mandolesi over 5 years ago

Hi, I've recived today the same error in Qgis 3, with postgres layer and with a shapefile. Must be reopened?

#3 Updated by Håvard Tveite over 5 years ago

The division by len(c.polygons) is protected by a test for zero in the current master.
Pull request: https://github.com/qgis/QGIS/commit/62cb38153cbf4981f59a6d04114307af19fc3496#diff-8ad413aec52f8687aa63ab0d16019d3f (Dec 5, 2016)

Also available in: Atom PDF