Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center - Mailing list pgsql-bugs

From Dean Rasheed
Subject Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center
Date
Msg-id CAEZATCUoN5VmO5=wOpEi6qJFzf=OcE15pStegBr04qPmykmkTg@mail.gmail.com
Whole thread Raw
In response to Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 3 February 2013 09:16, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>> 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.

Consider for example adding an extra redundant point to one side of a square:

polygon '((-1,-1),(-1,0),(-1,1),(1,1),(1,-1))')

that will shift the average X position over to the left, but the
centroid is still at (0,0).

Regards,
Dean

pgsql-bugs by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center
Next
From: Simon Riggs
Date:
Subject: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center