Data structure for fast line queries?(快速线路查询的数据结构?)
问题描述
我知道我可以使用 KD-Tree 来存储点并快速迭代其中靠近另一个给定点的一小部分.我想知道线条是否有类似的东西.
I know that I can use a KD-Tree to store points and iterate quickly over a fraction of them that are close to another given point. I'm wondering whether there is something similar for lines.
给定 3D 中的一组行 L(要存储在该数据结构中)和另一个查询行"q,我希望能够快速遍历 L 中的所有行与 q 足够接近".我打算使用的距离是两点 u 和 v 之间的最小欧几里得距离,其中 u 是第一行的某个点,v 是第二行的某个点.计算该距离不是问题(有一个涉及叉积的好技巧).
Given a set of lines L in 3D (to be stored in that data structure) and another "query line" q, I'd like to be able to quickly iterate through all lines in L that "are close enough" to q. The distance I'm planning to use is the minimal Euclidean distance between two points u and v where u is some point on the first line and v is some point on the second line. Computing that distance is not a problem (there's a nice trick involving the cross product).
也许你们有一个好主意或知道在哪里寻找论文、描述等......
Maybe you guys have a good idea or know where to look for papers, descriptions, etc...
TIA,秒.
推荐答案
另一个选项——也是基于磁盘的数据库系统中空间索引最常用的选项——是 R-Tree.它的实现比 KD-Tree 稍微复杂一些,但通常认为它更快,并且对线和多边形进行索引没有问题.
Another option - and the most commonly used one for spatial indexing in disk-based database systems - is the R-Tree. It's a bit more complicated to implement than a KD-Tree, but it's generally considered to be faster, and has no problem indexing lines and polygons.
这篇关于快速线路查询的数据结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:快速线路查询的数据结构?
基础教程推荐
- CString 到 char* 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 初始化列表*参数*评估顺序 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
