Bug report #15825

Algorithm Voronoi polygons float division by zero

Added by Raul Nanclares over 3 years ago. Updated almost 2 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/QGIS
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

Description

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
self.processAlgorithm(progress)
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

Cheers

Associated revisions

Revision 62cb3815
Added by Alexander Bruy over 3 years ago

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

History

#1 Updated by Alexander Bruy over 3 years ago

  • Status changed from Open to Closed

#2 Updated by Luca Mandolesi about 2 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 almost 2 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