Re: nearest match

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Ryan <pgsql-sql(at)seahat(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: nearest match
Date: 2003-03-13 08:57:02
Message-ID: 3E7047DE.5000306@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Ryan wrote:
> I'm doing some work with part diagrams and server-side image maps.
> I want to store single point coordinates (x,y) for reference numbers in a
> table looking like:
>
> reference_number text,
> x int,
> y int
>
> My question is: How can I find the *nearest* match of some clicked on
> coordinates without specifying some arbitrary distance from the stored
> point?
>
> The more I think about this the more I am realizing it is probally not
> that hard, I just can't seem to grasp the answer right now.
Can you say it in math logic? How to find, that some points are nearer
then other without counting distance?

For image maps consider using geometric types like polygon. You need
only one row for one area when using them.

Regards,
Tomasz Myrta

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christoph Haller 2003-03-13 09:02:31 Re: Using update statements in create function statements
Previous Message Len Morgan 2003-03-13 07:34:34 Re: What's wrong with this group by clause?