GEOS 3.11.1
|
A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For one- or two-dimensional spatial data. More...
#include <TemplateSTRtree.h>
Public Member Functions | |
TemplateSTRtreeImpl (size_t p_nodeCapacity=10) | |
TemplateSTRtreeImpl (size_t p_nodeCapacity, size_t itemCapacity) | |
TemplateSTRtreeImpl (const TemplateSTRtreeImpl &other) | |
TemplateSTRtreeImpl & | operator= (TemplateSTRtreeImpl other) |
void | insert (ItemType &&item) |
void | insert (const ItemType &item) |
void | insert (const BoundsType &itemEnv, ItemType &&item) |
void | insert (const BoundsType &itemEnv, const ItemType &item) |
template<typename ItemDistance > | |
std::pair< ItemType, ItemType > | nearestNeighbour (ItemDistance &distance) |
template<typename ItemDistance > | |
std::pair< ItemType, ItemType > | nearestNeighbour () |
template<typename ItemDistance > | |
std::pair< ItemType, ItemType > | nearestNeighbour (TemplateSTRtreeImpl< ItemType, BoundsTraits > &other, ItemDistance &distance) |
template<typename ItemDistance > | |
std::pair< ItemType, ItemType > | nearestNeighbour (TemplateSTRtreeImpl< ItemType, BoundsTraits > &other) |
template<typename ItemDistance > | |
ItemType | nearestNeighbour (const BoundsType &env, const ItemType &item, ItemDistance &itemDist) |
template<typename ItemDistance > | |
ItemType | nearestNeighbour (const BoundsType &env, const ItemType &item) |
template<typename Visitor > | |
void | query (const BoundsType &queryEnv, Visitor &&visitor) |
void | query (const BoundsType &queryEnv, std::vector< ItemType > &results) |
Items | items () |
template<typename F > | |
void | iterate (F &&func) |
bool | remove (const BoundsType &itemEnv, const ItemType &item) |
bool | built () const |
const Node * | getRoot () |
void | build () |
Static Protected Member Functions | |
static size_t | sliceCapacity (size_t numNodes, size_t numSlices) |
Protected Attributes | |
std::mutex | lock_ |
NodeList | nodes |
Node * | root |
size_t | nodeCapacity |
size_t | numItems |
A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For one- or two-dimensional spatial data.
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.
A user will instantiate TemplateSTRtree
instead of TemplateSTRtreeImpl
; this structure is used so that TemplateSTRtree
can implement the requirements of the SpatialIndex
interface, which is only possible when ItemType
is a pointer.
Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With Application To GIS. Morgan Kaufmann, San Francisco, 2002.
|
inline |
Build the tree if it has not already been built.
References geos::index::strtree::TemplateSTRtreeImpl< ItemType, BoundsTraits >::built().
Referenced by geos::index::strtree::TemplateSTRtreeImpl< ItemType, BoundsTraits >::getRoot(), and geos::index::strtree::TemplateSTRtreeImpl< ItemType, BoundsTraits >::items().