cpopham Posted July 20, 2006 Posted July 20, 2006 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 Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
robplatt Posted July 20, 2006 Posted July 20, 2006 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.