MobilityDB 1.1
tnpoint_spatialfuncs.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2023, 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-2023, 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 __TNPOINT_SPATIALFUNCS_H__
35#define __TNPOINT_SPATIALFUNCS_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39/* MEOS */
40#include "general/temporal.h"
41#include "npoint/tnpoint_static.h"
42
43/*****************************************************************************/
44
45/* Parameter tests */
46
47extern void ensure_same_srid_tnpoint_stbox(const Temporal *temp,
48 const STBox *box);
49extern void ensure_same_rid_tnpointinst(const TInstant *inst1,
50 const TInstant *inst2);
51
52/* Interpolation functions */
53
54extern bool tnpointsegm_intersection_value(const TInstant *inst1,
55 const TInstant *inst2, Datum value, TimestampTz *t);
56
57/* Functions for spatial reference systems */
58
59extern int tnpointinst_srid(const TInstant *inst);
60extern int tnpoint_srid(const Temporal *temp);
61extern GSERIALIZED *tnpointinst_geom(const TInstant *inst);
62extern GSERIALIZED *tnpointseq_geom(const TSequence *seq);
64extern GSERIALIZED *tnpoint_geom(const Temporal *temp);
65
66extern bool npoint_same(const Npoint *np1, const Npoint *np2);
67
68extern double tnpoint_length(const Temporal *temp);
70extern Temporal *tnpoint_speed(const Temporal *temp);
71extern Datum tnpoint_twcentroid(const Temporal *temp);
72extern Temporal *tnpoint_azimuth(const Temporal *temp);
74 const GSERIALIZED *gs, bool atfunc);
75
76/*****************************************************************************/
77
78#endif /* __TNPOINT_SPATIALFUNCS_H__ */
int64 TimestampTz
Definition: pg_ext_defs.in.h:19
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
Definition: postgis_ext_defs.in.h:139
Functions for temporal network points.
Definition: tnpoint.h:50
Structure to represent spatiotemporal boxes.
Definition: meos.h:107
Structure to represent temporal values of instant subtype.
Definition: meos.h:148
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:186
Structure to represent temporal values of instant set or sequence subtype.
Definition: meos.h:165
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:136
double tnpoint_length(const Temporal *temp)
Length traversed by a temporal network point.
Definition: tnpoint_spatialfuncs.c:399
bool tnpointsegm_intersection_value(const TInstant *inst1, const TInstant *inst2, Datum value, TimestampTz *t)
Return true if a segment of a temporal network point value intersects a base value at the timestamp.
Definition: tnpoint_spatialfuncs.c:92
int tnpoint_srid(const Temporal *temp)
Return the SRID of a temporal network point.
Definition: tnpoint_spatialfuncs.c:146
Temporal * tnpoint_azimuth(const Temporal *temp)
Temporal azimuth of a temporal network point.
Definition: tnpoint_spatialfuncs.c:756
Datum tnpoint_twcentroid(const Temporal *temp)
Return the time-weighed centroid of a temporal network point.
Definition: tnpoint_spatialfuncs.c:589
int tnpointinst_srid(const TInstant *inst)
Return the SRID of a temporal network point of subtype instant.
Definition: tnpoint_spatialfuncs.c:133
void ensure_same_rid_tnpointinst(const TInstant *inst1, const TInstant *inst2)
Ensure that two temporal network point instants have the same route identifier.
Definition: tnpoint_spatialfuncs.c:72
GSERIALIZED * tnpoint_geom(const Temporal *temp)
Return the geometry covered by a temporal network point.
Definition: tnpoint_spatialfuncs.c:291
void ensure_same_srid_tnpoint_stbox(const Temporal *temp, const STBox *box)
Geospatial functions for temporal network points.
Definition: tnpoint_spatialfuncs.c:59
Temporal * tnpoint_speed(const Temporal *temp)
Speed of a temporal network point.
Definition: tnpoint_spatialfuncs.c:568
bool npoint_same(const Npoint *np1, const Npoint *np2)
Determines the spatial equality for network points.
Definition: tnpoint_spatialfuncs.c:340
Temporal * tnpoint_cumulative_length(const Temporal *temp)
Cumulative length traversed by a temporal network point.
Definition: tnpoint_spatialfuncs.c:478
Temporal * tnpoint_restrict_geometry(const Temporal *temp, const GSERIALIZED *gs, bool atfunc)
Restrict a temporal network point to (the complement of) a geometry.
Definition: tnpoint_spatialfuncs.c:777
GSERIALIZED * tnpointinst_geom(const TInstant *inst)
Return the geometry covered by a temporal network point.
Definition: tnpoint_spatialfuncs.c:220
GSERIALIZED * tnpointseq_geom(const TSequence *seq)
Return the geometry covered by a temporal network point.
Definition: tnpoint_spatialfuncs.c:232
GSERIALIZED * tnpointseqset_geom(const TSequenceSet *ts)
Return the geometry covered by a temporal network point.
Definition: tnpoint_spatialfuncs.c:262