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

From: Colin Dunklau <colin(dot)dunklau(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: 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:03:23
Message-ID: CAMTx_3CeiFGT+++Ds=MqE4QuxVhWN+muHDCVTU1+UWrv75Xu8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

You nailed it, stupid typos.

Sorry for the inconvenience, and thank you all for your assistance.

On Sun, Feb 3, 2013 at 3:33 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On 1 February 2013 17:54, Colin Dunklau <colin(dot)dunklau(at)gmail(dot)com> wrote:
>
>> For the below two queries, I expect to get a result of (0.5, 0.5).
>>
>> cdunklau=# select point( polygon '((0,0),(0,1),(1,1),(0,1))');
>> point
>> -------------
>> (0.25,0.75)
>> (1 row)
>>
>
> I think you just simply mistyped the coordinates...
>
> sriggs=# select point( polygon '((0,0),(0,1),(1,1),(1,0))');
> point
> -----------
> (0.5,0.5)
> (1 row)
>
> Your last point is a duplicate of the 2nd point, so you have a
> 4-pointed triangle and hence a strange centre.
>
> --
> Simon Riggs http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Maciej Łopuszański 2013-02-04 10:43:45 Re: BUG #7842: pg_dump scripts view to table
Previous Message Tom Lane 2013-02-03 16:02:26 Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center