相关疑难解决方法(0)

计算2个GPS坐标之间的距离

如何计算两个GPS坐标之间的距离(使用纬度和经度)?

math geometry geography geolocation latitude-longitude

344
推荐指数
16
解决办法
42万
查看次数

如何在查询半径-BallTree sklearn中引入半径,单位为弧度或公里?

我正在处理纬度和经度数据。我使用了 BallTree,因为数据集中有很多行(32000 行)。如果我用半正矢距离构建树:

model_BTree = BallTree(np.array(points_sec_rad), metric='haversine')
Run Code Online (Sandbox Code Playgroud)

我将纬度和经度转换为弧度单位,如何将 query_radius (max_dist_rad) 应用于我想要定位的点?我使用 0.150 米作为半径,但我不确定是否应该使用弧度近似值。

ind_BTree, dist_BTree = model_BTree.query_radius(np.array(points_loc_rad), r=max_dist_rad, return_distance=True, sort_results=True)
Run Code Online (Sandbox Code Playgroud)

另外,如何限制半径内邻居的数量?谢谢

python nearest-neighbor haversine

4
推荐指数
1
解决办法
2335
查看次数