17#include <geos/export.h>
18#include <geos/index/SpatialIndex.h>
19#include <geos/geom/Envelope.h>
20#include <geos/index/strtree/SimpleSTRnode.h>
28#pragma warning(disable: 4251)
71 std::deque<SimpleSTRnode> nodesQue;
72 std::vector<SimpleSTRnode*> nodes;
73 std::size_t nodeCapacity;
86 static void sortNodesY(std::vector<SimpleSTRnode*>& nodeList);
87 static void sortNodesX(std::vector<SimpleSTRnode*>& nodeList);
96 std::vector<SimpleSTRnode*> createHigherLevels(
97 std::vector<SimpleSTRnode*>& nodesOfALevel,
int level);
99 void addParentNodesFromVerticalSlice(
100 std::vector<SimpleSTRnode*>& verticalSlice,
102 std::vector<SimpleSTRnode*>& parentNodes);
104 std::vector<SimpleSTRnode*> createParentNodes(
105 std::vector<SimpleSTRnode*>& childNodes,
121 : nodeCapacity(capacity)
126 std::size_t getNodeCapacity()
const {
130 std::size_t getNumLeafNodes()
const {
134 return root->getNumLeafNodes();
139 bool getBuilt()
const {
143 SimpleSTRnode* getRoot() {
148 void insert(geom::Geometry* geom);
160 friend std::ostream& operator<<(std::ostream& os,
const SimpleSTRtree& tree);
167 std::pair<const void*, const void*> nearestNeighbour(
ItemDistance* itemDist);
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
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 function method which computes the distance between two ItemBoundables in an STRtree....
Definition: ItemDistance.h:33
A node of the STR tree.
Definition: SimpleSTRnode.h:37
A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatia...
Definition: SimpleSTRtree.h:65
bool remove(const geom::Envelope *searchBounds, void *item) override
Removes a single item from the tree.
SimpleSTRtree(std::size_t capacity=10)
Definition: SimpleSTRtree.h:120
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...
void query(const geom::Envelope *searchEnv, std::vector< void * > &matches) override
Queries the index for all items whose extents intersect the given search Envelope.
void insert(const geom::Envelope *itemEnv, void *item) override
Adds a spatial item with an extent specified by the given Envelope to the index.
Basic namespace for all GEOS functionalities.
Definition: geos.h:39