CodeIgniter Forums
Developing a complex search... - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Developing a complex search... (/showthread.php?tid=32803)



Developing a complex search... - El Forum - 08-05-2010

[eluser]Wonder Woman[/eluser]
Hi,

I'm looking to develop a complex search which takes a location and/or postcode which returns the lat/long coordinates of this place and then searches for places which are located near within a specified radius parameter which will be selected. Does this make sense? Similar to how http://www.rightmove.co.uk do their property search?

I've not done anything this complex before and I have managed to download a file from http://www.easypeasy.com which has all of the postcodes in for the UK and it also has the lat/long coordinates of these postcodes as well. I figured this would be useful.

If you could help me in any way I would be most grateful.

Thanks


Developing a complex search... - El Forum - 08-05-2010

[eluser]stevezissou[/eluser]
The simplest way would be to use an existing API. Check out Yahoo Placefinder: http://developer.yahoo.com/geo/placefinder/


Developing a complex search... - El Forum - 08-05-2010

[eluser]danmontgomery[/eluser]
This is done with the haversine formula, which is an implementation of the great circle distance formula. It's relatively easy to implement, it can be done in a single MySQL statement (give lat and long, get zip codes within X distance). Google happily gives you several examples of this.