Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U221Z-0006K8-Ea for pgsql-bugs@arkaria.postgresql.org; Sun, 03 Feb 2013 16:02:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U221Y-0001TV-Eh for pgsql-bugs@arkaria.postgresql.org; Sun, 03 Feb 2013 16:02:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U221X-0001TP-Ml for pgsql-bugs@postgresql.org; Sun, 03 Feb 2013 16:02:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U221V-0005VX-7h for pgsql-bugs@postgresql.org; Sun, 03 Feb 2013 16:02:31 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r13G2Q7B007651; Sun, 3 Feb 2013 11:02:26 -0500 (EST) From: Tom Lane To: Dean Rasheed cc: Colin Dunklau , pgsql-bugs@postgresql.org Subject: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center In-reply-to: References: <24313.1359757005@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Sun, 03 Feb 2013 09:33:19 +0000" Date: Sun, 03 Feb 2013 11:02:26 -0500 Message-ID: <7650.1359907346@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Dean Rasheed 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs