Skip to content
Permalink
Browse files

[processing] avoid division by zero (fix #15521)

  • Loading branch information
alexbruy committed Oct 12, 2016
1 parent 6605a22 commit 898addfa3314ad23c17ee8d64f36c292a82b6cff
Showing with 5 additions and 1 deletion.
  1. +5 −1 python/plugins/processing/algs/qgis/ConcaveHull.py
@@ -28,6 +28,7 @@

from qgis.core import Qgis, QgsFeatureRequest, QgsFeature, QgsGeometry, QgsWkbTypes
from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterVector
from processing.core.parameters import ParameterNumber
from processing.core.parameters import ParameterBoolean
@@ -73,7 +74,10 @@ def processAlgorithm(self, progress):
# Get max edge length from Delaunay triangles
progress.setText(self.tr('Computing edges max length...'))
features = delaunay_layer.getFeatures()
counter = 50. / delaunay_layer.featureCount()
if len(features) == 0:
raise GeoAlgorithmExecutionException(self.tr('No Delaunay triangles created.'))

counter = 50. / len(features)
lengths = []
edges = {}
for feat in features:

0 comments on commit 898addf

Please sign in to comment.
You can’t perform that action at this time.