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)
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> sortBoundablesY(
const BoundableList* input);
89 std::unique_ptr<BoundableList> sortBoundablesX(
const BoundableList* input);
91 std::unique_ptr<BoundableList> createParentBoundablesFromVerticalSlice(
100 std::vector<BoundableList*>* verticalSlices(
104 bool isWithinDistance(
BoundablePair* initBndPair,
double maxDistance);
113 return &intersectsOp;
131 avg(
double a,
double b)
133 return (a + b) / 2.0;
154 std::pair<const void*, const void*> nearestNeighbour(
ItemDistance* itemDist);
156 std::pair<const void*, const void*> nearestNeighbour(
STRtree* tree,
ItemDistance* itemDist);
157 std::pair<const void*, const void*> nearestNeighbour(
BoundablePair* initBndPair);
158 std::pair<const void*, const void*> nearestNeighbour(
BoundablePair* initBndPair,
double maxDistance);
163 return AbstractSTRtree::remove(itemEnv, item);
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
double getMaxY() const
Returns the Envelope maximum y-value. min y > max y indicates that this is a null Envelope.
double getMinY() const
Returns the Envelope minimum y-value. min y > max y indicates that this is a null Envelope.
A visitor for items in an index.
Definition: ItemVisitor.h:29
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition: SpatialIndex.h:47
A node of the STR tree.
Definition: AbstractNode.h:44
A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have diff...
Definition: AbstractSTRtree.h:176
Base class for STRtree and SIRtree.
Definition: AbstractSTRtree.h:139
virtual void insert(const void *bounds, void *item)
Also builds the tree, if necessary.
void query(const void *searchBounds, std::vector< void * > &foundItems)
Also builds the tree, if necessary.
A pair of Boundables, whose leaf items support a distance metric between them.
Definition: BoundablePair.h:44
A function method which computes the distance between two ItemBoundables in an STRtree....
Definition: ItemDistance.h:34
A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatia...
Definition: STRtree.h:64
STRtree(std::size_t nodeCapacity=10)
void query(const geom::Envelope *searchEnv, ItemVisitor &visitor) override
Queries the index for all items whose extents intersect the given search Envelope and applies an Item...
Definition: STRtree.h:149
IntersectsOp * getIntersectsOp() override
Definition: STRtree.h:111
void insert(const geom::Envelope *itemEnv, void *item) override
Adds a spatial item with an extent specified by the given Envelope to the index.
void query(const geom::Envelope *searchEnv, std::vector< void * > &matches) override
Queries the index for all items whose extents intersect the given search Envelope.
Definition: STRtree.h:143
bool remove(const geom::Envelope *itemEnv, void *item) override
Removes a single item from the tree.
Definition: STRtree.h:161
std::vector< Boundable * > BoundableList
A list of boundables. TODO: use a list.
Definition: AbstractSTRtree.h:44
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26