Re: Finding points within 50 miles

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема Re: Finding points within 50 miles
Дата
Msg-id 969488A8-E0AD-45E9-98EF-581AFF21F2FC@khera.org
обсуждение исходный текст
Ответ на Re: Finding points within 50 miles  (Janning Vygen <vygen@gmx.de>)
Список pgsql-general
On Jun 27, 2005, at 3:47 AM, Janning Vygen wrote:

> I had some problems with the calculation inside acos() sometimes
> being greater
> than 1, which should not occur. Please use a
>    CASE WHEN sin(...) > 1 THEN 1 ELSE sin(...) END
> if you have the same problem.
>

We've seen this as well with the distance radius calculation.  It
doesn't happen in 8.x but did happen 7.4, and then was easily worked
around by reducing the precision of the arguments.  Ie, we would use
73.13 rather than 73.1343593421 as pulled from the database for the
lat/lon values of the center point.

In any case, I urge you to derive the formulas yourself from basic
research so you *know* you're getting what you think you're getting.

Vivek Khera, Ph.D.
+1-301-869-4449 x806



Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: number of records returned by cursors
Следующее
От: Vivek Khera
Дата:
Сообщение: Re: Finding points within 50 miles