|
|
 |
Re: FN-FORUM: Postcode distance matching
date posted 1st February 2005 15:18
Hmm... Have found this:
http://www.jibble.org/ukpostcodes/
Which seems to be a list of postcodes and coordinates that *might* be
usable for this kind of thing. When a store is popped into the tables,
match it's postcode with the list and populate the X and Y coordinates
in the store table by checking it against this lookup table.
Then get a list of the closest stores by looking up the X and Y
coordinate of the postcode being searched and doing:
select * from stores order by (searchplaceX-storeX)+(searchplaceY-storey)
which would bring back a ranked list of stores, closest first. With a
relatively small stores database, it shouldn't even be too slow.
How crazy a plan is that? An off the shelf, guaranteed system would
pretty much certainly be a better plan, but this might be an amusingly
simple way to sort it out.... any thoughts?
Hmm...
Dan
--
http://www.dandylogic.co.uk
|
 |
|