MobilityDB  1.0
tnpoint_spatialfuncs.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_SPATIALFUNCS_H__
33 #define __TNPOINT_SPATIALFUNCS_H__
34 
35 #include <postgres.h>
36 #include <catalog/pg_type.h>
37 
38 #include "general/temporal.h"
39 #include "tnpoint_static.h"
40 
41 /*****************************************************************************/
42 
43 /* Parameter tests */
44 
45 extern void ensure_same_srid_tnpoint_stbox(const Temporal *temp,
46  const STBOX *box);
47 extern void ensure_same_rid_tnpointinst(const TInstant *inst1,
48  const TInstant *inst2);
49 
50 /* Interpolation functions */
51 
52 extern bool tnpointseq_intersection_value(const TInstant *inst1,
53  const TInstant *inst2, Datum value, TimestampTz *t);
54 
55 /* Functions for spatial reference systems */
56 
57 extern int tnpoint_srid_internal(const Temporal *temp);
58 
59 extern Datum tnpoint_trajectory(PG_FUNCTION_ARGS);
60 
61 extern Datum tnpointseq_trajectory1(const TInstant *inst1, const TInstant *inst2);
62 extern Datum tnpointseq_trajectory(const TSequence *seq);
63 extern Datum tnpointseqset_trajectory(const TSequenceSet *ts);
64 
65 extern Datum tnpointinst_geom(const TInstant *inst);
66 extern Datum tnpointinstset_geom(const TInstantSet *ti);
67 extern Datum tnpointseq_geom(const TSequence *seq);
68 extern Datum tnpointseqset_geom(const TSequenceSet *ts);
69 extern Datum tnpoint_geom(const Temporal *temp);
70 
71 extern Datum tnpoint_length(PG_FUNCTION_ARGS);
72 extern Datum tnpoint_cumulative_length(PG_FUNCTION_ARGS);
73 extern Datum tnpoint_speed(PG_FUNCTION_ARGS);
74 extern Datum tnpoint_twcentroid(PG_FUNCTION_ARGS);
75 extern Datum tnpoint_azimuth(PG_FUNCTION_ARGS);
76 extern Datum tnpoint_at_geometry(PG_FUNCTION_ARGS);
77 extern Datum tnpoint_minus_geometry(PG_FUNCTION_ARGS);
78 
79 /*****************************************************************************/
80 
81 #endif /* __TNPOINT_SPATIALFUNCS_H__ */
Datum tnpointseq_trajectory(const TSequence *seq)
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: temporal.h:241
Structure to represent spatiotemporal boxes.
Definition: stbox.h:51
Datum tnpointinstset_geom(const TInstantSet *ti)
Return the geometry covered by the temporal network point.
Definition: tnpoint_spatialfuncs.c:273
Datum tnpointseq_geom(const TSequence *seq)
Return the geometry covered by the temporal network point.
Definition: tnpoint_spatialfuncs.c:293
Datum tnpoint_trajectory(PG_FUNCTION_ARGS)
Return the geometry covered by the temporal network point.
Definition: tnpoint_spatialfuncs.c:408
Basic functions for temporal types of any subtype.
Datum tnpointseqset_geom(const TSequenceSet *ts)
Return the geometry covered by the temporal network point.
Definition: tnpoint_spatialfuncs.c:323
Datum tnpoint_geom(const Temporal *temp)
Return the geometry covered by the temporal network point (dispatch function)
Definition: tnpoint_spatialfuncs.c:353
Structure to represent temporal values of sequence set subtype.
Definition: temporal.h:293
int tnpoint_srid_internal(const Temporal *temp)
Returns the SRID of a temporal network point (dispatch function)
Definition: tnpoint_spatialfuncs.c:150
void ensure_same_rid_tnpointinst(const TInstant *inst1, const TInstant *inst2)
Ensure that the temporal network point instants have the same route identifier.
Definition: tnpoint_spatialfuncs.c:74
Structure to represent temporal values of instant set subtype.
Definition: temporal.h:266
void ensure_same_srid_tnpoint_stbox(const Temporal *temp, const STBOX *box)
Ensure that the temporal network point and the STBOX have the same SRID.
Definition: tnpoint_spatialfuncs.c:62
Datum tnpoint_at_geometry(PG_FUNCTION_ARGS)
Restricts the temporal point to the geometry.
Definition: tnpoint_spatialfuncs.c:1013
Datum tnpoint_cumulative_length(PG_FUNCTION_ARGS)
Cumulative length traversed by the temporal npoint.
Definition: tnpoint_spatialfuncs.c:632
Datum tnpointinst_geom(const TInstant *inst)
Return the geometry covered by the temporal network point.
Definition: tnpoint_spatialfuncs.c:261
Datum tnpoint_length(PG_FUNCTION_ARGS)
Length traversed by the temporal network point.
Definition: tnpoint_spatialfuncs.c:498
Datum tnpointseq_trajectory1(const TInstant *inst1, const TInstant *inst2)
Compute the trajectory of two instants.
Definition: tnpoint_spatialfuncs.c:374
bool tnpointseq_intersection_value(const TInstant *inst1, const TInstant *inst2, Datum value, TimestampTz *t)
Returns true if the segment of the temporal network point value intersects the base value at the time...
Definition: tnpoint_spatialfuncs.c:95
Datum tnpoint_twcentroid(PG_FUNCTION_ARGS)
Time-weighed centroid of the temporal network point.
Definition: tnpoint_spatialfuncs.c:760
Datum tnpointseqset_trajectory(const TSequenceSet *ts)
Datum tnpoint_azimuth(PG_FUNCTION_ARGS)
Temporal azimuth of the temporal network point.
Definition: tnpoint_spatialfuncs.c:944
Datum tnpoint_minus_geometry(PG_FUNCTION_ARGS)
Restrict the temporal point to the complement of the geometry.
Definition: tnpoint_spatialfuncs.c:1023
Datum tnpoint_speed(PG_FUNCTION_ARGS)
Speed of the temporal network point.
Definition: tnpoint_spatialfuncs.c:732
Network-based static point/segments.
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253