Re: [pgsql-advocacy] Function which gives back the nearest neighbours
От | Bruno Wolff III |
---|---|
Тема | Re: [pgsql-advocacy] Function which gives back the nearest neighbours |
Дата | |
Msg-id | 20050328172223.GA11567@wolff.to обсуждение исходный текст |
Ответ на | Re: [pgsql-advocacy] Function which gives back the nearest neighbours (Christopher Kings-Lynne <chriskl@familyhealth.com.au>) |
Ответы |
Re: [pgsql-advocacy] Function which gives back the nearest
|
Список | pgsql-novice |
On Mon, Mar 28, 2005 at 18:32:09 +0200, Virgile Beddok <virgile.beddok@igd.fraunhofer.de> wrote: > > I just want to know if there is an existing and implemented function, or > tree, in Postgres which allows me to directly perform a "nearest neighbour > search" on multidimensional vectors. How are you measuring distance? (i.e. Euclidean distance isn't the only metric that you could be using.) Earthdistance has functions for doing this using geodesics on the surface of a sphere. For 2D, I think there is a function on "point"s that uses Euclidean distance. I don't think this is the hard part of your problem. It is easy to create a metric function and get the point corresponding to the minimal value using a sort. Being able to limit the sets of points looked at is the hard part.
В списке pgsql-novice по дате отправления: