地理空间索引如何工作?

发布于 2024-10-09 23:32:57 字数 95 浏览 0 评论 0原文

我想知道地理空间索引(例如 MongoDB 使用的索引)是如何工作的。谁能解释一下内部使用的数据结构/算法是什么?搜索运行的时间复杂度是多少?

资源链接也很棒。

I'm wondering how a geospatial index, such as the one used by MongoDB, works. Can anyone explain what data structure/algorithm is used internally? What time complexity does a search run in?

Links to resources would be great too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

┈┾☆殇 2024-10-16 23:32:57

根据数据类型和使用模式,R-Tree 或变体 (R*, R+)或四叉树,甚至可能是kd-树

Depending on the data type and usage pattern, either an R-Tree or variant (R*, R+) or a quadtree or perhaps even a kd-tree.

不知在何时 2024-10-16 23:32:57

根据另一个SO问题

当前的实现对地理哈希码进行标准编码
MongoDB B 树。 $near 查询的结果是准确的。一项限制
使用这种编码,虽然速度很快,但前缀查找不会给出
准确的结果,尤其是在位翻转区域周围。 MongoDB 解决了这个问题
通过在初始前缀扫描后进行网格邻居搜索来选择
提高任何落后点。这通常可以确保性能
保持非常高,同时提供正确的结果。

According to this other SO question:

The current implementation encodes geographic hash codes atop standard
MongoDB B-trees. Results of $near queries are exact. One limitation
with this encoding, while fast, is that prefix lookups don't give
exact results, especially around bit flip areas. MongoDB solves this
by doing a grid-neighbor search after the initial prefix scan to pick
up any straggler points. This generally ensures that performance
remains very high while providing correct results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文