Re: BUG #5745: geometry bug?

Поиск
Список
Период
Сортировка
От Mike Fowler
Тема Re: BUG #5745: geometry bug?
Дата
Msg-id 4CDAC390.9030903@mlfowler.com
обсуждение исходный текст
Ответ на BUG #5745: geometry bug?  ("Jin" <jindiax@gmail.com>)
Ответы Re: BUG #5745: geometry bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On 10/11/10 10:08, Jin wrote:
> The following bug has been logged online:
>
> Bug reference:      5745
> Logged by:          Jin
> Email address:      jindiax@gmail.com
> PostgreSQL version: 8.4.5
> Operating system:   windows xp pro sp3
> Description:        geometry bug?
> Details:
>
> The distance of the horizontal lseg and the point on that is inaccurate.
>
> select point(1.0,1.0)<->  lseg'(0.0,0.0),(2.0,0.0)';
> ↓
> result 1.4142135623731
>
> must be 1.0
>
> P.S.
> I'm sorry about if it was already reported.
> Because I can't read English well.
>

 From my digging it appears that this is returning the distance between
the first point in the line and the individual point. To get 1.0 you
would be looking for the the distance between the midpoint of the line
and the individual point which can be achieved with:

SELECT POINT(1.0,1.0) <-> POINT(LSEG'(0.0,0.0),(2.0,0.0)');

Digging through the documentation I can't find anything that says which
point should be used in the line for distance comparisons. So I would
rephrase this bug as:

The distance of the horizontal lseg and the point is calculated against
the first point in the line. Should this be calculated against the
midpoint of the line instead?

Regards,

--
Mike Fowler
Registered Linux user: 379787

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

Предыдущее
От: "Jeff Mace"
Дата:
Сообщение: BUG #5746: /etc/init.d/postgresql-9.0 status returns the wrong value
Следующее
От: "Kurt Stam"
Дата:
Сообщение: BUG #5747: TimeStamps too far into the future are invalid