Many geospatial frameworks will help you with this. In the geospatial world, a zip code is just a βpolygonβ, which is just an area on the map that defines clear boundaries (not a polygon in the mathematical sense). For example, in SQL 2008 space, you can create a new polygon based on the original polygon. This way you can dynamically create a polygon, which is your zip code extended at a certain distance at each point. It takes into account the funky form of the zip code. With an address, its easy because you just create a polygon that is a circle around one point. Then you can make queries that give all the points in the new polygon that you created in any of the methods.
Many of these sites basically just do it. They give you all the points in a five-mile extended polygon, and then maybe a 10-mile extended polygon, etc. Etc. In fact, they do not calculate the distance. Most things on the Internet are not complicated.
You can see some basic examples here to get a general idea of ββwhat I'm saying.
Charles Graham
source share