zoukankan      html  css  js  c++  java
  • libSpatialindex

    libspatialindex是一种高效的C++空间索引库。支持复杂查询,如范围查询、点位置查询、 最近邻查询、K邻近查询以及参数化查询。创建内存空间索引示例代码:


    IStorageManager* diskfile = StorageManager::createNewMemoryStorageManager();
    StorageManager::IBuffer* file = StorageManager::createNewRandomEvictionsBuffer(*diskfile, 10, false);
    double fillFactor = 0.7;
    uint32_t indexCapacity = 10;
    uint32_t leafCapacity = 10;
    uint32_t dimension = 2;
    RTree::RTreeVariant variant = RTree::RV_RSTAR;
     
    id_type indexIdentifier;
    ISpatialIndex* tree = RTree::createNewRTree(*file, fillFactor, indexCapacity, leafCapacity, dimension, variant, indexIdentifier);
    x1 = enve.MinX;
    y1 = enve.MinY;
    x2 = enve.MaxX;
    y2 = enve.MaxY;
    plow[0] = x1;
    plow[1] = y1;
    phigh[0] = x2;
    phigh[1] = y2;
    //r为几何对象的外接矩形,id为唯一的标识符,为长整型
    Region r = Region(plow, phigh, 2);
    tree->insertData(0, 0, r, id);
    delete tree;
    delete file;
    delete diskfile;
  • 相关阅读:
    Powershell分支条件
    Powershell基础
    初识PowerShell
    设计模式--策略模式
    设计模式--简单工程模式
    StandardWrapper
    Tomcat的安全性
    算法效率 简单的增长率 参照

    排序算法之 归并排序
  • 原文地址:https://www.cnblogs.com/gispathfinder/p/12862506.html
Copyright © 2011-2022 走看看