MobilityDB  1.0
tpoint_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 __TPOINT_BOXOPS_H__
33 #define __TPOINT_BOXOPS_H__
34 
35 #include <postgres.h>
36 #include <catalog/pg_type.h>
37 #include <liblwgeom.h>
38 
39 #include "general/temporal.h"
40 #include "general/temporal_util.h"
41 #include "stbox.h"
42 
43 /*****************************************************************************/
44 
45 /* Functions computing the bounding box at the creation of the temporal point */
46 
47 extern void tpointinst_make_stbox(STBOX *box, const TInstant *inst);
48 extern void tpointinstarr_to_stbox(STBOX *box, const TInstant **inst, int count);
49 extern void tpointseqarr_to_stbox(STBOX *box, const TSequence **seq, int count);
50 
51 /* Boxes functions */
52 
53 extern Datum tpoint_stboxes(PG_FUNCTION_ARGS);
54 
55 extern ArrayType *tpointseq_stboxes(const TSequence *seq);
56 extern ArrayType *tpointseqset_stboxes(const TSequenceSet *ts);
57 
58 /* Generic box functions */
59 
60 extern Datum boxop_geo_tpoint(FunctionCallInfo fcinfo,
61  bool (*func)(const STBOX *, const STBOX *));
62 extern Datum boxop_tpoint_geo(FunctionCallInfo fcinfo,
63  bool (*func)(const STBOX *, const STBOX *));
64 extern Datum boxop_stbox_tpoint(FunctionCallInfo fcinfo,
65  bool (*func)(const STBOX *, const STBOX *));
66 extern Datum boxop_tpoint_stbox(FunctionCallInfo fcinfo,
67  bool (*func)(const STBOX *, const STBOX *));
68 extern Datum boxop_tpoint_tpoint(FunctionCallInfo fcinfo,
69  bool (*func)(const STBOX *, const STBOX *));
70 
71 /*****************************************************************************/
72 
73 extern Datum overlaps_bbox_geo_tpoint(PG_FUNCTION_ARGS);
74 extern Datum overlaps_bbox_stbox_tpoint(PG_FUNCTION_ARGS);
75 extern Datum overlaps_bbox_tpoint_geo(PG_FUNCTION_ARGS);
76 extern Datum overlaps_bbox_tpoint_stbox(PG_FUNCTION_ARGS);
77 extern Datum overlaps_bbox_tpoint_tpoint(PG_FUNCTION_ARGS);
78 
79 extern Datum contains_bbox_geo_tpoint(PG_FUNCTION_ARGS);
80 extern Datum contains_bbox_stbox_tpoint(PG_FUNCTION_ARGS);
81 extern Datum contains_bbox_tpoint_geo(PG_FUNCTION_ARGS);
82 extern Datum contains_bbox_tpoint_stbox(PG_FUNCTION_ARGS);
83 extern Datum contains_bbox_tpoint_tpoint(PG_FUNCTION_ARGS);
84 
85 extern Datum contained_bbox_geo_tpoint(PG_FUNCTION_ARGS);
86 extern Datum contained_bbox_stbox_tpoint(PG_FUNCTION_ARGS);
87 extern Datum contained_bbox_tpoint_geo(PG_FUNCTION_ARGS);
88 extern Datum contained_bbox_tpoint_stbox(PG_FUNCTION_ARGS);
89 extern Datum contained_bbox_tpoint_tpoint(PG_FUNCTION_ARGS);
90 
91 extern Datum same_bbox_geo_tpoint(PG_FUNCTION_ARGS);
92 extern Datum same_bbox_stbox_tpoint(PG_FUNCTION_ARGS);
93 extern Datum same_bbox_tpoint_geo(PG_FUNCTION_ARGS);
94 extern Datum same_bbox_tpoint_stbox(PG_FUNCTION_ARGS);
95 extern Datum same_bbox_tpoint_tpoint(PG_FUNCTION_ARGS);
96 
97 extern Datum adjacent_bbox_geo_tpoint(PG_FUNCTION_ARGS);
98 extern Datum adjacent_bbox_stbox_tpoint(PG_FUNCTION_ARGS);
99 extern Datum adjacent_bbox_tpoint_geo(PG_FUNCTION_ARGS);
100 extern Datum adjacent_bbox_tpoint_stbox(PG_FUNCTION_ARGS);
101 extern Datum adjacent_bbox_tpoint_tpoint(PG_FUNCTION_ARGS);
102 
103 /*****************************************************************************/
104 
105 #endif
Datum adjacent_bbox_tpoint_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal points are adjacent.
Definition: tpoint_boxops.c:628
Datum tpoint_stboxes(PG_FUNCTION_ARGS)
Returns an array of spatiotemporal boxes from the temporal point.
Definition: tpoint_boxops.c:208
Datum contained_bbox_geo_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the geometry/geography is contained in the spatiotemporal b...
Definition: tpoint_boxops.c:467
Datum adjacent_bbox_stbox_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box and the spatiotemporal box of the temporal point are adjacent...
Definition: tpoint_boxops.c:596
void tpointinst_make_stbox(STBOX *box, const TInstant *inst)
Set the spatiotemporal box from the temporal point value.
Definition: tpoint_boxops.c:69
Datum boxop_stbox_tpoint(FunctionCallInfo fcinfo, bool(*func)(const STBOX *, const STBOX *))
Generic topological function for a spatiotemporal box and a temporal point.
Definition: tpoint_boxops.c:286
Datum contains_bbox_geo_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the geometry/geography contains the spatiotemporal box of t...
Definition: tpoint_boxops.c:408
Datum adjacent_bbox_tpoint_stbox(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal point and the spatiotemporal box are adjacent...
Definition: tpoint_boxops.c:618
Datum contains_bbox_tpoint_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the first temporal point contains the one of the second tem...
Definition: tpoint_boxops.c:452
ArrayType * tpointseq_stboxes(const TSequence *seq)
Returns an array of spatiotemporal boxes from the segments of the temporal sequence point value...
Definition: tpoint_boxops.c:168
Structure to represent spatiotemporal boxes.
Definition: stbox.h:51
Datum same_bbox_geo_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the geometry/geography and the temporal point are equal i...
Definition: tpoint_boxops.c:526
ArrayType * tpointseqset_stboxes(const TSequenceSet *ts)
Returns an array of spatiotemporal boxes from the segments of the temporal sequence set point value...
Definition: tpoint_boxops.c:188
Datum overlaps_bbox_tpoint_stbox(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal point and the spatiotemporal box overlap...
Definition: tpoint_boxops.c:383
Datum contains_bbox_stbox_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box contains the spatiotemporal box of the temporal point...
Definition: tpoint_boxops.c:419
Datum contains_bbox_tpoint_stbox(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal point contains the spatiotemporal box...
Definition: tpoint_boxops.c:441
Datum contains_bbox_tpoint_geo(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal point contains the one of the geometry/geograp...
Definition: tpoint_boxops.c:430
Datum same_bbox_stbox_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box and the spatiotemporal box of the temporal point are equal in ...
Definition: tpoint_boxops.c:537
Datum adjacent_bbox_geo_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the geometry/geography and the temporal point are adjacen...
Definition: tpoint_boxops.c:585
Basic functions for temporal types of any subtype.
Datum same_bbox_tpoint_stbox(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal point and the spatiotemporal box are equal in ...
Definition: tpoint_boxops.c:559
Datum contained_bbox_tpoint_geo(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal point is contained in the one of the geometry/...
Definition: tpoint_boxops.c:489
Datum overlaps_bbox_stbox_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box and the spatiotemporal box of the temporal point overlap...
Definition: tpoint_boxops.c:363
Datum boxop_tpoint_tpoint(FunctionCallInfo fcinfo, bool(*func)(const STBOX *, const STBOX *))
Generic topological function for two temporal points.
Definition: tpoint_boxops.c:326
Datum overlaps_bbox_tpoint_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal points overlap.
Definition: tpoint_boxops.c:393
Datum same_bbox_tpoint_geo(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal point and geometry/geography are equal in th...
Definition: tpoint_boxops.c:548
void tpointseqarr_to_stbox(STBOX *box, const TSequence **seq, int count)
Set the spatiotemporal box from the array of temporal point values.
Definition: tpoint_boxops.c:108
Datum adjacent_bbox_tpoint_geo(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal point and geometry/geography are adjacent...
Definition: tpoint_boxops.c:607
Structure to represent temporal values of sequence set subtype.
Definition: temporal.h:293
Datum boxop_tpoint_geo(FunctionCallInfo fcinfo, bool(*func)(const STBOX *, const STBOX *))
Generic topological function for a temporal point and a geometry.
Definition: tpoint_boxops.c:261
Datum contained_bbox_tpoint_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the first temporal point is contained in the one of the sec...
Definition: tpoint_boxops.c:511
Datum contained_bbox_stbox_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box is contained in the spatiotemporal box of the temporal point...
Definition: tpoint_boxops.c:478
Datum boxop_tpoint_stbox(FunctionCallInfo fcinfo, bool(*func)(const STBOX *, const STBOX *))
Generic topological function for a temporal point and a spatiotemporal box.
Definition: tpoint_boxops.c:306
Datum boxop_geo_tpoint(FunctionCallInfo fcinfo, bool(*func)(const STBOX *, const STBOX *))
Generic box function for a geometry and a temporal point.
Definition: tpoint_boxops.c:236
Datum overlaps_bbox_tpoint_geo(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal point and the geometry/geography overlap...
Definition: tpoint_boxops.c:373
Functions for spatiotemporal bounding boxes.
Datum overlaps_bbox_geo_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the geometry/geography and the temporal point overlap...
Definition: tpoint_boxops.c:352
void tpointinstarr_to_stbox(STBOX *box, const TInstant **inst, int count)
Set the spatiotemporal box from the array of temporal point values.
Definition: tpoint_boxops.c:88
Datum contained_bbox_tpoint_stbox(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal box of the temporal point is contained in the spatiotemporal box...
Definition: tpoint_boxops.c:500
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
Datum same_bbox_tpoint_tpoint(PG_FUNCTION_ARGS)
Returns true if the spatiotemporal boxes of the temporal points are equal in the common dimensions...
Definition: tpoint_boxops.c:570
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253