0

Using Haversine formula gives the distance between two points as a bird flying over the building, which i know how to use. But i want to calculate a road distance between two points in a mysql query. How can i do that?

This is a location table:

place|latitude|longitude
a    |78.2252 |37.3365
b    |78.235  |25.3364

Now, i have to find near places from my database with respect to current latitude and longitude from GPS.

MTA
  • 1,033
  • 5
  • 16
  • 37
  • 1
    You'll have to use an API, unless you have all the data. Google has a distance matrix API. – anshulk Apr 21 '17 at 11:14
  • have you some sample data ??? – Ashutosh SIngh Apr 21 '17 at 11:15
  • possible duplicate of http://stackoverflow.com/questions/39338167/sql-query-of-haversine-formula-in-sql-server – xGeo Apr 21 '17 at 11:25
  • Possible duplicate of [SQL query of Haversine formula in SQL server](http://stackoverflow.com/questions/39338167/sql-query-of-haversine-formula-in-sql-server) – xGeo Apr 21 '17 at 11:26

0 Answers0