Does anyone know how i can determine the distance between zip codes.
So for example, right now i have a list of zip codes that get pulled from a mysql dbase upon the users entry.
I would like to put the distances between each zip code in miles .
Any ideas?
Thanks
distance between zip codes
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
You need a zipcode database (Canada isn't free, but I believe you can get the USA postal code database for free)...
The databases usually include latitude/longitude coordinates for a zipcode center.
Using these coordinates it's becomes quite trvial to calculate a great circle...aka the distance your after...
Poke around these forums, as I'm sure this question has been asked before and I recall someone having written a class which performs the calculation for you...which is easy to implement, but not trivial by any means...
Cheers
The databases usually include latitude/longitude coordinates for a zipcode center.
Using these coordinates it's becomes quite trvial to calculate a great circle...aka the distance your after...
Poke around these forums, as I'm sure this question has been asked before and I recall someone having written a class which performs the calculation for you...which is easy to implement, but not trivial by any means...
Cheers