19 #ifndef GEOS_INDEX_STRTREE_STRTREE_H
20 #define GEOS_INDEX_STRTREE_STRTREE_H
22 #include <geos/export.h>
23 #include <geos/index/strtree/ItemDistance.h>
24 #include <geos/index/strtree/BoundablePair.h>
25 #include <geos/index/strtree/AbstractSTRtree.h>
26 #include <geos/index/SpatialIndex.h>
27 #include <geos/geom/Envelope.h>
33 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
64 class GEOS_DLL STRtree:
public AbstractSTRtree,
public SpatialIndex {
69 class GEOS_DLL STRIntersectsOp:
public AbstractSTRtree::IntersectsOp {
71 bool intersects(
const void* aBounds,
const void* bBounds)
override;
81 std::unique_ptr<BoundableList> createParentBoundables(
BoundableList* childBoundables,
int newLevel)
override;
83 std::unique_ptr<BoundableList> createParentBoundablesFromVerticalSlices(std::vector<BoundableList*>* verticalSlices,
86 STRIntersectsOp intersectsOp;
88 std::unique_ptr<BoundableList> sortBoundables(
const BoundableList* input)
override;
90 std::unique_ptr<BoundableList> createParentBoundablesFromVerticalSlice(
99 std::vector<BoundableList*>* verticalSlices(
103 bool isWithinDistance(BoundablePair* initBndPair,
double maxDistance);
107 AbstractNode* createNode(
int level)
override;
110 getIntersectsOp()
override
112 return &intersectsOp;
123 STRtree(std::size_t nodeCapacity = 10);
130 avg(
double a,
double b)
132 return (a + b) / 2.0;
142 query(
const geom::Envelope* searchEnv, std::vector<void*>& matches)
override
153 std::pair<const void*, const void*> nearestNeighbour(
ItemDistance* itemDist);
155 std::pair<const void*, const void*> nearestNeighbour(
STRtree* tree,
ItemDistance* itemDist);
156 std::pair<const void*, const void*> nearestNeighbour(
BoundablePair* initBndPair);
157 std::pair<const void*, const void*> nearestNeighbour(
BoundablePair* initBndPair,
double maxDistance);
162 return AbstractSTRtree::remove(itemEnv, item);
178 #endif // GEOS_INDEX_STRTREE_STRTREE_H