21#include <geos/export.h>
22#include <geos/index/strtree/ItemDistance.h>
23#include <geos/index/strtree/BoundablePair.h>
24#include <geos/index/strtree/AbstractSTRtree.h>
25#include <geos/index/SpatialIndex.h>
26#include <geos/geom/Envelope.h>
32#pragma warning(disable: 4251)
64 using AbstractSTRtree::insert;
65 using AbstractSTRtree::query;
70 bool intersects(
const void* aBounds,
const void* bBounds)
override;
80 std::unique_ptr<BoundableList> createParentBoundables(
BoundableList* childBoundables,
int newLevel)
override;
82 std::unique_ptr<BoundableList> createParentBoundablesFromVerticalSlices(std::vector<BoundableList*>* verticalSlices,
85 STRIntersectsOp intersectsOp;
87 std::unique_ptr<BoundableList> sortBoundablesY(
const BoundableList* input);
88 std::unique_ptr<BoundableList> sortBoundablesX(
const BoundableList* input);
90 std::unique_ptr<BoundableList> createParentBoundablesFromVerticalSlice(
99 std::vector<BoundableList*>* verticalSlices(
101 std::size_t sliceCount);
103 bool isWithinDistance(
BoundablePair* initBndPair,
double maxDistance);
112 return &intersectsOp;
130 avg(
double a,
double b)
132 return (a + b) / 2.0;
144 AbstractSTRtree::query(searchEnv, matches);
150 return AbstractSTRtree::query(searchEnv, visitor);
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);
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
double getMaxY() const
Returns the Envelope maximum y-value. Null envelopes do not have maximum values.
Definition Envelope.h:308
double getMinY() const
Returns the Envelope minimum y-value. Null envelopes do not have maximum values.
Definition Envelope.h:328
A visitor for items in an index.
Definition ItemVisitor.h:28
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition SpatialIndex.h:46
A node of the STR tree.
Definition AbstractNode.h:43
A test for intersection between two bounds, necessary because subclasses of AbstractSTRtree have diff...
Definition AbstractSTRtree.h:175
Base class for STRtree and SIRtree.
Definition AbstractSTRtree.h:138
A pair of Boundables, whose leaf items support a distance metric between them.
Definition BoundablePair.h:43
A function method which computes the distance between two ItemBoundables in an STRtree....
Definition ItemDistance.h:33
A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatia...
Definition STRtree.h:63
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:148
IntersectsOp * getIntersectsOp() override
Definition STRtree.h:110
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:142
bool remove(const geom::Envelope *itemEnv, void *item) override
Removes a single item from the tree.
Definition STRtree.h:160
std::vector< Boundable * > BoundableList
A list of boundables. TODO: use a list.
Definition AbstractSTRtree.h:43
Basic namespace for all GEOS functionalities.
Definition geos.h:39