PDA

View Full Version : How to incorporate post/zip code proximity search onto a website?



117
25 Apr 2011, 07:12 AM
Hi guys,

I have been searching for a solution to allow me to incorporate a proximity search onto my website, for example you type in a post code or location and specify a radius then the relevant results are shown. I would like to achieve a similar search/database functionality as the following example, but have no idea where to start - can anyone point me in the right direction?

http://www.zumba.com/parties/search/search:1/address:london/distance:25/unit:m

I really appreciate any suggestions.

djlebarron
26 Apr 2011, 01:38 PM
http://www.zip-codes.com/
http://www.zip-codes.com/zip-code-database.asp
For $39.95 USD, you get the entire U.S. zip code dbase AND a radius finder application. The standard radius finder application that comes with these dbases is basically a desktop application that works with the MS Access version of the zip code dbase. However, the second link I posted above (click on the "Tools and Resources" tab in the green "US ZIP Code Database" menu of the page) will give you a tutorial on how to download a MySQL version of the postal dbase and gives you the script that enables you to set up a website-based radius finder application that works with that MySQL postal dbase. You should be able to easily and seamlessly combine the results (all zip codes within a specified radius from a specified zip code) from your MySQL "radius finder" script with a query for whatever "relevant results" you're searching your "relevant result info" dbase for.

They also have SQL Server 2000 & 2005, excel, and CSV versions of the postal dbases and they provide a ASP/VBScript for creating a web based ASP "radius finder". And they have a fantastic versatile easy free website-based "store locater" API . Unfortunately, it looks like it's U.S. and Canada only.

It seems like you need a world-wide "store finder".
Here are a couple of links that have to do with creating a world-wide "store finder" that works with Google Maps and the Google Maps API:
http://code.google.com/apis/maps/articles/phpsqlsearch.html
http://www.codeproject.com/KB/MCMS/StoreLocator.aspx
I would imagine that there is a way to tap into the google maps API to get the postal codes of your "stores" for inclusion in your dbase. I didn't look very deeply into the articles at those last two links, but I believe that the article at the last link actually covers this. I've found that going in the direction of procuring comprehensive world-wide postal dbases can be laborious and expensive. Hopefully this will start you in the right direction.