c++ - 使用 dynamic_quadratic boost rtree 中的打包算法

标签 c++ algorithm boost boost-geometry

我想用 dynamic_quadratic 创建 rtree 并在承包商处给它一个范围,它将使用打包算法。 这是我使用正则二次函数执行此操作的代码。

namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;

typedef bg::model::point<double , 3, bg::cs::cartesian> BoostPoint;
typedef std::pair<BoostPoint, unsigned> PointValue;

std::vector<PointValue> points;
for(...)
{
//fill in the points vector
}

bgi::rtree< PointValue, bgi::quadratic<16> > rtree_points(points);

我该怎么做:
bgi::rtree< PointValue, bgi::dynamic_quadratic > rtree_points(points);

请看这个例子:
packing algorithm in rtree in boost

最佳答案

当我发布答案时,我在互联网上搜索了一下, 并没有找到一个好的答案。然后我意识到我需要给出第二个关于我想要创建树的动态大小的参数。所以我是怎么做到的。

bgi::rtree<PointValue, bgi::dynamic_quadratic> rtree_points(points, points.size());

关于c++ - 使用 dynamic_quadratic boost rtree 中的打包算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41284111/

相关文章:

java - 使用字母修剪进行搜索时,迭代深化代码不会增加深度

c++ - 使用 boost mpl pop_front

c++ - 为什么 const 数组优先绑定(bind) const T& 参数而不是 T&& 参数?

c++ - 是否有不是以 C/C++ 风格编写的 OpenCL 绑定(bind)?

c++ - 如何获取 std::map 中的键数?

algorithm - 在列表中查找升序三元组

c++ - 如何检测类型是否可列表初始化?

algorithm - 给定5个数,只用加乘减法看能不能生成42?

c++ - 使用容器解析为结构

c++ - 关于使用 boost::zip 迭代器的一些代码的问题