17#include <geos/export.h>
18#include <geos/geom/Envelope.h>
19#include <geos/index/kdtree/KdNodeVisitor.h>
20#include <geos/index/kdtree/KdNode.h>
29#pragma warning(disable: 4251)
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; }
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
KdNode * query(const geom::Coordinate &queryPt)
static std::unique_ptr< std::vector< geom::Coordinate > > toCoordinates(std::vector< KdNode * > &kdnodes, bool includeRepeated)
std::unique_ptr< std::vector< KdNode * > > query(const geom::Envelope &queryEnv)
static std::unique_ptr< std::vector< geom::Coordinate > > toCoordinates(std::vector< KdNode * > &kdnodes)
KdNode * insert(const geom::Coordinate &p)
void query(const geom::Envelope &queryEnv, KdNodeVisitor &visitor)
void query(const geom::Envelope &queryEnv, std::vector< KdNode * > &result)
Basic namespace for all GEOS functionalities.
Definition: geos.h:39