Get the shortest distance from a point

前端 未结 8 585
长发绾君心
长发绾君心 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 06:57

    There's a rather clever solution over at Query to get records based on Radius in SQLite? based on precalculating some trigonometric values for each position when inserting the rows which then lets you calculate the distance in your query only using arithmetic functions.

    I've used it very successfully in my own code

提交回复
热议问题