graham23s Posted March 23, 2008 Share Posted March 23, 2008 Hi Guys, i am trying to do some homework on this befoire i start to program it, i have 15 countries zip/post codes in .csv format, to be able to search against them i take it i need to store ALL countries zips into mysql would that be right? this is some random US codes 601,18.181171,-66.749854,PR 602,18.364202,-67.182976,PR 603,18.449494,-67.112922,PR 604,18.501813,-67.1365,PR 606,18.172947,-66.944111,PR 610,18.293884,-67.130136,PR 612,18.399442,-66.711296,PR 616,18.401685,-66.666454,PR im not to sure what the digits mean can anyone explain to me? thanks guys Graham Link to comment https://forums.phpfreaks.com/topic/97528-understanding-zippost-code-searches/ Share on other sites More sharing options...
AdRock Posted March 23, 2008 Share Posted March 23, 2008 They look to me like latitude and longitude co-ordinates I only think that becuase i have to use them with google maps Link to comment https://forums.phpfreaks.com/topic/97528-understanding-zippost-code-searches/#findComment-498997 Share on other sites More sharing options...
eddierosenthal Posted March 24, 2008 Share Posted March 24, 2008 it is hard to guess that the longitude and latitude are the coordinates of the CENTER of the zip code, and how far from the center you have to go to get to the NEXT zip code. as in 601,18.181171,-66.749854,PR 602,18.364202,-67.182976,PR you are in zip code 601 if you are standing at 18.181171,-66.749854 but if you move halfway towards 18.364202,-67.182976 does that mean you have just crossed the boundary into zip code 602? PR means something but what? Link to comment https://forums.phpfreaks.com/topic/97528-understanding-zippost-code-searches/#findComment-499125 Share on other sites More sharing options...
cooldude832 Posted March 24, 2008 Share Posted March 24, 2008 I tackled this problem a while back the trick is 1) User inputs a zip code 2) Search a table of Zip codes for that zip codes long/lat position (mysql query it) 3) Take the results of the query and develop a range (1 degree of long = 86 miles) so a 50 mile range is like +/- 3/4 of a degree 4) Then query your zip Table again for Zip codes in the range of that +/- the result 5) Then take the array of valid zips for use in you query of your dataset initially intended to be queried with other criteria. Link to comment https://forums.phpfreaks.com/topic/97528-understanding-zippost-code-searches/#findComment-499132 Share on other sites More sharing options...
howdoing Posted March 24, 2008 Share Posted March 24, 2008 if you want i can show you what i have as far as a zipcode search. Pretty much i have all CA 91360 zipcodes stored in mysql, and i have the search pull them out. Link to comment https://forums.phpfreaks.com/topic/97528-understanding-zippost-code-searches/#findComment-499134 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.