diasansley Posted March 3, 2011 Share Posted March 3, 2011 can i get a proximity search done for zipcodes only for a radius of 50km... i have only address city and zipcode in my database table.. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/ Share on other sites More sharing options...
gizmola Posted March 3, 2011 Share Posted March 3, 2011 Some years ago I implemented this feature for someone using a php library I licensed. There's a list of similar packages of all different costs, but the basic idea for each is the same -- mapping the zipcodes to long/lat and providing radius calculations to determine a result set. http://www.hotscripts.com/category/php/scripts-programs/zip-code-locators/ Here is a free script with database for mysql. The script needs some work, and the data is somewhat out of date, but it would provide you a good basis for the calculations needed for determining proximity. http://www.micahcarrick.com/php-zip-code-range-and-distance-calculation.html It could be that it would be fairly easy to update it using this data, which might be more current -> http://www.populardata.com/zipcode_database.html This dataset has even more zipcodes, so it might even be better: http://www.boutell.com/zipcodes/ Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182260 Share on other sites More sharing options...
diasansley Posted March 3, 2011 Author Share Posted March 3, 2011 i will go through them but can i do it without lattitude and longitude coz my database has only city and address. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182269 Share on other sites More sharing options...
kickstart Posted March 3, 2011 Share Posted March 3, 2011 Hi Can't see how. You either need to know the location of the addresses so you can calculate the distance, or link the zip code of the address to a database of zip code locations. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182291 Share on other sites More sharing options...
diasansley Posted March 3, 2011 Author Share Posted March 3, 2011 ok ill explain more in detail i have the following fields "city" "state" "country""zipcode" can i perform [roximity search using these values. currenty my map works fine this is a additional feature i tried to add thanks Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182299 Share on other sites More sharing options...
kickstart Posted March 3, 2011 Share Posted March 3, 2011 Hi Only if you know the phyical location of the zip codes. There are tables of zip codes with their locations that you can download to add to your database. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182300 Share on other sites More sharing options...
diasansley Posted March 3, 2011 Author Share Posted March 3, 2011 thanks but what if i wana display on search of one zip code the rest with are within 50Km how u suggest to do that! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182303 Share on other sites More sharing options...
kickstart Posted March 3, 2011 Share Posted March 3, 2011 Hi In that case you join your table of locations with the table of zip codes getting the longitudes and latitudes and then use one of the common routines around to calculate the distance between each of the resulting rows and the longitude / latitude of the zip code that you want find everything that is within 50km of. This is a thread wanting something similar:- http://www.phpfreaks.com/forums/index.php/topic,266134.0.html All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182307 Share on other sites More sharing options...
diasansley Posted March 3, 2011 Author Share Posted March 3, 2011 thanks Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182313 Share on other sites More sharing options...
diasansley Posted March 3, 2011 Author Share Posted March 3, 2011 can i get a sql file of Netherlands with "zipcode" "city" "lattitude" "longitude" thanks i have found one for the US but cant find any for Netherlands Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182364 Share on other sites More sharing options...
kickstart Posted March 3, 2011 Share Posted March 3, 2011 Hi Not checked this in any way but this looks like what you are looking for:- http://dutch-postcodes.smartcode.com/info.html Might be a free one somewhere though. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182385 Share on other sites More sharing options...
diasansley Posted March 3, 2011 Author Share Posted March 3, 2011 ;) ;) a free one would be great!!! thanks Quote Link to comment https://forums.phpfreaks.com/topic/229463-proximity-search-for-zipcodes/#findComment-1182445 Share on other sites More sharing options...
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.