zip codes and distance type queries

Results 1 to 3 of 3

Thread: zip codes and distance type queries

  1. #1
    8575 Guest

    Default zip codes and distance type queries

    How does the query work that lets you enter number of miles radius and it finds all the zip codes within that number of miles.<BR>automotive websites have this feature on them?<BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: zip codes and distance type queries

    they probably subscribe to MapQuest&#039s services. that&#039s what we did to get maps/driving directions and conversion between lat/long and zip/cities, etc.

  3. #3
    Michael Swanson Guest

    Default RE: zip codes and distance type queries

    I actually created a routine to do exactly this a couple of years ago (can&#039t find it at the moment). There are also some components available through the Internet (for a fee) that do the same thing. Search for zip code and distance find them.<BR><BR>The basic concept is to start with a database of zip codes that are weighted with respect to latitude and longitude. In other words, a zip code doesn&#039t really have a true latitude and longitude, but they can be "weighted" so that the "center" of the zip code has a specific coordinate. These databases are available for purchase on the Internet. I think I might have even used the census information for mine.<BR><BR>Then, use the formula to determine distance between two points on the surface of a sphere. This is something you can also find on math-related web sites.<BR><BR>My database query basically computed x miles in all four directions, did a query to "cut" out only records that fell within a bounding box. Then, after I had the records, I looped through all of them and trimmed out the ones in the corners so I ended up with a true circle/radius.<BR><BR>It worked great, and was very fast.<BR><BR>Hope this helps you out...<BR><BR>Michael Swanson, MCSE, MCP+Internet<BR>Webmaster<BR>Donnelly Corporation<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts