zip codes database and radius

cpopham

Well-known member
Joined
Feb 18, 2004
Messages
273
I have a database that has all zip codes in the US plus the lat and long of each zip code. I am trying to come with a way to get all zip codes within a certain distance of a zip code. I have figured the best way is to get a sqare around the origin (zip code) and then if then if the lat or long falls outside of this box, then reject it and if it falls within, then get it. I am having a problem though trying to establish a latitude and longitude from the starting point based on miles. If I could do this, then I could pass these two the database and retrieve all the zip codes in the area.

Does anyone have an idea of how to go about getting latitudes and longitudes of certain miles from a starting point?

Thanks, Chester
 
Look up the haversine formula... im using it on two of my gps trackers. it calculates the distance between two points. in my search for that i found exactly what your looking for... do a google search the answers rigght in front of ya.
 
Back
Top