Bug report #9084

Mean coordinates-feature fails with negative weights

Added by Noone Noone about 11 years ago. Updated almost 8 years ago.

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

Description

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)

Suggestions:
*Add a hint to the feature dialog
*Do a non-negative check before starting processing
*Giving hints that you can use the field-calculator

Associated revisions

Revision 4963548f
Added by Alexander Bruy almost 8 years ago

[processing] warn user about incorrect input data when calculating
mean coordinates using weight field (fix #9084)

History

#1 Updated by Giovanni Manghi about 11 years ago

  • Category changed from Vectors to 44
  • Status changed from Open to Feedback
  • Target version set to Future Release - High Priority

Calculating mean coordinates require negative weigths per definition.

do you mean "does not require", right?

#2 Updated by Noone Noone about 11 years ago

Yes, it just works with positive values :)

#3 Updated by Jürgen Fischer over 10 years ago

  • Status changed from Feedback to Open

#4 Updated by Alexander Bruy almost 9 years ago

  • Status changed from Open to Feedback

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?

#5 Updated by Paolo Cavallini almost 9 years ago

  • Subject changed from Mean coordinates-feature fails with negative weightes to Mean coordinates-feature fails with negative weights

#6 Updated by Giovanni Manghi over 8 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.

#7 Updated by Giovanni Manghi almost 8 years ago

  • Category changed from 44 to Processing/QGIS

#8 Updated by Alexander Bruy almost 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF