Bug report #4415
Centroid in fTools different form centroid fill
|Documentation and Help
|Affected QGIS version:
|Pull Request or Patch supplied:
|Crashes QGIS or corrupts data:
|Copied to github as #:
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
#1 Updated by Paolo Cavallini over 12 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?
#4 Updated by Giovanni Manghi about 12 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
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.
#10 Updated by Harrissou Santanna almost 7 years ago
- Resolution set to fixed/implemented
- Status changed from Open to Closed