On Wed, 6 Feb 2002, Milo Hyson wrote:
> figure out a fast way to locate all of the postal codes within an arbitrary
> radius of another postal code.
perhaps a "refined" brute force is ok :
1. take the point you want to calculate distances around
2. calculate the maximum and minimum latitude/longitude so that a city can
be nearer than your distance limit (equivalent to going x km/mi north,
south, east and west)
3. do a brute force search but limit yourself to the "square" (it's not
really square ;-) around your starting point.
If the distances are normally small, this should be able to use indexes on
the coordinates and probably be a lot faster already.
Hope this helps,
Tycho
--
Tycho Fruru tycho.fruru@conostix.com