sg

Cuma, Aralık 09, 2005

Re: Finding closest points to a given point


yeah you should be able to do it with that.
in your SELECT statement, use something like

SELECT point, distance(GeomFromText(<source point x> <source point
y>),point) AS dist FROM mytable ORDER BY dist

feild point should be a WKB geometry type feild.
plug the coords of the centre in <source point x> and <source point y>
when you are assembling the query.

It should return a list of all points, ordered by distance from the
centre.
If you only want the top X, use a LIMIT

It is totally off the top of my head though so it could be flawed but
the principle is sound. Forget circles, draw a line from the centre to
each point and measure it. (Props to whoever it was who suggested this
alternative to circles yesterday)

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık