<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 19 May 2013 06:09:46 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[The OC Food Review Blog: Notes on implementing location based search (part 2 of 2)]]></title>
      <guid>http://www.phpdeveloper.org/news/5734</guid>
      <link>http://www.phpdeveloper.org/news/5734</link>
      <description><![CDATA[<p>
<i>Rahim Sonawalla</i> has posted <a href="http://blog.ocfoodreview.com/2006/06/30/notes-on-implementing-location-based-search-part-2-of-2/">part two</a> of his series on The OC Food Review blog covering the creation of a location-based search using geocoding.
</p>
<blockquote>
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.
</blockquote>
<p>
He <a href="http://blog.ocfoodreview.com/2006/06/30/notes-on-implementing-location-based-search-part-2-of-2">links to</a> a <a href="http://mathforum.org/library/drmath/view/51833.html">formula</a> for finding the difference when the distances are short as well as a <a href="http://wantingseed.com/sprout/2003/06/10/distance-between-two-points-on-earth/">PHP implementation</a> of the Haversine formula when the distances get long.
<p>
He <a href="http://blog.ocfoodreview.com/2006/06/30/notes-on-implementing-location-based-search-part-2-of-2">combines this new knowledge</a> with the information already obtained by the geocoding in the <a href="http://www.phpdeveloper.org/news/5727">first part</a> 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).
</p>]]></description>
      <pubDate>Fri, 30 Jun 2006 12:05:41 -0500</pubDate>
    </item>
  </channel>
</rss>
