Calculating a Centroids X and Y values
282013May 17 2004 — edited May 17 2004Hi Folks
I have a table the containing polygon geometries of sites with attributes holding geographic attributes of the polygons such as area and perimeter.
I have written a trigger on the table to populate most of these fields as data is parsed to the database but I am stuck:
For various reporting reasons I need to hold two columns one containing an X value for a given site and the other holding the Y value, ie a centroid and I am not sure how to calculate this.
Due to a customer requirement the centroid must:
a) always fall within the site boundary
b) always fall in the same XY location for a given boundary geometry, so If there are two identical sites they would have identical centroids, or if one sites boundary was reloaded without any geometric changes the centroid would be recalculated to the same position.
If anyone has any idea how to acheive this please can you give me some advice.
Thanks Andrew