MobilityDB  1.0
tnpoint_boxops.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * This MobilityDB code is provided under The PostgreSQL License.
4  *
5  * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB
6  * contributors
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose, without fee, and without a written
10  * agreement is hereby granted, provided that the above copyright notice and
11  * this paragraph and the following two paragraphs appear in all copies.
12  *
13  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
15  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
16  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
17  * OF SUCH DAMAGE.
18  *
19  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
22  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
24  *
25  *****************************************************************************/
26 
32 #ifndef __TNPOINT_BOXOPS_H__
33 #define __TNPOINT_BOXOPS_H__
34 
35 #include <postgres.h>
36 #include <catalog/pg_type.h>
37 
38 #include "general/temporal.h"
39 #include "tnpoint.h"
40 
41 /*****************************************************************************/
42 
43 extern Datum npoint_to_stbox(PG_FUNCTION_ARGS);
44 extern Datum npoint_timestamp_to_stbox(PG_FUNCTION_ARGS);
45 extern Datum npoint_period_to_stbox(PG_FUNCTION_ARGS);
46 extern Datum tnpoint_to_stbox(PG_FUNCTION_ARGS);
47 
48 extern bool npoint_to_stbox_internal(STBOX *box, const npoint *np);
49 extern void tnpointinst_make_stbox(STBOX *box, const TInstant *inst);
50 extern void tnpointinstarr_disc_to_stbox(STBOX *box, const TInstant **inst, int count);
51 extern void tnpointinstarr_step_to_stbox(STBOX *box, const TInstant **inst, int count);
52 extern void tnpointinstarr_linear_to_stbox(STBOX *box, const TInstant **inst, int count);
53 extern void tnpointseqarr_to_stbox(STBOX *box, const TSequence **seq, int count);
54 
55 extern Datum overlaps_bbox_npoint_tnpoint(PG_FUNCTION_ARGS);
56 extern Datum overlaps_bbox_tnpoint_npoint(PG_FUNCTION_ARGS);
57 extern Datum contains_bbox_npoint_tnpoint(PG_FUNCTION_ARGS);
58 extern Datum contains_bbox_tnpoint_npoint(PG_FUNCTION_ARGS);
59 extern Datum contained_bbox_npoint_tnpoint(PG_FUNCTION_ARGS);
60 extern Datum contained_bbox_tnpoint_npoint(PG_FUNCTION_ARGS);
61 extern Datum same_bbox_npoint_tnpoint(PG_FUNCTION_ARGS);
62 extern Datum same_bbox_tnpoint_npoint(PG_FUNCTION_ARGS);
63 extern Datum adjacent_bbox_npoint_tnpoint(PG_FUNCTION_ARGS);
64 extern Datum adjacent_bbox_tnpoint_npoint(PG_FUNCTION_ARGS);
65 
66 /*****************************************************************************/
67 
68 #endif /* __TNPOINT_BOXOPS_H__ */
void tnpointinstarr_step_to_stbox(STBOX *box, const TInstant **inst, int count)
Set the spatiotemporal box from the array of temporal network point values.
Definition: tnpoint_boxops.c:99
Structure to represent spatiotemporal boxes.
Definition: stbox.h:51
Datum adjacent_bbox_tnpoint_npoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal network point and the network point are adja...
Definition: tnpoint_boxops.c:732
Datum adjacent_bbox_npoint_tnpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the network point and the temporal network point are adja...
Definition: tnpoint_boxops.c:697
Datum same_bbox_npoint_tnpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the network point and the temporal network point are equa...
Definition: tnpoint_boxops.c:614
Datum contains_bbox_tnpoint_npoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal network point contain the one of the network p...
Definition: tnpoint_boxops.c:483
Basic functions for temporal types of any subtype.
Datum contains_bbox_npoint_tnpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the network point contains the one of the temporal network ...
Definition: tnpoint_boxops.c:448
bool npoint_to_stbox_internal(STBOX *box, const npoint *np)
Set the spatiotemporal box from the network point value.
Definition: tnpoint_boxops.c:67
Datum npoint_to_stbox(PG_FUNCTION_ARGS)
Returns the bounding box of the network point value.
Definition: tnpoint_boxops.c:171
Datum contained_bbox_tnpoint_npoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal network point is contained by the one of the n...
Definition: tnpoint_boxops.c:566
void tnpointseqarr_to_stbox(STBOX *box, const TSequence **seq, int count)
Set the spatiotemporal box from the array of temporal network point values.
Definition: tnpoint_boxops.c:156
Datum overlaps_bbox_npoint_tnpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the network point and the temporal network point overlap...
Definition: tnpoint_boxops.c:365
Datum npoint_period_to_stbox(PG_FUNCTION_ARGS)
Transform a network point and a period to a spatiotemporal box.
Definition: tnpoint_boxops.c:256
Definition: tnpoint.h:45
void tnpointinstarr_linear_to_stbox(STBOX *box, const TInstant **inst, int count)
Set the spatiotemporal box from the array of temporal network point values.
Definition: tnpoint_boxops.c:119
Functions for temporal network points.
void tnpointinstarr_disc_to_stbox(STBOX *box, const TInstant **inst, int count)
Datum overlaps_bbox_tnpoint_npoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal network point and the network point overlap...
Definition: tnpoint_boxops.c:400
void tnpointinst_make_stbox(STBOX *box, const TInstant *inst)
Set the spatiotemporal box from the network point value.
Definition: tnpoint_boxops.c:84
Datum contained_bbox_npoint_tnpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the network point is contained by the one of the temporal n...
Definition: tnpoint_boxops.c:531
Datum tnpoint_to_stbox(PG_FUNCTION_ARGS)
Transform a temporal network point to a spatiotemporal box.
Definition: tnpoint_boxops.c:272
Datum same_bbox_tnpoint_npoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal network point and the network point are equa...
Definition: tnpoint_boxops.c:649
Datum npoint_timestamp_to_stbox(PG_FUNCTION_ARGS)
Transform a network point and a timestamp to a spatiotemporal box.
Definition: tnpoint_boxops.c:227
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253