Make forward/reverse weight/offset calculated at query time,

rather than being cached in the StaticRTree.  This means we
can freely apply traffic data and not have stale values lying
around.  It reduces the size of the RTree on disk, at the expense
of some additional data in RAM.
This commit is contained in:
Daniel Patterson
2016-01-29 17:52:20 -08:00
parent 03d360b7bf
commit 49441fe204
24 changed files with 760 additions and 175 deletions
+7 -7
View File
@@ -59,6 +59,13 @@ class StaticRTree
std::uint32_t children[BRANCHING_FACTOR];
};
struct LeafNode
{
LeafNode() : object_count(0), objects() {}
uint32_t object_count;
std::array<EdgeDataT, LEAF_NODE_SIZE> objects;
};
private:
struct WrappedInputElement
{
@@ -79,13 +86,6 @@ class StaticRTree
}
};
struct LeafNode
{
LeafNode() : object_count(0), objects() {}
std::uint32_t object_count;
std::array<EdgeDataT, LEAF_NODE_SIZE> objects;
};
using QueryNodeType = mapbox::util::variant<TreeNode, EdgeDataT>;
struct QueryCandidate
{