KDTree经度/纬度 [英] KDTree for longitude/latitude

查看:196
本文介绍了KDTree经度/纬度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何Python软件包允许人们对球体表面的经度/纬度进行类似kdtree的操作? (这需要适当考虑球面距离以及经度的环绕)。

Are there any packages in Python that allow one to do kdtree-like operations for longitude/latitudes on the surface of a sphere? (this would need to take into account the spherical distances properly, as well as the wraparound in longitude).

推荐答案

二进制搜索树不能通过设计处理极地表示的包围。您可能需要将坐标转换为3D笛卡尔空间,然后应用您最喜欢的搜索算法,例如kD-Tree,Octree等。

A binary search tree cannot handle the wraparound of the polar representation by design. You might need to transform the coordinates to a 3D cartesian space and then apply your favorite search algorithm, e.g., kD-Tree, Octree etc.

或者,如果可以限制将坐标的输入范围传送到表面上的一个小区域,您可以对该区域应用适当的地图投影,即不会使您的区域的形状过于扭曲的区域,并对这些no-环绕笛卡尔地图坐标。

Alternatively, if you could limit the input range of coordinates to a small region on the surface, you could apply an appropriate map projection to this region, i.e., one that does not distort the shape of your area too much, and apply a standard binary search tree on these no-wrap-around cartesian map coordinates.

这篇关于KDTree经度/纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆