Get the shortest distance from a point

前端 未结 8 569
长发绾君心
长发绾君心 2021-01-01 06:36

I have this table in sqlite

Locations
ID
Lat ( latitude)
Lon ( longitude) 
Type
Name
City

I have for example 100 records what I need is to

8条回答
  •  [愿得一人]
    2021-01-01 07:17

    Distance between two points: ((x1 - x2) ^ 2 + (y1 - y2) ^ 2) ^ 0.5. However, distance between these points are straight lines. Most likely, there are variables like local vs highway, not to mention one-way streets and waterways, where you need to find the nearest bridge. Therefore, I suggest using Google and Bing maps api. The are free for a limited number of searches.

提交回复
热议问题