Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Colin Dunklau <colin(dot)dunklau(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center
Date: 2013-02-03 16:02:26
Message-ID: 7650.1359907346@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
>>> It looks like what the code is actually computing is the average X
>>> position and average Y position of the points listed in the polygon.

> Although, if that's really how it's being calculated, then that's not
> really the centroid.

Yeah --- according to the wikipedia entry, it's the correct answer if
we consider the polygon vertexes as a disconnected collection of points
... but that's probably not what people really expect. I think a
"correct" answer in full generality for polygons that are non-convex,
contain duplicate points, etc might be pretty hard.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Colin Dunklau 2013-02-03 16:03:23 Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center
Previous Message Simon Riggs 2013-02-03 09:33:34 Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center