Forum Moderators: phranque
Regards,
Mick Dugan
There are a few free sources of Zip Code data (The U.S. Census Bureau has the most extensive as I recall, though I can't find the link to it right now) - but essentially all you should really need is a data structure with the longitude/latitude of each zip code, and then calculate the distance between the two points. Last time I did this type of application I was using ASP 2.0. I found a quick example in C# in my search for more current/relevant info:
[zipcodeworld.com...]
My warning would be to do a sanity check on any algorithym you adopt for calculating the distances. In some cases, those freely available on the web have been pretty inaccurate in my past experience (though most of that goes back to the data/how accurate the coordinates for the zip code are.). Maybe someone else will have some they've actually had some real-life experience with.
Obviously there are vendors with both databases and applications available. I've seen a number of web services available that offer this feature in the past few months; so depending on your volume, this may be the best investment. In terms of free approaches - the algorithyms with example code are all over the place. The data structure seems to be a bit more elusive. We actually opted to purchase our data from a third party when we built our application - send me a stickyMail if you would like the vendors' web address.