[thelist] Proximity/Radius searching?
Erik Heerlein
erik at erikheerlein.com
Thu Jul 21 22:41:07 CDT 2005
> are there any affordable solutions for integrating a radius search
> from a specified address. For example, returning all zip codes or
> addresses withing 'x' miles from a specified address. I'd like to
> integrate this radius/proximity searching into an existing website.
I believe once I saw some code to do that which was basically a poor
man's way of doing it without map coordinates. Since zip codes are
bunched together, 29412 is next to 29487 and so on, you search for
matches between zip codes. Stores with zip codes between 90210 and
90300 are close together. So you add 100 and subtract 100 to the
customers zip code that they entered and you search in that range.
Works pretty good for, "Find a dealer in your area". Through trial and
error you can figure out that say, +200/-200 to the zip code gives you
stores within 60 miles or whatever. Increase the range and you increase
your search area.
Like I said, not very scientific, but it seemed to work pretty well.
Erik Heerlein
erik at erikheerlein.com
More information about the thelist
mailing list