Re: Zip Code Proximity

Поиск
Список
Период
Сортировка
От Jeff Hoffmann
Тема Re: Zip Code Proximity
Дата
Msg-id 392423F2.9DE224F9@propertykey.com
обсуждение исходный текст
Ответ на Re: Zip Code Proximity  (Andy Lewis <alewis@recruitersonline.com>)
Ответы Re: Zip Code Proximity  (Andy Lewis <alewis@recruitersonline.com>)
Список pgsql-general
Andy Lewis wrote:
>
> Actually I was thinking more on the lines of:
>
> select location from test where location @ '((31.6283,93.6347), 1.39)'::circle;
>

that works just great, assuming that you can accurately calculate the
radius of the circle that you're searching for.

> If Zylks, LA (lat/lon = 32.9696,93.9801) is also in the DB.
> The above query should select Zylks since 1.39 * 62.1 = 86 miles approx.
> 86 miles is about correct for those two zip codes.
>
> Wouldn't this be much easier?

to me, the big question is how you're calculating the radius & if you're
taking into account the curvature of the earth so that 62.1 changes in
different parts of the country.  if you've taken that into
consideration, great.  it's probably going to be ok to flatten the earth
for an area that size, though.

> Is the data type POINT index-able?
>

unfortunately, not in a really useful way for you.  plus, the optimizer
probably wouldn't use the index any.  it's a small data set, something
around 35k-40k records, right?

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

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: initdb and "exit_nicely"...
Следующее
От: Jurgen Defurne
Дата:
Сообщение: Re: max tuple size and filesystem block size