MobilityDB 1.3
Loading...
Searching...
No Matches
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
60typedef struct RTreeNode{
61 bool kind;
62 int count;
63 union
64 {
67 };
68 // TODO: Find a way to include box and span in the definition.
71
81struct RTree {
83 int dims;
86 double (*get_axis)(const STBox*, int, bool);
87};
88
89/*****************************************************************************/
90
91#endif /* __TPOINT_RTREE__ */
unsigned char bool
Definition: c.h:405
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
External API of the Mobility Engine Open Source (MEOS) library.
long int int64
Definition: postgres_ext_defs.in.h:12
int count
Definition: tspatial_rtree.h:62
STBox boxes[MAXITEMS]
Definition: tspatial_rtree.h:69
struct RTreeNode * nodes[MAXITEMS]
Definition: tspatial_rtree.h:65
bool kind
Definition: tspatial_rtree.h:61
int64 ids[MAXITEMS]
Definition: tspatial_rtree.h:66
Internal representation of an RTree node.
Definition: tspatial_rtree.h:60
meosType basetype
Definition: tspatial_rtree.h:82
STBox box
Definition: tspatial_rtree.h:85
int dims
Definition: tspatial_rtree.h:83
double(* get_axis)(const STBox *, int, bool)
Definition: tspatial_rtree.h:86
RTreeNode * root
Definition: tspatial_rtree.h:84
Rtree in memory index basic structure.
Definition: tspatial_rtree.h:81
Structure to represent spatiotemporal boxes.
Definition: meos.h:134
#define MAXITEMS
In memory index for STBox based on RTree.
Definition: tspatial_rtree.h:46