Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U1Ouf-0000ax-6s for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Feb 2013 22:16:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U1Oue-0006Gn-M1 for pgsql-bugs@arkaria.postgresql.org; Fri, 01 Feb 2013 22:16:48 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U1Oud-0006Fq-IJ for pgsql-bugs@postgresql.org; Fri, 01 Feb 2013 22:16:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U1Ouc-0003KH-IG for pgsql-bugs@postgresql.org; Fri, 01 Feb 2013 22:16:46 +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 r11MGjiw024314; Fri, 1 Feb 2013 17:16:45 -0500 (EST) From: Tom Lane To: Colin Dunklau cc: pgsql-bugs@postgresql.org Subject: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center In-reply-to: References: Comments: In-reply-to Colin Dunklau message dated "Fri, 01 Feb 2013 11:54:08 -0600" Date: Fri, 01 Feb 2013 17:16:45 -0500 Message-ID: <24313.1359757005@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) 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 Colin Dunklau writes: > Hello! I believe I've found a bug in the type conversion process from > polygon to point. > In the documentation found here > http://www.postgresql.org/docs/9.2/interactive/functions-geometry.html, > Table 9-32 claims that running the point() function on a polygon > returns the "center of polygon". This is not the case for some > polygons, as shown below. 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. I'm not sure how defensible that algorithm is (the comment attached to it mumbles something about how it should be the weighted means of the line segments instead). But for non-convex polygons like these I'm not sure there's any intuitively correct answer. If you want us to change the code to produce the answers you exhibit, you'd better explain (1) how you got them and (2) why that's the right answer and the current way is wrong. 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