Bug report #9084
Mean coordinates-feature fails with negative weights
|Affected QGIS version:||2.0.1||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||17729|
Calculating mean coordinates require negative weigths per definition.
The QGIS 2.0 feature sadly doesn't check nor notifies the user (that might not be aware on this fact), if he/she tries to do such a computation with a datafield that contains also negative values. This makes it pretty hard to detect the mistake and to get valid results.
Steps to reproduce:
*Add a point vector layer with a field that contains also negative values
*Select this layer and pick vector - analysis - mean coordinates
*Pick layer, pick field for weights and create a result layer
*See that the resulting mean coordinates are just the same, as the centeroid of the convex hull of all datapoints (so without influence of the weights)
*Add a hint to the feature dialog
*Do a non-negative check before starting processing
*Giving hints that you can use the field-calculator
#6 Updated by Giovanni Manghi almost 4 years ago
- Status changed from Feedback to Open
Alexander Bruy wrote:
What is desired behaviour: skip features with negative values in weight field, or check weight field for negative values and abort algorithm if there are negative values?
I guess that stopping and warning the user is the right thing to do.