#include <STRtree.h>
Public Member Functions | |
STRtree (size_t nodeCapacity=10) | |
void | insert (const geom::Envelope *itemEnv, void *item) |
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) |
Queries the index for all items whose extents intersect the given search Envelope. | |
void | query (const geom::Envelope *searchEnv, ItemVisitor &visitor) |
Queries the index for all items whose extents intersect the given search Envelope and applies an ItemVisitor to them. | |
bool | remove (const geom::Envelope *itemEnv, void *item) |
Removes a single item from the tree. | |
Static Public Member Functions | |
static double | avg (double a, double b) |
static double | centreY (const geom::Envelope *e) |
Protected Member Functions | |
AbstractNode * | createNode (int level) |
IntersectsOp * | getIntersectsOp () |
The STR packed R-tree is simple to implement and maximizes space utilization; that is, as many leaves as possible are filled to capacity. Overlap between nodes is far less than in a basic R-tree. However, once the tree has been built (explicitly or on the first call to query), items may not be added or removed.
Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With Application To GIS. Morgan Kaufmann, San Francisco, 2002.
geos::index::strtree::STRtree::STRtree | ( | size_t | nodeCapacity = 10 |
) |
Constructs an STRtree with the given maximum number of child nodes that a node may have
IntersectsOp* geos::index::strtree::STRtree::getIntersectsOp | ( | ) | [inline, protected, virtual] |
Implements geos::index::strtree::AbstractSTRtree.
void geos::index::strtree::STRtree::query | ( | const geom::Envelope * | searchEnv, | |
std::vector< void * > & | ||||
) | [inline, virtual] |
Queries the index for all items whose extents intersect the given search Envelope.
Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.
searchEnv | the envelope to query for |
Implements geos::index::SpatialIndex.
void geos::index::strtree::STRtree::query | ( | const geom::Envelope * | searchEnv, | |
ItemVisitor & | visitor | |||
) | [inline, virtual] |
Queries the index for all items whose extents intersect the given search Envelope and applies an ItemVisitor to them.
Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.
searchEnv | the envelope to query for | |
visitor | a visitor object to apply to the items found |
Implements geos::index::SpatialIndex.
bool geos::index::strtree::STRtree::remove | ( | const geom::Envelope * | itemEnv, | |
void * | item | |||
) | [inline, virtual] |
Removes a single item from the tree.
itemEnv | the Envelope of the item to remove | |
item | the item to remove |
true
if the item was found Implements geos::index::SpatialIndex.