[thelist] Proximity/Radius searching?

Jeff Howden jeff at jeffhowden.com
Fri Jul 22 02:46:40 CDT 2005


> From: Erik Heerlein
> 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.

Your method is based on a very flawed assumption, seemingly supported by
examination of only a tiny subset of the data.  Zip codes do *not* work that
way.  Anybody that provides a paying client with a dealer locator based on
this logic is doing themselves and their client a major disservice.

Even your example zip codes expose the flaw in the logic.  By your method,
you'd be missing out on 90069 (1.47 miles away), 90067 (1.93 miles away),
90048 (1.96 miles away), 90035 (2.49 miles away), 91614 (3.72 miles away),
91423 (4.93 miles away), etc.  In fact, in some areas like zip code 90210
there are over 170+ zip codes within a 10 mile radius.


More in a post I made to the list almost 4 years ago:



 [>] Jeff Howden
     jeff at jeffhowden.com

More information about the thelist mailing list