MobilityDB
1.3
Loading...
Searching...
No Matches
meos
include
geo
tspatial_rtree.h
Go to the documentation of this file.
1
/*****************************************************************************
2
*
3
* This MobilityDB code is provided under The PostgreSQL License.
4
* Copyright (c) 2016-2025, Université libre de Bruxelles and MobilityDB
5
* contributors
6
*
7
* MobilityDB includes portions of PostGIS version 3 source code released
8
* under the GNU General Public License (GPLv2 or later).
9
* Copyright (c) 2001-2025, PostGIS contributors
10
*
11
* Permission to use, copy, modify, and distribute this software and its
12
* documentation for any purpose, without fee, and without a written
13
* agreement is hereby granted, provided that the above copyright notice and
14
* this paragraph and the following two paragraphs appear in all copies.
15
*
16
* IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
17
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
18
* LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19
* EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
20
* OF SUCH DAMAGE.
21
*
22
* UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
25
* AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
26
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
27
*
28
*****************************************************************************/
29
34
#ifndef __TPOINT_RTREE__
35
#define __TPOINT_RTREE__
36
37
/* MEOS */
38
#include <
meos.h
>
39
40
#include "temporal/meos_catalog.h"
41
42
/*****************************************************************************
43
* Definitions
44
*****************************************************************************/
45
46
#define MAXITEMS 64
47
#define SEARCH_ARRAY_STARTING_SIZE 64
48
#define MINITEMS_PERCENTAGE 10
49
#define MINITEMS ((MAXITEMS) * (MINITEMS_PERCENTAGE) / 100 + 1)
50
#define RTREE_INNER_NODE_NO true
51
#define RTREE_INNER_NODE false
52
53
/*****************************************************************************
54
* Structs
55
*****************************************************************************/
56
60
typedef
struct
RTreeNode
{
61
bool
kind
;
62
int
count
;
63
union
64
{
65
struct
RTreeNode
*
nodes
[
MAXITEMS
];
66
int64
ids
[
MAXITEMS
];
67
};
68
// TODO: Find a way to include box and span in the definition.
69
STBox
boxes
[
MAXITEMS
];
70
}
RTreeNode
;
71
81
struct
RTree
{
82
meosType
basetype
;
83
int
dims
;
84
RTreeNode
*
root
;
85
STBox
box
;
86
double (*
get_axis
)(
const
STBox
*, int,
bool
);
87
};
88
89
/*****************************************************************************/
90
91
#endif
/* __TPOINT_RTREE__ */
bool
unsigned char bool
Definition:
c.h:405
meosType
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition:
meos_catalog.h:55
meos.h
External API of the Mobility Engine Open Source (MEOS) library.
int64
long int int64
Definition:
postgres_ext_defs.in.h:12
RTreeNode::count
int count
Definition:
tspatial_rtree.h:62
RTreeNode::boxes
STBox boxes[MAXITEMS]
Definition:
tspatial_rtree.h:69
RTreeNode::nodes
struct RTreeNode * nodes[MAXITEMS]
Definition:
tspatial_rtree.h:65
RTreeNode::kind
bool kind
Definition:
tspatial_rtree.h:61
RTreeNode::ids
int64 ids[MAXITEMS]
Definition:
tspatial_rtree.h:66
RTreeNode
Internal representation of an RTree node.
Definition:
tspatial_rtree.h:60
RTree::basetype
meosType basetype
Definition:
tspatial_rtree.h:82
RTree::box
STBox box
Definition:
tspatial_rtree.h:85
RTree::dims
int dims
Definition:
tspatial_rtree.h:83
RTree::get_axis
double(* get_axis)(const STBox *, int, bool)
Definition:
tspatial_rtree.h:86
RTree::root
RTreeNode * root
Definition:
tspatial_rtree.h:84
RTree
Rtree in memory index basic structure.
Definition:
tspatial_rtree.h:81
STBox
Structure to represent spatiotemporal boxes.
Definition:
meos.h:134
MAXITEMS
#define MAXITEMS
In memory index for STBox based on RTree.
Definition:
tspatial_rtree.h:46
Generated by
1.9.5