MobilityDB 1.3
Loading...
Searching...
No Matches
temporal_boxops.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 __TEMPORAL_BOXOPS_H__
35#define __TEMPORAL_BOXOPS_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39/* MEOS */
40#include <meos.h>
41#include "temporal/meos_catalog.h"
42
43/*****************************************************************************/
44
50#define TEMPORAL_MAX_HEADER_SIZE \
51 DOUBLE_PAD(Max(Max(sizeof(TInstant), sizeof(TSequence)), \
52 sizeof(TSequenceSet))) + DOUBLE_PAD(sizeof(bboxunion))
53
54/*****************************************************************************/
55
56/* Compute the bounding box at the creation of temporal values */
57
58extern size_t temporal_bbox_size(meosType tempype);
59extern void tinstant_set_bbox(const TInstant *inst, void *bbox);
60extern void tinstarr_set_bbox(const TInstant **instants, int count,
61 bool lower_inc, bool upper_inc, interpType interp, void *bbox);
62extern void tsequence_compute_bbox(TSequence *seq);
63extern void tseqarr_compute_bbox(const TSequence **seqs, int count,
64 void *bbox);
66
67/* Bounding box operators for temporal types */
68
69extern bool boxop_temporal_tstzspan(const Temporal *temp, const Span *s,
70 bool (*func)(const Span *, const Span *), bool invert);
71extern bool boxop_temporal_temporal(const Temporal *temp1,
72 const Temporal *temp2, bool (*func)(const Span *, const Span *));
73
74extern bool boxop_tnumber_numspan(const Temporal *temp, const Span *span,
75 bool (*func)(const Span *, const Span *), bool invert);
76extern bool boxop_tnumber_tbox(const Temporal *temp, const TBox *box,
77 bool (*func)(const TBox *, const TBox *), bool invert);
78extern bool boxop_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2,
79 bool (*func)(const TBox *, const TBox *));
80
81/*****************************************************************************/
82
83#endif /* __TEMPORAL_BOXOPS_H__ */
void tinstant_set_bbox(const TInstant *inst, void *bbox)
Return in the last argument the bounding box of a temporal instant.
Definition: temporal_boxops.c:202
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
bool boxop_tnumber_numspan(const Temporal *temp, const Span *span, bool(*func)(const Span *, const Span *), bool invert)
Generic bounding box function for a temporal number and a span.
Definition: temporal_boxops.c:1735
bool boxop_temporal_tstzspan(const Temporal *temp, const Span *s, bool(*func)(const Span *, const Span *), bool invert)
Generic bounding box function for a temporal value and a timestamptz span.
Definition: temporal_boxops.c:1703
bool boxop_tnumber_tbox(const Temporal *temp, const TBox *box, bool(*func)(const TBox *, const TBox *), bool invert)
Generic bounding box function for a temporal number and a temporal box.
Definition: temporal_boxops.c:1749
void tsequenceset_compute_bbox(TSequenceSet *ss)
(Re)compute the bounding box of a temporal sequence set
Definition: temporal_boxops.c:547
void tsequence_compute_bbox(TSequence *seq)
Recompute the bounding box of a temporal sequence.
Definition: temporal_boxops.c:529
void tinstarr_set_bbox(const TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, void *bbox)
Set a bounding box from an array of temporal instant values.
Definition: temporal_boxops.c:378
size_t temporal_bbox_size(meosType tempype)
Return the size of a bounding box of a temporal type.
Definition: temporal_boxops.c:158
bool boxop_tnumber_tnumber(const Temporal *temp1, const Temporal *temp2, bool(*func)(const TBox *, const TBox *))
Generic bounding box function for two temporal numbers.
Definition: temporal_boxops.c:1762
void tseqarr_compute_bbox(const TSequence **seqs, int count, void *bbox)
Return in the last argument a bounding box constructed from an array of temporal sequences.
Definition: temporal_boxops.c:506
bool boxop_temporal_temporal(const Temporal *temp1, const Temporal *temp2, bool(*func)(const Span *, const Span *))
Generic bounding box function for two temporal values.
Definition: temporal_boxops.c:1717
interpType
Enumeration that defines the interpolation types used in MEOS.
Definition: meos.h:161
External API of the Mobility Engine Open Source (MEOS) library.
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal boxes.
Definition: meos.h:124
Structure to represent temporal values of instant subtype.
Definition: meos.h:185
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:224
Structure to represent temporal values of sequence subtype.
Definition: meos.h:202
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:173