Re: BUG #5745: geometry bug?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5745: geometry bug?
Дата
Msg-id 5790.1289410575@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #5745: geometry bug?  (Mike Fowler <mike@mlfowler.com>)
Ответы Re: BUG #5745: geometry bug?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Mike Fowler <mike@mlfowler.com> writes:
> On 10/11/10 10:08, Jin wrote:
>> The distance of the horizontal lseg and the point on that is inaccurate.

> From my digging it appears that this is returning the distance between
> the first point in the line and the individual point.

I didn't look into the code yet, but that would match the result.

> 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?

The standard geometrical notion of distance between a point and a line
is that you drop the perpendicular from the point to the line, and the
length of that perpendicular is the distance.  Now, in the case of a
line segment, the perpendicular might not intersect the segment:

        x
        |
        |
        |
        +    o-----------------o

in which case I think the distance from the point to the segment's
nearer endpoint is a reasonable definition.  In some quick testing
it seems to work that way for every case except a perfectly horizontal
line segment.  So I'm thinking somebody fat-fingered the corner case
where the perpendicular would have infinite slope, and it is falling
through to the "take the nearer endpoint" case when it shouldn't.

            regards, tom lane

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

Предыдущее
От: "Kurt Stam"
Дата:
Сообщение: BUG #5747: TimeStamps too far into the future are invalid
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5747: TimeStamps too far into the future are invalid