59 std::deque<KdNode> nodeQue;
61 std::size_t numberOfNodes;
67 void queryNode(
KdNode* currentNode,
const geom::Envelope& queryEnv,
bool odd, KdNodeVisitor& visitor);
81 class BestMatchVisitor :
public KdNodeVisitor {
86 void visit(
KdNode* node)
override;
95 BestMatchVisitor(
const BestMatchVisitor& other);
96 BestMatchVisitor& operator=(
const BestMatchVisitor& rhs);
103 class AccumulatingVisitor :
public KdNodeVisitor {
105 AccumulatingVisitor(std::vector<KdNode*>& p_nodeList) :
106 nodeList(p_nodeList) {};
107 void visit(
KdNode* node)
override { nodeList.push_back(node); }
111 std::vector<KdNode*>& nodeList;
113 AccumulatingVisitor(
const AccumulatingVisitor& other);
114 AccumulatingVisitor& operator=(
const AccumulatingVisitor& rhs);
127 static std::unique_ptr<std::vector<geom::Coordinate>>
toCoordinates(std::vector<KdNode*>& kdnodes);
140 static std::unique_ptr<std::vector<geom::Coordinate>>
toCoordinates(std::vector<KdNode*>& kdnodes,
bool includeRepeated);
148 KdTree(
double p_tolerance) :
151 tolerance(p_tolerance)
154 bool isEmpty() {
return root ==
nullptr; }