News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

The OC Food Review Blog:
Notes on implementing location based search (part 2 of 2)
June 30, 2006 @ 12:05:41

Rahim Sonawalla has posted part two of his series on The OC Food Review blog covering the creation of a location-based search using geocoding.

We got geocoding out of the way in the first part, so now it's time to talk distances. To figure out how far apart two places are, we could use the traditional method of calculating distances between two points, but that damn Columbus didn't fall off into the Twighlight Zone when he passed the horizon. Turns out the Earth isn't flat, go figure. Oh, and since it isn't flat, assuming that it is will cause your numbers to be off when calculating distances using normal geometry-sometimes by miles.

He links to a formula for finding the difference when the distances are short as well as a PHP implementation of the Haversine formula when the distances get long.

He combines this new knowledge with the information already obtained by the geocoding in the first part and a SQL database to help narrow down the items in the list. Then, for each of those, he compares the latitude and longitudes to get the difference between them (in miles).

0 comments voice your opinion now!
location based search geocode distance between miles location based search geocode distance between miles


blog comments powered by Disqus

Similar Posts

Liip Blog: Why a Project Switched from Google Search Appliance to Zend_Lucene

Nexen.net: Error Messages in PHP (a Search)

Andi Gutmans\' Blog: Zend Framework surpassed the .NET Framework!

Community News: PHPLondon Conference 2007 Announced

The OC Food Review Blog: Notes on implementing location based search (part 2 of 2)


Community Events











Don't see your event here?
Let us know!


security performance release podcast install package introduction component application series composer symfony2 framework hack facebook language unittest opinion database hhvm

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework