python从gps位置获取光线a

2024-05-02 06:20:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我的数据库中有一个gps位置表

我有一个gps position(lat, lon)

现在我想得到1公里范围内所有最近的gps位置

所以我的问题是创建一个函数来获取gps position(lat, lon)并将其添加到1 km以生成MinLat and MaxLatMinLon and Maxlon

并根据该结果进行sql search运算,如下所示:

sql * from positions 
where lat between MinLat AND MaxLat AND lon between MinLon AND MaxLon

enter image description here