libspatialindex API Reference  (git-trunk)
include/spatialindex/capi/Index.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Project: libsidx - A C API wrapper around libspatialindex
3  * Purpose: C++ object declarations to implement the wrapper.
4  * Author: Howard Butler, hobu.inc@gmail.com
5  ******************************************************************************
6  * Copyright (c) 2009, Howard Butler
7  *
8  * All rights reserved.
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a
11  * copy of this software and associated documentation files (the "Software"),
12  * to deal in the Software without restriction, including without limitation
13  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  * and/or sell copies of the Software, and to permit persons to whom the
15  * Software is furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be included
18  * in all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  * DEALINGS IN THE SOFTWARE.
27 ******************************************************************************/
28 
29 #pragma once
30 
31 
32 #include "sidx_export.h"
33 #include <memory>
34 
36 {
37 
38 public:
39  Index(const Tools::PropertySet& poProperties);
40  Index(const Tools::PropertySet& poProperties, std::unique_ptr<SpatialIndex::IDataStream> stream);
41  Index(const Tools::PropertySet& poProperties, int (*readNext)(SpatialIndex::id_type *id, double **pMin, double **pMax, uint32_t *nDimension, const uint8_t **pData, size_t* nDataLength));
42  ~Index();
43 
44  const Tools::PropertySet GetProperties() { index().getIndexProperties(m_properties); return m_properties;}
45 
46  bool insertFeature(uint64_t id, double *min, double *max);
47 
48  RTIndexType GetIndexType();
49  void SetIndexType(RTIndexType v);
50 
51  RTStorageType GetIndexStorage();
52  void SetIndexStorage(RTStorageType v);
53 
54  RTIndexVariant GetIndexVariant();
55  void SetIndexVariant(RTIndexVariant v);
56 
57  int64_t GetResultSetOffset();
58  void SetResultSetOffset(int64_t v);
59 
60  int64_t GetResultSetLimit();
61  void SetResultSetLimit(int64_t v);
62 
63  void flush();
64 
65  SpatialIndex::ISpatialIndex& index() {return *m_rtree;}
67 
68 private:
69 
70  Index& operator=(const Index&);
71  Index();
72 
73  void Initialize();
77 
78  Tools::PropertySet m_properties;
79  int64_t m_resultSetLimit;
80  int64_t m_resultSetOffset;
81 
82  void Setup();
83  SpatialIndex::IStorageManager* CreateStorage();
85  SpatialIndex::ISpatialIndex* CreateIndex();
86 };
SpatialIndex::ISpatialIndex & index()
bool insertFeature(uint64_t id, double *min, double *max)
const Tools::PropertySet GetProperties()
SpatialIndex::StorageManager::IBuffer & buffer()
int64_t id_type
Definition: SpatialIndex.h:41
RTIndexVariant
Definition: sidx_config.h:90
RTStorageType
Definition: sidx_config.h:82
RTIndexType
Definition: sidx_config.h:74
#define SIDX_DLL
Definition: sidx_export.h:41