Bug report #4415

Centroid in fTools different form centroid fill

Added by Paolo Cavallini over 8 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Documentation and Help
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:14347

Description

the centroid, as calculated by fTools, is not in the same location as the centroid shown by the centroid fill. The difference is easily explained in the case of multipolygons, much less obvious in case of a compact single polygon

History

#1 Updated by Paolo Cavallini over 8 years ago

From the ML (thanks cfarmer):

IIRC, the centroid as returned by fTools is based on the GEOS centroid
calculation, whose documentation states:
Based on the usual algorithm for calculating the centroid as a
weighted sum of the centroids of a decomposition of the area into
(possibly overlapping) triangles. The algorithm has been extended to
handle holes and multi-polygons. See
http://www.faqs.org/faqs/graphics/algorithms-faq/ for further details
of the basic approach.

Not sure how the centroid fill centroid is calculated, but obviously
not the same?

#2 Updated by Giovanni Manghi over 8 years ago

  • Status changed from Open to Feedback

The explanation of the different behavior has benn given in the dev mailing list, closing?

#3 Updated by Giovanni Manghi over 8 years ago

  • Target version set to Version 1.7.4

#4 Updated by Giovanni Manghi over 8 years ago

  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No

Martin Dobias said:

"The centroid fill uses the same formula. The differences are:
1. centroid fill calculates the centroid for each polygon of
multipolygon separately
2. centroid fill takes into account the polygons clipped to area
visible for rendering
3. centroid fill does not consider holes."

Suggestion: document this difference and close this ticket. Leave feedback.

#5 Updated by Paolo Cavallini about 8 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0

#6 Updated by Paolo Cavallini over 7 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#7 Updated by Paolo Cavallini over 6 years ago

  • Status changed from Feedback to Open
  • Category changed from Symbology to Documentation and Help

This can be closed when properly documented.

#8 Updated by Jürgen Fischer almost 6 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#9 Updated by Giovanni Manghi about 3 years ago

  • Regression? set to No
  • Easy fix? set to No

#10 Updated by Harrissou Santanna about 3 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

Also available in: Atom PDF