Skip to content
Browse files
[processing] warn user about incorrect input data when calculating
mean coordinates using weight field (fix #9084)
  • Loading branch information
alexbruy committed Feb 7, 2017
1 parent 9bd0d7a commit 4963548f4db0789401076377269368c4f8df8ec1
Showing 1 changed file with 5 additions and 0 deletions.
@@ -34,6 +34,7 @@
from qgis.core import Qgis, QgsField, QgsFeature, QgsGeometry, QgsPoint, QgsWkbTypes

from processing.core.GeoAlgorithm import GeoAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.core.parameters import ParameterTableField
from processing.core.parameters import ParameterVector
from processing.core.outputs import OutputVector
@@ -110,6 +111,10 @@ def processAlgorithm(self, feedback):
weight = float(feat.attributes()[weightIndex])
weight = 1.00

if weight < 0:
raise GeoAlgorithmExecutionException('Negative weight value found. Please fix you data and try again.'))

This comment has been minimized.

Copy link

DelazJ Feb 7, 2017


typo: your data

if clazz not in means:
means[clazz] = (0, 0, 0)

0 comments on commit 4963548

Please sign in to comment.