<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Calculating Distance Between Latitude Longitude Pairs in Python</title>
	<atom:link href="http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/</link>
	<description>Thoughts on Technology / Entrepreneurship / Marketing / Fatherhood</description>
	<lastBuildDate>Tue, 29 Jun 2010 15:11:37 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dave</title>
		<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/comment-page-1/#comment-89</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Tue, 08 Jun 2010 04:14:29 +0000</pubDate>
		<guid isPermaLink="false">http://geehwan.wordpress.com/?p=27#comment-89</guid>
		<description>Thank you, this is exactly what I was looking for :)</description>
		<content:encoded><![CDATA[<p>Thank you, this is exactly what I was looking for <img src='http://www.geesblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kashyap Puranik</title>
		<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/comment-page-1/#comment-88</link>
		<dc:creator>Kashyap Puranik</dc:creator>
		<pubDate>Sat, 27 Mar 2010 13:40:57 +0000</pubDate>
		<guid isPermaLink="false">http://geehwan.wordpress.com/?p=27#comment-88</guid>
		<description>Thanks :)! It was useful. I had to calculate distance between two IP addresses. I used http://api.hostip.info and the above code to get it.</description>
		<content:encoded><![CDATA[<p>Thanks <img src='http://www.geesblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ! It was useful. I had to calculate distance between two IP addresses. I used <a href="http://api.hostip.info" onclick="javascript:pageTracker._trackPageview('/outbound/comment/api.hostip.info');" rel="nofollow">http://api.hostip.info</a> and the above code to get it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: t</title>
		<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/comment-page-1/#comment-62</link>
		<dc:creator>t</dc:creator>
		<pubDate>Thu, 23 Jul 2009 09:11:38 +0000</pubDate>
		<guid isPermaLink="false">http://geehwan.wordpress.com/?p=27#comment-62</guid>
		<description>thank you, this saved us some time</description>
		<content:encoded><![CDATA[<p>thank you, this saved us some time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: k</title>
		<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/comment-page-1/#comment-18</link>
		<dc:creator>k</dc:creator>
		<pubDate>Wed, 25 Feb 2009 15:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://geehwan.wordpress.com/?p=27#comment-18</guid>
		<description>THANK YOU! My colleagues and I also found this helpful. :)</description>
		<content:encoded><![CDATA[<p>THANK YOU! My colleagues and I also found this helpful. <img src='http://www.geesblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Turadg</title>
		<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/comment-page-1/#comment-13</link>
		<dc:creator>Turadg</dc:creator>
		<pubDate>Sun, 22 Feb 2009 04:35:29 +0000</pubDate>
		<guid isPermaLink="false">http://geehwan.wordpress.com/?p=27#comment-13</guid>
		<description>After writing and posting that, I found this clean function,
http://code.google.com/p/geolocator/source/browse/trunk/geolocator/gislib.py

from this library,
http://code.google.com/p/geolocator/

which can be easy_install-ed from PyPi,
http://pypi.python.org/pypi/geolocator</description>
		<content:encoded><![CDATA[<p>After writing and posting that, I found this clean function,<br />
<a href="http://code.google.com/p/geolocator/source/browse/trunk/geolocator/gislib.py" onclick="javascript:pageTracker._trackPageview('/outbound/comment/code.google.com');" rel="nofollow">http://code.google.com/p/geolocator/source/browse/trunk/geolocator/gislib.py</a></p>
<p>from this library,<br />
<a href="http://code.google.com/p/geolocator/" onclick="javascript:pageTracker._trackPageview('/outbound/comment/code.google.com');" rel="nofollow">http://code.google.com/p/geolocator/</a></p>
<p>which can be easy_install-ed from PyPi,<br />
<a href="http://pypi.python.org/pypi/geolocator" onclick="javascript:pageTracker._trackPageview('/outbound/comment/pypi.python.org');" rel="nofollow">http://pypi.python.org/pypi/geolocator</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Turadg</title>
		<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/comment-page-1/#comment-12</link>
		<dc:creator>Turadg</dc:creator>
		<pubDate>Sun, 22 Feb 2009 04:27:54 +0000</pubDate>
		<guid isPermaLink="false">http://geehwan.wordpress.com/?p=27#comment-12</guid>
		<description>+1, thanks.

I wanted it in meters so I looked up that conversion and here&#039;s an adaptation:

# adapted from http://www.zachary.com/s/blog/2005/01/12/python_zipcode_geo-programming
import math

nauticalMilePerLat = 60.00721
nauticalMilePerLongitude = 60.10793
rad = math.pi / 180.0
metersPerNauticalMile = 1852

def metersGeoDistance(lat1, lon1, lat2, lon2):                      
    &quot;&quot;&quot;
    Calculate distance between two lat lons in miles
    &quot;&quot;&quot;
    yDistance = (lat2 - lat1) * nauticalMilePerLat
    xDistance = (math.cos(lat1 * rad) + math.cos(lat2 * rad)) * (lon2 - lon1) * (nauticalMilePerLongitude / 2)

    distance = math.sqrt( yDistance**2 + xDistance**2 )

    return distance * metersPerNauticalMile</description>
		<content:encoded><![CDATA[<p>+1, thanks.</p>
<p>I wanted it in meters so I looked up that conversion and here&#8217;s an adaptation:</p>
<p># adapted from <a href="http://www.zachary.com/s/blog/2005/01/12/python_zipcode_geo-programming" onclick="javascript:pageTracker._trackPageview('/outbound/comment/www.zachary.com');" rel="nofollow">http://www.zachary.com/s/blog/2005/01/12/python_zipcode_geo-programming</a><br />
import math</p>
<p>nauticalMilePerLat = 60.00721<br />
nauticalMilePerLongitude = 60.10793<br />
rad = math.pi / 180.0<br />
metersPerNauticalMile = 1852</p>
<p>def metersGeoDistance(lat1, lon1, lat2, lon2):<br />
    &#8220;&#8221;"<br />
    Calculate distance between two lat lons in miles<br />
    &#8220;&#8221;"<br />
    yDistance = (lat2 &#8211; lat1) * nauticalMilePerLat<br />
    xDistance = (math.cos(lat1 * rad) + math.cos(lat2 * rad)) * (lon2 &#8211; lon1) * (nauticalMilePerLongitude / 2)</p>
<p>    distance = math.sqrt( yDistance**2 + xDistance**2 )</p>
<p>    return distance * metersPerNauticalMile</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.geesblog.com/2009/01/calculating-distance-between-latitude-longitude-pairs-in-python/comment-page-1/#comment-2</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 04 Feb 2009 20:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://geehwan.wordpress.com/?p=27#comment-2</guid>
		<description>Yep, someone found this useful. In fact, considering the difficulty I was having translating an existing formula in PHP you have saved me having to learn a whole new language.

Thank you.</description>
		<content:encoded><![CDATA[<p>Yep, someone found this useful. In fact, considering the difficulty I was having translating an existing formula in PHP you have saved me having to learn a whole new language.</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
