I
Ian Pattison
Hi,
I'm trying to put together what I think is a fairly complex database query.
I have a table of about 32,000 latitiude and longitude pairs and I need to
be able to query for two different things:
1. All points that are within X kilometers (or miles for that matter) of
coordinate Y (both are supplied from an HTML form).
2. The nearest X points to coordinate Y (again, supplied by a form).
The first should be simple enough... I already know how to measure the
distance between two points (once I translate all that trig into perl) so
all I need to do is run the query and discard any result that's outside the
circle. The second is tougher. Does anyone know how to sort a list like
that?
Thanks,
Ian
I'm trying to put together what I think is a fairly complex database query.
I have a table of about 32,000 latitiude and longitude pairs and I need to
be able to query for two different things:
1. All points that are within X kilometers (or miles for that matter) of
coordinate Y (both are supplied from an HTML form).
2. The nearest X points to coordinate Y (again, supplied by a form).
The first should be simple enough... I already know how to measure the
distance between two points (once I translate all that trig into perl) so
all I need to do is run the query and discard any result that's outside the
circle. The second is tougher. Does anyone know how to sort a list like
that?
Thanks,
Ian