Question

Average coordinates as centroid of polygon

  • 13 August 2014
  • 2 replies
  • 9 views

Hello,

 

 

I know there is alredy a number of questions about centroid, but I still have problem with finding it. Thing is that centroid can be calculated as a average of coordinates. But, centroid which I am getting by using CenterOfGravity or something similar gives me different result.

Does someone knows what is going on, and how to solve it?

What is the most eficient way to calculate it give an attributes containing X,Y of centroid to my polygon (I have tens of thousands polygons, and very very much points, so I need something very quick.


2 replies

Userlevel 2
Badge +17
Hi,

 

 

No, centroid (center of mass, center of gravity) is not average of coordinates.

 

Wikipedia: Centr Of mass (http://en.wikipedia.org/wiki/Center_of_mass)

 

 

There are three transformers which replace input feature with a point.

 

CenterPointReplacer: Center of Bounding Box

 

CenterOfGravityReplacer: Center of Mass

 

InsidePointReplacer: Inside Point of Area

 

 

However, all of them are different from average of coordinates, so you will have to create your own data flow to calculate that, if necessary.

 

 

Takashi
Hi,

 

 

Thank you, Takashi. If they and you say so. Thanks.

 

 

Aleksandar

 

Reply