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

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center
Дата
Msg-id CA+U5nMLNi0QWSi9JSgjAyGumsOLZjbW-fjuivdMTgHDzpn2hbw@mail.gmail.com
обсуждение исходный текст
Ответ на postgres 9.2.2 point conversion from polygon doesn't always give accurate center  (Colin Dunklau <colin.dunklau@gmail.com>)
Ответы Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center  (Colin Dunklau <colin.dunklau@gmail.com>)
Список pgsql-bugs
On 1 February 2013 17:54, Colin Dunklau <colin.dunklau@gmail.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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center
Следующее
От: Tom Lane
Дата:
Сообщение: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center