CodeIgniter Forums
Location Based Searches - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Location Based Searches (/showthread.php?tid=18401)



Location Based Searches - El Forum - 05-05-2009

[eluser]TornUp[/eluser]
Hi All,

Haven't posted on her alot, but am a massive fan of CI!

My Question is not 100% in regards to CI(but it is the framework im using to build the system)

My question is in regards to how dating websites(as an example) and websites such as autotrader(second hand cars) are able to allow searches in a "10,15,30,etc.." mile of your postcode/zip-code, and how one would go about developping a system like that.

iv googled the topic, but it brings up "location based searches"(searches based on my phisical location, like "bars near me now")

i hope your able to help!

Thanks In Advance!


Location Based Searches - El Forum - 05-05-2009

[eluser]rogierb[/eluser]
You can buy postal code maps, which can be different formats but most of them have a postal codes combined with some sort of geografical data. So if you enter a postal code you can calculate the distance between 2 postal codes using the geo data. Most providers can provide you with sample code.


Location Based Searches - El Forum - 05-05-2009

[eluser]Dam1an[/eluser]
I've never tried it, but you can use the Google Maps API
Its discussed here with some code samples...
Hope that helps


Location Based Searches - El Forum - 05-05-2009

[eluser]bobbybaboon[/eluser]
Here's a database with zip codes and coordinates:
http://www.iplocationtools.com/zipcode_database.php

And here's a query for finding points within a certain distance
http://tipster.carsonified.com/categories/web-apps/mysql-geo-search/

I'm working on something similar so I've been looking for resources.


Location Based Searches - El Forum - 05-05-2009

[eluser]TornUp[/eluser]
[quote author="bobbybaboon" date="1241551199"]Here's a database with zip codes and coordinates:
http://www.iplocationtools.com/zipcode_database.php

And here's a query for finding points within a certain distance
http://tipster.carsonified.com/categories/web-apps/mysql-geo-search/

I'm working on something similar so I've been looking for resources.[/quote]

wonderfull! thank you very much...

only think is, im building the site for the UK(im hoping to move into the US market, so this will be handy!)

do you know of any system that is able to-do it with UK Postcodes?

Many Thanks!


Location Based Searches - El Forum - 05-05-2009

[eluser]bobbybaboon[/eluser]
Guess I shouldn't assume that everyone is in the US!

It looks like the the Royal Mail charges for their database... Here's a link if you want an annual license:

This blog post talks about getting the database for free by saying you're doing some competition. I don't know if its still applicable though.

If you're like me and hate paying for anything, here's a tutorial on how to calculate the distance between UK zip codes. He has a database linked to in his post, but I don't know how accurate or up to date it is.

And finally, there's a project trying to create its own database of postcodes since the Royal Mail wants money for it.

Hope at least one of those helps you out!


Location Based Searches - El Forum - 05-05-2009

[eluser]TornUp[/eluser]
[quote author="bobbybaboon" date="1241552965"]Guess I shouldn't assume that everyone is in the US!
[/quote]

Guess i shouldn't assume either and build the system for both UK and US, although i beleve that because the site will open in the UK, and be advertised here, their isn't going to be a massive rush of US members.

Many thanks for the following links, i beleve now that i am able to either use a UK database, or use the distance to drive, as mentioned above.

Many thanks for the links! time for some reading now!


Location Based Searches - El Forum - 06-24-2009

[eluser]dippy[/eluser]
[quote author="bobbybaboon" date="1241551199"]Here's a database with zip codes and coordinates:
http://www.iplocationtools.com/zipcode_database.php

And here's a query for finding points within a certain distance
http://tipster.carsonified.com/categories/web-apps/mysql-geo-search/

I'm working on something similar so I've been looking for resources.[/quote]

the link on here http://ipinfodb.com/zipcode_database.php for the sql isnt working.


does anyone have this zipcode database file ?