[Qgis-developer] Centroid and centroid fill

Carson Farmer carson.farmer at gmail.com
Thu Oct 20 09:42:58 EDT 2011


Hi Paolo,
> I just noticed that 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 poligon.
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?

Carson

-- 
Carson J. Q. Farmer
National Centre for Geocomputation
National University of Ireland, Maynooth,
http://www.carsonfarmer.com/


More information about the Qgis-developer mailing list