X-Original-To: pgsql-sql@postgresql.org Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id A3AAC474E44 for ; Thu, 13 Mar 2003 03:57:22 -0500 (EST) Received: from klaster.net (pc242.krakow.cvx.ppp.tpnet.pl [213.76.38.242]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 4AB552BDE4; Thu, 13 Mar 2003 09:52:57 +0100 (CET) Message-ID: <3E7047DE.5000306@klaster.net> Date: Thu, 13 Mar 2003 09:57:02 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Ryan Cc: pgsql-sql@postgresql.org Subject: Re: nearest match References: <10112.65.102.128.233.1047504752.squirrel@fordparts.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/327 X-Sequence-Number: 12366 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