boost - 提升地理坐标的 Rtree
问题描述
我在 Boost Geometry 库中发现了一些对地理坐标(例如纬度/经度)的支持。
Boost 的 rtree 实现中是否支持地理坐标,如果支持,如何使用?我在文档中找不到任何内容(可能是不支持的提示)。
解决方案
您必须使用地理点/框类型定义 R-tree,例如:
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
using point = bg::point<double, 2, bg::cs::geographic<bg::degree>>;
using rtree_p = bgi::rtree<point, bgi::rstar<4>>;
using box = bg::box<point>;
using rtree_bi = bgi::rtree<std::pair<box, size_t>, bgi::rstar<16>>;
推荐阅读
- caching - 在“延迟值表”中:每一级缓存的延迟值是否包括上一级缓存的访问?
- c# - 尝试更新嵌套数组时出现 Mongo 错误:未找到标识符的数组过滤器
- python - 如何从列表中创建 x,y 对
- java - 找不到以下类: - android.support.v7.widget.RecyclerView
- c# - 在 Unity 2D 编辑器中,即使我告诉它,我的 UI 文本也没有改变
- flutter - 有没有办法从firestore中删除文件夹?
- python - 从日期序数数组设置日期刻度标签
- c++ - 带有 char[] 字段的 POD 结构的 constexpr 构造
- android - 第一次如何在新计算机上设置现有的 React-Native 项目?
- python - GridSearchCV 最佳超参数不会产生最佳精度