我通过以下方式在空间索引库的帮助下创建了一个主内存 R* 索引(DBStream 实现了 bulkLoading 的接口)
// creating a main memory RTree
memStorage = StorageManager::createNewMemoryStorageManager();
size_t capacity = 1024;
bool bWriteThrough = false;
fileInMem = StorageManager
::createNewRandomEvictionsBuffer(*memStorage, capacity, bWriteThrough);
DBStream dstream(streets);
tree = RTree::createAndBulkLoadNewRTree(SpatialIndex::RTree::BLM_STR, dstream,
*fileInMem,
fillFactor, indexCapacity,
leafCapacity, dimension, rv, indexIdentifier);
我的数据是只读的,也就是说,我只想构建树一次,保存它,并在每次使用我的程序时从持久存储重新加载。显然,我可以自己保存和加载 memStorage,但是如何从中重新创建 RTree?