title: Correct way of finding distance between two coordinates using spatial function in MySql
body: <p>I am trying to calculate distance between two locations using spatial functions in both Mysql and PostgresSQL. I have taken the latitude and longitude from Google. The details are below</p>
  
  <p>Location one - Lat: 42.260223; Lon: -71.800010</p>
  
  <p>Location two - Lat: 42.245647; Lon: -71.802521</p>
  
  <p>SQL Query used:</p>
  
  <p>SELECT DISTANCE(GEOMFROMTEXT('Point(42.260223 -71.800010)'),GEOMFROMTEXT('Point(42.245647 -71.802521)'))</p>
  
  <p>The both databases are giving the same result 0.014790703059697. But when I calculate distance in other systems the results are different. Please refer the below links</p>
  
  <p><a href="http://www.zip-codes.com/distance_calculator.asp?zip1=01601&amp;zip2=01610&amp;Submit=Search" rel="noreferrer">http://www.zip-codes.com/distance_calculator.asp?zip1=01601&amp;zip2=01610&amp;Submit=Search</a>  = 1.44 miles</p>
  
  <p><a href="http://www.distancecheck.com/zipcode-distance.php?start=01601&amp;end=01610" rel="noreferrer">http://www.distancecheck.com/zipcode-distance.php?start=01601&amp;end=01610</a>   = 1.53 miles</p>
  
  <p>So I want to know whether my calculation method/query is right or not. And if it is wrong, then what is the right way of querying the db for the distance.</p>