gis - Correct way of finding distance between two coordinates using spatial function in MySql -


I am trying to calculate the distance between two places, which is both in the MyScall and PostGraySQL Using spatial functions. The details I've taken latitude and longitude from Google are

the location one - the wave: 42.260223; Loan: -71.800010

Place Two - Wave: 42.245647; SQL query to use:

Select DISTANCE (GEOMFROMTEXT ('Point (42.260223 -71.800010)'), GOMFOMART ('Point (42.245647 -71.802521)' ))

Both databases are giving similar results 0.014790703059697 But when I calculate the distance in other systems the results are different. Please see the link below

= 1.44 mile

= 1.53 mile

So I want to know whether my calculation method / query is correct or not. And if this is wrong, then what is the correct way to interrogate DB for distance.

Simple answer is to use the hevarsin formula, assuming that the Earth is a field, which is not , But this is not a bad guess. This presentation is described with several other details:



Comments