RTree class
#include <RTree.h>
Main R-tree class providing a unified interface.
Contents
This class delegates to specialized components for building, persisting, loading, and querying R-trees. It provides a simple interface for working with R-trees at the layer level with a known coordinate system.
The class supports:
- Bulk loading of R-tree for better performance
- Memory persistence capability
- Efficient caching for fast lookups
Constructors, destructors, conversion operators
-
RTree(RTreeHelpers::
CoordinateSystem coordSys) explicit - Construct an RTree with a specific coordinate system.
- ~RTree() defaulted
Public functions
- void insert_cell(const Cell& cell)
- Insert a cell into the collection for bulk loading.
- void build(const std::string& base_path)
- Build the RTree using bulk loading and store to disk.
- void load(const std::string& base_path, size_t cache_size = 262144)
- Load a previously saved RTree from file with caching.
- auto query_point(const Position& pos) const -> uint64_t
- Query the nearest cell for a given position.
Function documentation
RTree:: RTree(RTreeHelpers:: CoordinateSystem coordSys) explicit
Construct an RTree with a specific coordinate system.
| Parameters | |
|---|---|
| coordSys | The coordinate system for this layer's cells |
void RTree:: insert_cell(const Cell& cell)
Insert a cell into the collection for bulk loading.
| Parameters | |
|---|---|
| cell | Reference to the cell to insert |
auto RTree:: query_point(const Position& pos) const -> uint64_t
Query the nearest cell for a given position.
| Parameters | |
|---|---|
| pos | The position to query |
| Returns | Identifier (uint64_t) of the nearest cell |