I am looking for an object that can have two US zip codes sent to it and then return the distance between the two zip codes. Or if there is a function that will return the distance between two major cities. Has anyone seen anything like this on the web?

Thanks;
wade

    Here is what you are talking about:

    http://www.link-usa.com/zipcode/default.htm

    How would I do it?

    Mabye figure out the longitude and latitude of the zip code. Then have a database full of the location of each zip code. So when you try and find the distance. You have the longitude and Latitude and can calculate it. That is just off the top of my head... I havent done any research into it.

    Hope this Helps!

      Well If I can construct this algorithm I will post the code back here. Thanks for your help. Time to start looking for a zip and long/lat database.

      Thanks again!

        Here is one for cities....

        http://www.realestate3d.com/gps/uslatlongdegmin.htm

        (partial)

        I tried looking for a zip code database... but they all cost money. I actually found a comma delimited text file for 14.95 (sounds like a TV commercial), that has Zip code with longituted and latititude.

        BTW. This is sorta related. I found a cool database (NeoGeo) that if you give it an IP address, it will give you the Longitute and Latitude, of that IP. I though it was cool... anyway good luck!

        Oh last note... this is another algorithm I thought of. It would require a lot of research. I am pretty sure that the zip code is like the ip address instead of describing a net and subnets etc... the first digit describes like what area of the country the person is in (NW NE S W etc...), the next two digits narrow it down some more and the final 2 digits tell where in the city they are located. So if you could get a database of that kind of stuff (which would actually be smaller I think.) Then you wouldnt have to worry with longititude and lat. Here is where I found some of that info:

        http://www.usps.com/history/history/his2_75.htm#ZIP

        Hope this Helps!

          Write a Reply...