<?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: Mysql function to find distance between two places using lat/long</title>
	<atom:link href="http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 16:02:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Imran</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-4358</link>
		<dc:creator>Imran</dc:creator>
		<pubDate>Mon, 10 May 2010 21:10:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-4358</guid>
		<description>Sorry that the ad was bugging, which FF version you used, I fixed the position so that it does not come over the content.</description>
		<content:encoded><![CDATA[<p>Sorry that the ad was bugging, which FF version you used, I fixed the position so that it does not come over the content.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-4357</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 10 May 2010 20:20:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-4357</guid>
		<description>great... thanks. Also, the ad on the left hand side of the page is a bit obtrusive. It blocks part of the content of your article. I had to use firebug to remove it so I could see the full article. Please consider an alternative placement</description>
		<content:encoded><![CDATA[<p>great&#8230; thanks. Also, the ad on the left hand side of the page is a bit obtrusive. It blocks part of the content of your article. I had to use firebug to remove it so I could see the full article. Please consider an alternative placement</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: imran</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1803</link>
		<dc:creator>imran</dc:creator>
		<pubDate>Tue, 24 Nov 2009 06:56:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1803</guid>
		<description>Sounds interesting. I&#039;ll have a look later. A bit busy at the moment. Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Sounds interesting. I&#8217;ll have a look later. A bit busy at the moment. Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: js</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1800</link>
		<dc:creator>js</dc:creator>
		<pubDate>Mon, 23 Nov 2009 23:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1800</guid>
		<description>Something funny I noticed about this code.  When you use ORDER By getDistance(.. it orders the results with a split between east and west.  All results to the east are listed before the west. It\&#039;s rather strange.

Example:  8, 22,  28, 2, 123.  

I&#039;m not sure how to go about fixing that.</description>
		<content:encoded><![CDATA[<p>Something funny I noticed about this code.  When you use ORDER By getDistance(.. it orders the results with a split between east and west.  All results to the east are listed before the west. It\&#8217;s rather strange.</p>
<p>Example:  8, 22,  28, 2, 123.  </p>
<p>I&#8217;m not sure how to go about fixing that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jb</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1436</link>
		<dc:creator>jb</dc:creator>
		<pubDate>Sat, 24 Oct 2009 03:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1436</guid>
		<description>I will do that. I just realized that I don&#039;t have the latitude and longitude values for the majority of my database. I probably wont have a good number to go through for quite some time.</description>
		<content:encoded><![CDATA[<p>I will do that. I just realized that I don&#8217;t have the latitude and longitude values for the majority of my database. I probably wont have a good number to go through for quite some time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1435</link>
		<dc:creator>Imran</dc:creator>
		<pubDate>Sat, 24 Oct 2009 03:04:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1435</guid>
		<description>Yes, it should work like that. Let me know how it performs with large number of data. The database I used it for still does not have a good number of data.
Good to know that it helped you :-)</description>
		<content:encoded><![CDATA[<p>Yes, it should work like that. Let me know how it performs with large number of data. The database I used it for still does not have a good number of data.<br />
Good to know that it helped you <img src='http://www.imranulhoque.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jb</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1434</link>
		<dc:creator>jb</dc:creator>
		<pubDate>Sat, 24 Oct 2009 02:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1434</guid>
		<description>To use this function with lat and long in separate columns would I just do something like : 

CREATE FUNCTION `GetDistance`(lat VARCHAR(120),long VARCHAR(120), coordinate2 VARCHAR(120))
	RETURNS VARCHAR(120)
BEGIN
	DECLARE pos_comma1, pos_comma2 INT;
	DECLARE lon1, lon2, lat1, lat2, distance DECIMAL(12,8);

	select locate(lat) into pos_comma1;
	select locate(long) into pos_comma2;
	select CAST(long) as DECIMAL(12,8)) into lon1;
	select CAST(lat) as DECIMAL(12,8)) into lat1;
.....

?</description>
		<content:encoded><![CDATA[<p>To use this function with lat and long in separate columns would I just do something like : </p>
<p>CREATE FUNCTION `GetDistance`(lat VARCHAR(120),long VARCHAR(120), coordinate2 VARCHAR(120))<br />
	RETURNS VARCHAR(120)<br />
BEGIN<br />
	DECLARE pos_comma1, pos_comma2 INT;<br />
	DECLARE lon1, lon2, lat1, lat2, distance DECIMAL(12,8);</p>
<p>	select locate(lat) into pos_comma1;<br />
	select locate(long) into pos_comma2;<br />
	select CAST(long) as DECIMAL(12,8)) into lon1;<br />
	select CAST(lat) as DECIMAL(12,8)) into lat1;<br />
&#8230;..</p>
<p>?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jb</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1431</link>
		<dc:creator>jb</dc:creator>
		<pubDate>Fri, 23 Oct 2009 22:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1431</guid>
		<description>I think I will just to the function as it is. I have way to many records as it is. I appreciate you posting this function here, it will be very helpful.</description>
		<content:encoded><![CDATA[<p>I think I will just to the function as it is. I have way to many records as it is. I appreciate you posting this function here, it will be very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Imran</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1425</link>
		<dc:creator>Imran</dc:creator>
		<pubDate>Fri, 23 Oct 2009 07:48:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1425</guid>
		<description>This is the simplest form of finding perpendicular distance between 2 locations. To find out the driving distance, you need to know the lat/long of all the nodes of the roads and sum up the distances of all the nodes.
In that case you may use this function with some loops over the nodes.</description>
		<content:encoded><![CDATA[<p>This is the simplest form of finding perpendicular distance between 2 locations. To find out the driving distance, you need to know the lat/long of all the nodes of the roads and sum up the distances of all the nodes.<br />
In that case you may use this function with some loops over the nodes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jb</title>
		<link>http://www.imranulhoque.com/mysql/mysql-function-to-find-distance-between-two-places-using-latlong/comment-page-1/#comment-1423</link>
		<dc:creator>jb</dc:creator>
		<pubDate>Fri, 23 Oct 2009 07:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.imranulhoque.com/?p=89#comment-1423</guid>
		<description>Could this function be written to calculate driving distance?</description>
		<content:encoded><![CDATA[<p>Could this function be written to calculate driving distance?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
