Hi,

I have a need to locate (x,y) coordinates from mysql where they are close to another coordinate. For instance, all pizza bars near my car.

Example:  Searching for points closer than z to (i,j) using Pythagoras:

SET i = 10;
SET j = 10;
SET z = 30;
SELECT x, y
  FROM coordinates
  WHERE POW(x - @i, 2) + POW(y - @i, 2) < POW(@z, 2)

Big problem! Must searches every row. Linear indexing not able to help here.


I have been reading the Geographic Spacial extensions to MySQL. Which enable me to store the coordinates in a far more useful form. But do not seem to offer me the type of index I need.


This must be a common problem, is there any person who can help me?

Thanks in advance,

Ben Clewett.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to