libspatialindex API Reference
(git-trunk)
src/rtree/Index.h
Go to the documentation of this file.
1
/******************************************************************************
2
* Project: libspatialindex - A C++ library for spatial indexing
3
* Author: Marios Hadjieleftheriou, mhadji@gmail.com
4
******************************************************************************
5
* Copyright (c) 2002, Marios Hadjieleftheriou
6
*
7
* All rights reserved.
8
*
9
* Permission is hereby granted, free of charge, to any person obtaining a
10
* copy of this software and associated documentation files (the "Software"),
11
* to deal in the Software without restriction, including without limitation
12
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
13
* and/or sell copies of the Software, and to permit persons to whom the
14
* Software is furnished to do so, subject to the following conditions:
15
*
16
* The above copyright notice and this permission notice shall be included
17
* in all copies or substantial portions of the Software.
18
*
19
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25
* DEALINGS IN THE SOFTWARE.
26
******************************************************************************/
27
28
#pragma once
29
30
#pragma GCC diagnostic push
31
#pragma GCC diagnostic ignored "-Wcast-qual"
32
33
namespace
SpatialIndex
34
{
35
namespace
RTree
36
{
37
class
Index
:
public
Node
38
{
39
public
:
40
~Index
()
override
;
41
42
protected
:
43
Index
(
RTree
* pTree,
id_type
id
, uint32_t level);
44
45
NodePtr
chooseSubtree
(
const
Region
& mbr, uint32_t level, std::stack<id_type>& pathBuffer)
override
;
46
NodePtr
findLeaf
(
const
Region
& mbr,
id_type
id
, std::stack<id_type>& pathBuffer)
override
;
47
48
void
split
(uint32_t dataLength, uint8_t* pData,
Region
& mbr,
id_type
id
,
NodePtr
& left,
NodePtr
& right)
override
;
49
50
uint32_t
findLeastEnlargement
(
const
Region
&)
const
;
51
uint32_t
findLeastOverlap
(
const
Region
&)
const
;
52
53
void
adjustTree
(
Node
*, std::stack<id_type>&,
bool
force =
false
);
54
void
adjustTree
(
Node
*,
Node
*, std::stack<id_type>&, uint8_t* overflowTable);
55
56
class
OverlapEntry
57
{
58
public
:
59
uint32_t
m_index
;
60
double
m_enlargement
;
61
RegionPtr
m_original
;
62
RegionPtr
m_combined
;
63
double
m_oa
;
64
double
m_ca
;
65
66
static
int
compareEntries
(
const
void
* pv1,
const
void
* pv2)
67
{
68
OverlapEntry
* pe1 = * (
OverlapEntry
**) pv1;
69
OverlapEntry
* pe2 = * (
OverlapEntry
**) pv2;
70
71
if
(pe1->
m_enlargement
< pe2->
m_enlargement
)
return
-1;
72
if
(pe1->
m_enlargement
> pe2->
m_enlargement
)
return
1;
73
return
0;
74
}
75
};
// OverlapEntry
76
77
friend
class
RTree
;
78
friend
class
Node
;
79
friend
class
BulkLoader
;
80
};
// Index
81
}
82
}
83
#pragma GCC diagnostic pop
SpatialIndex::RTree::BulkLoader
Definition:
BulkLoader.h:108
SpatialIndex::RTree::Index::OverlapEntry
Definition:
src/rtree/Index.h:57
SpatialIndex::RTree::Index::OverlapEntry::m_combined
RegionPtr m_combined
Definition:
src/rtree/Index.h:62
SpatialIndex::RTree::Index::OverlapEntry::m_oa
double m_oa
Definition:
src/rtree/Index.h:63
SpatialIndex::RTree::Index::OverlapEntry::m_original
RegionPtr m_original
Definition:
src/rtree/Index.h:61
SpatialIndex::RTree::Index::OverlapEntry::m_index
uint32_t m_index
Definition:
src/rtree/Index.h:59
SpatialIndex::RTree::Index::OverlapEntry::compareEntries
static int compareEntries(const void *pv1, const void *pv2)
Definition:
src/rtree/Index.h:66
SpatialIndex::RTree::Index::OverlapEntry::m_enlargement
double m_enlargement
Definition:
src/rtree/Index.h:60
SpatialIndex::RTree::Index::OverlapEntry::m_ca
double m_ca
Definition:
src/rtree/Index.h:64
SpatialIndex::RTree::Index
Definition:
src/rtree/Index.h:38
SpatialIndex::RTree::Index::findLeaf
NodePtr findLeaf(const Region &mbr, id_type id, std::stack< id_type > &pathBuffer) override
Definition:
rtree/Index.cc:84
SpatialIndex::RTree::Index::split
void split(uint32_t dataLength, uint8_t *pData, Region &mbr, id_type id, NodePtr &left, NodePtr &right) override
Definition:
rtree/Index.cc:104
SpatialIndex::RTree::Index::chooseSubtree
NodePtr chooseSubtree(const Region &mbr, uint32_t level, std::stack< id_type > &pathBuffer) override
Definition:
rtree/Index.cc:46
SpatialIndex::RTree::Index::findLeastEnlargement
uint32_t findLeastEnlargement(const Region &) const
Definition:
rtree/Index.cc:145
SpatialIndex::RTree::Index::findLeastOverlap
uint32_t findLeastOverlap(const Region &) const
Definition:
rtree/Index.cc:176
SpatialIndex::RTree::Index::~Index
~Index() override
SpatialIndex::RTree::Index::adjustTree
void adjustTree(Node *, std::stack< id_type > &, bool force=false)
Definition:
rtree/Index.cc:283
SpatialIndex::RTree::Node
Definition:
rtree/Node.h:45
SpatialIndex::RTree::Node::Index
friend class Index
Definition:
rtree/Node.h:192
SpatialIndex::RTree::RTree
Definition:
src/rtree/RTree.h:40
SpatialIndex::Region
Definition:
Region.h:33
Tools::PoolPointer< Node >
SpatialIndex
Definition:
Ball.h:35
SpatialIndex::id_type
int64_t id_type
Definition:
SpatialIndex.h:41
src
rtree
Index.h
Generated on Wed Apr 15 2026 14:18:11 for libspatialindex API Reference by
1.9.1