libspatialindex API Reference
(git-trunk)
SpatialIndexImpl.cc
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
#include <
spatialindex/SpatialIndex.h
>
28
29
#include "../rtree/RTree.h"
30
#include "../mvrtree/MVRTree.h"
31
#include "../tprtree/TPRTree.h"
32
33
SpatialIndex::InvalidPageException::InvalidPageException
(
id_type
id
)
34
{
35
std::ostringstream s;
36
s <<
"Unknown page id "
<< id;
37
m_error = s.str();
38
}
39
40
std::string
SpatialIndex::InvalidPageException::what
()
41
{
42
return
"InvalidPageException: "
+ m_error;
43
}
44
45
std::ostream&
SpatialIndex::operator<<
(std::ostream& os,
const
ISpatialIndex
& i)
46
{
47
const
SpatialIndex::RTree::RTree
* pRTree =
dynamic_cast<
const
SpatialIndex::RTree::RTree
*
>
(&i);
48
if
(pRTree !=
nullptr
)
49
{
50
os << *pRTree;
51
return
os;
52
}
53
54
const
SpatialIndex::MVRTree::MVRTree
* pMVRTree =
dynamic_cast<
const
SpatialIndex::MVRTree::MVRTree
*
>
(&i);
55
if
(pMVRTree !=
nullptr
)
56
{
57
os << *pMVRTree;
58
return
os;
59
}
60
61
const
SpatialIndex::TPRTree::TPRTree
* pTPRTree =
dynamic_cast<
const
SpatialIndex::TPRTree::TPRTree
*
>
(&i);
62
if
(pTPRTree !=
nullptr
)
63
{
64
os << *pTPRTree;
65
return
os;
66
}
67
68
std::cerr <<
"ISpatialIndex operator<<: Not implemented yet for this index type."
<< std::endl;
69
return
os;
70
}
71
72
std::ostream&
SpatialIndex::operator<<
(std::ostream& os,
const
IStatistics
& s)
73
{
74
const
SpatialIndex::RTree::Statistics
* pRTreeStats =
dynamic_cast<
const
SpatialIndex::RTree::Statistics
*
>
(&s);
75
if
(pRTreeStats !=
nullptr
)
76
{
77
os << *pRTreeStats;
78
return
os;
79
}
80
81
const
SpatialIndex::MVRTree::Statistics
* pMVRTreeStats =
dynamic_cast<
const
SpatialIndex::MVRTree::Statistics
*
>
(&s);
82
if
(pMVRTreeStats !=
nullptr
)
83
{
84
os << * pMVRTreeStats;
85
return
os;
86
}
87
88
const
SpatialIndex::TPRTree::Statistics
* pTPRTreeStats =
dynamic_cast<
const
SpatialIndex::TPRTree::Statistics
*
>
(&s);
89
if
(pTPRTreeStats !=
nullptr
)
90
{
91
os << * pTPRTreeStats;
92
return
os;
93
}
94
95
std::cerr <<
"IStatistics operator<<: Not implemented yet for this index type."
<< std::endl;
96
return
os;
97
}
98
SpatialIndex::IStatistics
Definition:
SpatialIndex.h:182
SpatialIndex::TPRTree::Statistics
Definition:
tprtree/Statistics.h:39
SpatialIndex::MVRTree::MVRTree
Definition:
src/mvrtree/MVRTree.h:42
SpatialIndex::ISpatialIndex
Definition:
SpatialIndex.h:192
SpatialIndex::MVRTree::Statistics
Definition:
mvrtree/Statistics.h:39
SpatialIndex::RTree::Statistics
Definition:
rtree/Statistics.h:39
SpatialIndex.h
SpatialIndex::operator<<
SIDX_DLL std::ostream & operator<<(std::ostream &os, const Ball &ball)
Definition:
Ball.cc:215
SpatialIndex::InvalidPageException::InvalidPageException
InvalidPageException(id_type id)
Definition:
SpatialIndexImpl.cc:33
SpatialIndex::RTree::RTree
Definition:
src/rtree/RTree.h:39
SpatialIndex::TPRTree::TPRTree
Definition:
src/tprtree/TPRTree.h:39
SpatialIndex::id_type
int64_t id_type
Definition:
SpatialIndex.h:41
SpatialIndex::InvalidPageException::what
std::string what() override
Definition:
SpatialIndexImpl.cc:40
src
spatialindex
SpatialIndexImpl.cc
Generated on Wed Jan 11 2023 17:30:25 for libspatialindex API Reference by
1.8.13