CodeIgniter Forums

Full Version: Geographic Distance Queries?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hello All,

I have a places model with lat and long, and I'd like to be able to make simple geographic queries for related places, such as finding places within a mile of a given place.

Can anyone point me in the right direction of work that has been done in this area or libraries that might exist?

Thanks in advance to all for helping a noob. I'm new to CodeIgniter but not application development or frameworks. (I'm starting to get into CI for its PHP roots with ease of use and deployment)

Scott

El Forum

[eluser]zimco[/eluser]
You might try looking at the file http://www.sanisoft.com/phpziplocator, it is a php class you might be able to drop right-in your CI applications/libraries folder and use.

Description: A simple class for finding distances between two zip codes, The distance calculation is based on Zipdy package found at http://www.cryptnet.net/fsp/zipdy/ written by V. Alex Brennen. You can also do radius calculations to find all the zipcodes within the radius of x miles.