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 
35 {
36 
37 public:
38  Index(const Tools::PropertySet& poProperties);
39  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));
40  ~Index();
41 
42  const Tools::PropertySet GetProperties() { index().getIndexProperties(m_properties); return m_properties;}
43 
44  bool insertFeature(uint64_t id, double *min, double *max);
45 
46  RTIndexType GetIndexType();
47  void SetIndexType(RTIndexType v);
48 
49  RTStorageType GetIndexStorage();
50  void SetIndexStorage(RTStorageType v);
51 
52  RTIndexVariant GetIndexVariant();
53  void SetIndexVariant(RTIndexVariant v);
54 
55  int64_t GetResultSetOffset();
56  void SetResultSetOffset(int64_t v);
57 
58  int64_t GetResultSetLimit();
59  void SetResultSetLimit(int64_t v);
60 
61  void flush();
62 
63  SpatialIndex::ISpatialIndex& index() {return *m_rtree;}
65 
66 private:
67 
68  Index& operator=(const Index&);
69  Index();
70 
71  void Initialize();
75 
76  Tools::PropertySet m_properties;
77 
78  void Setup();
79  SpatialIndex::IStorageManager* CreateStorage();
81  SpatialIndex::ISpatialIndex* CreateIndex();
82 };
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