Re: locating cities within a radius of another

Поиск
Список
Период
Сортировка
От Geoffrey
Тема Re: locating cities within a radius of another
Дата
Msg-id 4C483B91.5010808@serioustechnology.com
обсуждение исходный текст
Ответ на Re: locating cities within a radius of another  (Oliver Kohll - Mailing Lists <oliver.lists@gtwm.co.uk>)
Список pgsql-general
Oliver Kohll - Mailing Lists wrote:
>
> On 21 Jul 2010, at 23:14, Joe Conway <mail@joeconway.com
> <mailto:mail@joeconway.com>> wrote:
>
>> If you want something simple, and not requiring PostGIS, but plpgsql
>> instead, see:
>>
>> http://archives.postgresql.org/pgsql-sql/2003-12/msg00193.php
>
> For completeness, the earthdistance module also provides the distance
> between two lat/longs, the point<@>point syntax is simple to use:
> http://www.postgresql.org/docs/8.3/static/earthdistance.html

Trying to figure out the proper usage.  My assumptions:

use ll_to_earth() to get point values to pass to 'point <@> point'

First issue, ll_to_earth() returns three values, not one.

Second issue, I tried something like:

select (ll_to_earth(46,67)<@>ll_to_earth(57,87));

I get:

ERROR:  operator does not exist: earth <@> earth
LINE 1: select (ll_to_earth(46,67)<@>ll_to_earth(57,87));

So I tried:

select (4618419.15006707<@>4394453.66154081);

And I get:

ERROR:  operator does not exist: numeric <@> numeric
LINE 1: select (4618419.15006707<@>4394453.66154081);
                                 ^
HINT:  No operator matches the given name and argument type(s). You
might need to add explicit type casts.

What am I missing???



--
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson

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

Предыдущее
От: Geoffrey
Дата:
Сообщение: Re: locating cities within a radius of another
Следующее
От: Geoffrey
Дата:
Сообщение: Re: locating cities within a radius of another