19#include <geos/export.h>
20#include <geos/geom/Envelope.h>
21#include <geos/index/strtree/SimpleSTRtree.h>
22#include <geos/index/strtree/SimpleSTRnode.h>
29#pragma warning(disable: 4251)
40class GEOS_DLL SimpleSTRpair {
46 ItemDistance* itemDistance;
64 SimpleSTRpair(SimpleSTRnode* p_node1, SimpleSTRnode* p_node2, ItemDistance* p_itemDistance)
67 , itemDistance(p_itemDistance)
69 m_distance = distance();
72 SimpleSTRnode* getNode(
int i)
const;
84 double getDistance()
const;
91 bool isLeaves()
const;
99 double maximumDistance();
101 friend std::ostream& operator<<(std::ostream& os, SimpleSTRpair& pair);
108class GEOS_DLL SimpleSTRdistance {
113 struct STRpairQueueCompare {
115 operator()(
const SimpleSTRpair* a,
const SimpleSTRpair* b)
117 return a->getDistance() > b->getDistance();
121 typedef std::priority_queue<SimpleSTRpair*,
122 std::vector<SimpleSTRpair*>,
123 STRpairQueueCompare> STRpairQueue;
127 SimpleSTRdistance(SimpleSTRnode* root1, SimpleSTRnode* root2, ItemDistance* p_itemDistance);
130 std::pair<const void*, const void*> nearestNeighbour();
131 bool isWithinDistance(
double maxDistance);
136 std::deque<SimpleSTRpair> pairStore;
137 SimpleSTRpair* initPair;
138 ItemDistance* itemDistance;
141 SimpleSTRpair* createPair(SimpleSTRnode* p_node1, SimpleSTRnode* p_node2, ItemDistance* p_itemDistance);
143 std::pair<const void*, const void*> nearestNeighbour(SimpleSTRpair* p_initPair);
144 std::pair<const void*, const void*> nearestNeighbour(SimpleSTRpair* p_initPair,
double maxDistance);
146 bool isWithinDistance(SimpleSTRpair* p_initPair,
double maxDistance);
148 void expandToQueue(SimpleSTRpair* pair, STRpairQueue&,
double minDistance);
149 void expand(SimpleSTRnode* nodeComposite, SimpleSTRnode* nodeOther,
150 bool isFlipped, STRpairQueue& priQ,
double minDistance);
Basic namespace for all GEOS functionalities.
Definition: geos.h:39