MobilityDB  1.0
tpoint_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 __TPOINT_SPATIALFUNCS_H__
33 #define __TPOINT_SPATIALFUNCS_H__
34 
35 #include <postgres.h>
36 #include <liblwgeom.h>
37 
38 #include "general/temporal.h"
39 #include "tpoint.h"
40 
41 /*****************************************************************************/
42 
43 /* Fetch from and store in the cache the fcinfo of the external function */
44 
45 extern FunctionCallInfo fetch_fcinfo();
46 extern void store_fcinfo(FunctionCallInfo fcinfo);
47 
48 /* Functions derived from PostGIS to increase floating-point precision */
49 
50 extern long double closest_point2d_on_segment_ratio(const POINT2D *p,
51  const POINT2D *A, const POINT2D *B, POINT2D *closest);
52 extern long double closest_point3dz_on_segment_ratio(const POINT3DZ *p,
53  const POINT3DZ *A, const POINT3DZ *B, POINT3DZ *closest);
54 extern long double closest_point_on_segment_sphere(const POINT4D *p,
55  const POINT4D *A, const POINT4D *B, POINT4D *closest, double *dist);
56 extern void interpolate_point4d_sphere(const POINT3D *p1, const POINT3D *p2,
57  const POINT4D *v1, const POINT4D *v2, double f, POINT4D *p);
58 
59 /* Parameter tests */
60 
61 extern void ensure_spatial_validity(const Temporal *temp1, const Temporal *temp2);
62 extern void ensure_not_geodetic_gs(const GSERIALIZED *gs);
63 extern void ensure_not_geodetic(int16 flags);
64 extern void ensure_same_geodetic(int16 flags1, int16 flags2);
65 extern void ensure_same_geodetic_gs(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
66 extern void ensure_same_srid(int32_t srid1, int32_t srid2);
67 extern void ensure_same_srid_stbox(const STBOX *box1, const STBOX *box2);
68 extern void ensure_same_srid_tpoint_stbox(const Temporal *temp, const STBOX *box);
69 extern void ensure_same_srid_stbox_gs(const STBOX *box, const GSERIALIZED *gs);
70 extern void ensure_same_dimensionality(int16 flags1, int16 flags2);
71 extern void ensure_same_spatial_dimensionality(int16 flags1, int16 flags2);
72 extern void ensure_same_dimensionality_gs(const GSERIALIZED *gs1,
73  const GSERIALIZED *gs2);
75  const GSERIALIZED *gs);
76 extern void ensure_same_dimensionality_tpoint_gs(const Temporal *temp,
77  const GSERIALIZED *gs);
78 extern void ensure_has_Z(int16 flags);
79 extern void ensure_has_not_Z(int16 flags);
80 extern void ensure_has_Z_gs(const GSERIALIZED *gs);
81 extern void ensure_has_not_Z_gs(const GSERIALIZED *gs);
82 extern void ensure_has_M_gs(const GSERIALIZED *gs);
83 extern void ensure_has_not_M_gs(const GSERIALIZED *gs);
84 extern void ensure_point_type(const GSERIALIZED *gs);
85 extern void ensure_non_empty(const GSERIALIZED *gs);
86 
87 /* Utility functions */
88 
89 extern const POINT2D *gs_get_point2d_p(GSERIALIZED *gs);
90 extern const POINT3DZ *gs_get_point3dz_p(GSERIALIZED *gs);
91 extern POINT2D datum_get_point2d(Datum value);
92 extern const POINT2D *datum_get_point2d_p(Datum value);
93 extern POINT3DZ datum_get_point3dz(Datum value);
94 extern const POINT3DZ *datum_get_point3dz_p(Datum value);
95 extern void datum_get_point4d(POINT4D *p, Datum value);
96 extern Datum point_make(double x, double y, double z, bool hasz,
97  bool geodetic, int32 srid);
98 extern bool datum_point_eq(Datum geopoint1, Datum geopoint2);
99 extern GSERIALIZED *geo_serialize(LWGEOM *geom);
100 extern Datum datum_transform(Datum value, Datum srid);
101 
102 extern datum_func2 get_distance_fn(int16 flags);
103 extern datum_func2 get_pt_distance_fn(int16 flags);
104 extern Datum geom_distance2d(Datum geom1, Datum geom2);
105 extern Datum geom_distance3d(Datum geom1, Datum geom2);
106 extern Datum geog_distance(Datum geog1, Datum geog2);
107 extern Datum pt_distance2d(Datum geom1, Datum geom2);
108 extern Datum pt_distance3d(Datum geom1, Datum geom2);
109 
110 extern Datum geoseg_interpolate_point(Datum value1, Datum value2,
111  long double ratio);
112 extern long double geoseg_locate_point(Datum start, Datum end, Datum point,
113  double *dist);
114 
115 extern bool tpointseq_intersection_value(const TInstant *inst1,
116  const TInstant *inst2, Datum value, TimestampTz *t);
117 extern bool tgeompointseq_intersection(const TInstant *start1, const TInstant *end1,
118  const TInstant *start2, const TInstant *end2, TimestampTz *t);
119 extern bool tgeogpointseq_intersection(const TInstant *start1, const TInstant *end1,
120  const TInstant *start2, const TInstant *end2, TimestampTz *t);
121 
122 extern bool geopoint_collinear(Datum value1, Datum value2, Datum value3,
123  double ratio, bool hasz, bool geodetic);
124 
125 extern void spheroid_init(SPHEROID *s, double a, double b);
126 extern void geography_interpolate_point4d(const POINT3D *p1, const POINT3D *p2,
127  const POINT4D *v1, const POINT4D *v2, double f, POINT4D *p);
128 
129 /* Functions for spatial reference systems */
130 
131 extern Datum tpoint_srid(PG_FUNCTION_ARGS);
132 extern Datum tpoint_set_srid(PG_FUNCTION_ARGS);
133 
134 extern Temporal *tpoint_set_srid_internal(Temporal *temp, int32 srid) ;
135 extern int tpointinst_srid(const TInstant *inst);
136 extern int tpointinstset_srid(const TInstantSet *ti);
137 extern int tpointseq_srid(const TSequence *seq);
138 extern int tpointseqset_srid(const TSequenceSet *ts);
139 extern int tpoint_srid_internal(const Temporal *t);
140 extern TInstant *tpointinst_transform(const TInstant *inst, Datum srid);
141 
142 /* Cast functions */
143 
144 extern Datum tgeompoint_to_tgeogpoint(PG_FUNCTION_ARGS);
145 extern Datum tgeogpoint_to_tgeompoint(PG_FUNCTION_ARGS);
146 
150 
151 /* Trajectory functions */
152 
153 extern Datum tpoint_trajectory(PG_FUNCTION_ARGS);
154 
155 extern LWGEOM *lwpointarr_make_trajectory(LWGEOM **lwpoints, int count, bool linear);
156 extern Datum tpointinstset_trajectory(const TInstantSet *ti);
157 extern Datum tpoint_trajectory_internal(const Temporal *temp);
158 extern void tpoint_trajectory_free(const Temporal *temp, Datum traj);
159 extern Datum tpoint_trajectory_external(const Temporal *temp);
160 extern Datum tpointseq_make_trajectory(const TInstant **instants, int count, bool linear);
161 
162 extern Datum geopoint_line(Datum value1, Datum value2);
163 extern LWLINE *geopoint_lwline(Datum value1, Datum value2);
164 
165 extern Datum tpointseq_trajectory(const TSequence *seq);
166 extern Datum tpointseq_trajectory_copy(const TSequence *seq);
167 extern Datum tpointseqset_trajectory(const TSequenceSet *ts);
168 
169 /* Set precision of the coordinates */
170 
171 extern Datum geo_set_precision(PG_FUNCTION_ARGS);
172 extern Datum tpoint_set_precision(PG_FUNCTION_ARGS);
173 
174 /* Functions for extracting coordinates */
175 
176 extern Datum tpoint_get_x(PG_FUNCTION_ARGS);
177 extern Datum tpoint_get_y(PG_FUNCTION_ARGS);
178 extern Datum tpoint_get_z(PG_FUNCTION_ARGS);
179 
180 extern Temporal *tpoint_get_coord_internal(const Temporal *temp, char c);
181 
182 /* Length, speed, time-weighted centroid, temporal azimuth, and
183  * temporal bearing functions */
184 
185 extern Datum tpoint_length(PG_FUNCTION_ARGS);
186 extern Datum tpoint_cumulative_length(PG_FUNCTION_ARGS);
187 extern Datum tpoint_speed(PG_FUNCTION_ARGS);
188 extern Datum tgeompoint_twcentroid(PG_FUNCTION_ARGS);
189 extern Datum tpoint_azimuth(PG_FUNCTION_ARGS);
190 
191 extern Datum tpointinstset_twcentroid(const TInstantSet *ti);
192 extern Datum tpointseq_twcentroid(const TSequence *seq);
193 extern Datum tpointseqset_twcentroid(const TSequenceSet *ts);
194 extern Datum tpoint_twcentroid_internal(Temporal *temp);
195 
196 extern Datum geom_bearing(Datum point1, Datum point2);
197 extern Datum geog_bearing(Datum point1, Datum point2);
198 extern bool tgeompointseq_min_bearing_at_timestamp(const TInstant *start1,
199  const TInstant *end1, const TInstant *start2, const TInstant *end2,
200  TimestampTz *t);
201 
202 /* Restriction functions */
203 
204 extern Datum tpoint_at_geometry(PG_FUNCTION_ARGS);
205 extern Datum tpoint_at_stbox(PG_FUNCTION_ARGS);
206 
207 extern Datum tpoint_minus_geometry(PG_FUNCTION_ARGS);
208 extern Datum tpoint_minus_stbox(PG_FUNCTION_ARGS);
209 
210 extern TSequence **tpointseq_at_geometry(const TSequence *seq, Datum geo,
211  int *count);
213  Datum geom, bool atfunc);
214 extern Temporal *tpoint_at_stbox_internal(const Temporal *temp,
215  const STBOX *box, bool exc_upper);
216 
218  int *count);
219 extern TSequence **tpointseq_make_simple1(const TSequence *seq, int *count);
220 extern Period **tpointseq_interperiods(const TSequence *seq,
221  GSERIALIZED *gsinter, int *count);
222 
223 /*****************************************************************************/
224 
225 #endif
void ensure_has_Z_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has not Z dimension.
Definition: tpoint_spatialfuncs.c:589
TSequence * tgeogpointseq_to_tgeompointseq(const TSequence *seq)
void ensure_same_srid_stbox(const STBOX *box1, const STBOX *box2)
Ensure that the spatiotemporal boxes have the same SRID.
Definition: tpoint_spatialfuncs.c:451
Structure to represent periods.
Definition: timetypes.h:52
void ensure_same_spatial_dimensionality(int16 flags1, int16 flags2)
Ensure that the temporal values have the same spatial dimensionality.
Definition: tpoint_spatialfuncs.c:503
void ensure_has_not_M_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has not M dimension.
Definition: tpoint_spatialfuncs.c:637
Datum datum_transform(Datum value, Datum srid)
Call the PostGIS transform function.
Definition: tpoint_spatialfuncs.c:263
Datum point_make(double x, double y, double z, bool hasz, bool geodetic, int32 srid)
Create a point.
Definition: tpoint_spatialfuncs.c:861
bool geopoint_collinear(Datum value1, Datum value2, Datum value3, double ratio, bool hasz, bool geodetic)
Returns true if the three values are collinear.
Definition: tpoint_spatialfuncs.c:1221
void spheroid_init(SPHEROID *s, double a, double b)
Definition: geography_functions.c:848
Datum tpoint_azimuth(PG_FUNCTION_ARGS)
Returns the temporal azimuth of the temporal geometry point.
Definition: tpoint_spatialfuncs.c:3306
Temporal * tpoint_get_coord_internal(const Temporal *temp, char c)
Get the X coordinates of the temporal point (internal function)
Definition: tpoint_spatialfuncs.c:2638
Datum tpoint_trajectory_external(const Temporal *temp)
Returns the trajectory of a temporal point (dispatch function)
Definition: tpoint_spatialfuncs.c:1526
Datum tpoint_trajectory(PG_FUNCTION_ARGS)
Returns the trajectory of a temporal point.
Definition: tpoint_spatialfuncs.c:1546
void ensure_same_spatial_dimensionality_stbox_gs(const STBOX *box1, const GSERIALIZED *gs)
Ensure that the spatiotemporal boxes have the same spatial dimensionality.
Definition: tpoint_spatialfuncs.c:548
int tpointinstset_srid(const TInstantSet *ti)
Returns the SRID of a temporal instant set point.
Definition: tpoint_spatialfuncs.c:1599
void ensure_same_srid_stbox_gs(const STBOX *box, const GSERIALIZED *gs)
Ensure that the temporal point and the geometry/geography have the same SRID.
Definition: tpoint_spatialfuncs.c:477
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: temporal.h:241
Datum tpointseq_make_trajectory(const TInstant **instants, int count, bool linear)
Compute the trajectory of an array of instants.
Definition: tpoint_spatialfuncs.c:1358
int tpointseqset_srid(const TSequenceSet *ts)
Returns the SRID of a temporal sequence set point.
Definition: tpoint_spatialfuncs.c:1619
Datum tpoint_minus_geometry(PG_FUNCTION_ARGS)
Restrict the temporal point to the complement of the geometry.
Definition: tpoint_spatialfuncs.c:5065
int tpointseq_srid(const TSequence *seq)
Returns the SRID of a temporal sequence point.
Definition: tpoint_spatialfuncs.c:1609
datum_func2 get_pt_distance_fn(int16 flags)
Select the appropriate distance function.
Definition: tpoint_spatialfuncs.c:292
TInstant * tpointinst_transform(const TInstant *inst, Datum srid)
Transform a temporal instant point into another spatial reference system.
Definition: tpoint_spatialfuncs.c:1837
void ensure_same_geodetic(int16 flags1, int16 flags2)
Ensure that the spatiotemporal argument have the same type of coordinates, either planar or geodetic...
Definition: tpoint_spatialfuncs.c:411
Datum tpointseq_twcentroid(const TSequence *seq)
Returns the time-weighed centroid of the temporal geometry point of sequence type.
Definition: tpoint_spatialfuncs.c:3040
void datum_get_point4d(POINT4D *p, Datum value)
Returns a 4D point from the datum.
Definition: tpoint_spatialfuncs.c:183
Structure to represent spatiotemporal boxes.
Definition: stbox.h:51
Datum tgeogpoint_to_tgeompoint(PG_FUNCTION_ARGS)
Converts a temporal geography point to a temporal geometry point.
Definition: tpoint_spatialfuncs.c:2194
void store_fcinfo(FunctionCallInfo fcinfo)
Store in the cache the fcinfo of the external function.
Definition: tpoint_spatialfuncs.c:92
GSERIALIZED * geo_serialize(LWGEOM *geom)
Serialize a geometry/geography.
Definition: tpoint_spatialfuncs.c:250
Datum tpointseqset_trajectory(const TSequenceSet *ts)
Returns the trajectory of a temporal point with sequence set type from the precomputed trajectories o...
Definition: tpoint_spatialfuncs.c:1419
Datum tpoint_set_srid(PG_FUNCTION_ARGS)
Set the SRID of a temporal point.
Definition: tpoint_spatialfuncs.c:1773
void ensure_has_Z(int16 flags)
Ensure that the temporal value has Z dimension.
Definition: tpoint_spatialfuncs.c:565
Datum tgeompoint_twcentroid(PG_FUNCTION_ARGS)
void ensure_has_M_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has M dimension.
Definition: tpoint_spatialfuncs.c:621
long double closest_point_on_segment_sphere(const POINT4D *p, const POINT4D *A, const POINT4D *B, POINT4D *closest, double *dist)
Returns a float between 0 and 1 representing the location of the closest point on the geography segme...
Definition: tpoint_spatialfuncs.c:816
void ensure_same_dimensionality_tpoint_gs(const Temporal *temp, const GSERIALIZED *gs)
Ensure that the temporal point and the geometry/geography have the same dimensionality.
Definition: tpoint_spatialfuncs.c:532
bool tgeompointseq_min_bearing_at_timestamp(const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
POINT2D datum_get_point2d(Datum value)
Returns a 2D point from the datum.
Definition: tpoint_spatialfuncs.c:122
int tpoint_srid_internal(const Temporal *t)
Returns the SRID of a temporal point (dispatch function)
Definition: tpoint_spatialfuncs.c:1629
const POINT2D * gs_get_point2d_p(GSERIALIZED *gs)
Returns a 2D point from the serialized geometry.
Definition: tpoint_spatialfuncs.c:143
Functions for temporal points.
FunctionCallInfo fetch_fcinfo()
Fetch from the cache the fcinfo of the external function.
Definition: tpoint_spatialfuncs.c:82
Datum geog_distance(Datum geog1, Datum geog2)
Returns the distance between the two geographies.
Definition: tpoint_spatialfuncs.c:333
Basic functions for temporal types of any subtype.
Datum tpoint_at_stbox(PG_FUNCTION_ARGS)
Restricts the temporal value to the spatiotemporal box.
Definition: tpoint_spatialfuncs.c:5308
POINT3DZ datum_get_point3dz(Datum value)
Returns a 3DZ point from the datum.
Definition: tpoint_spatialfuncs.c:152
void ensure_not_geodetic(int16 flags)
Ensure that the spatiotemporal argument has planar coordinates.
Definition: tpoint_spatialfuncs.c:399
Datum tpointinstset_twcentroid(const TInstantSet *ti)
Returns the time-weighed centroid of the temporal geometry point of instant set type.
Definition: tpoint_spatialfuncs.c:2998
const POINT3DZ * datum_get_point3dz_p(Datum value)
Returns a pointer to a 3DZ point from the datum.
Definition: tpoint_spatialfuncs.c:163
Datum tpoint_trajectory_internal(const Temporal *temp)
Returns the trajectory of a temporal point (dispatch function)
Definition: tpoint_spatialfuncs.c:1496
Datum tpoint_twcentroid_internal(Temporal *temp)
Returns the time-weighed centroid of the temporal geometry point (dispatch function) ...
Definition: tpoint_spatialfuncs.c:3145
bool tgeogpointseq_intersection(const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
Returns true if the two segments of the temporal geographic point values intersect at the timestamp...
Definition: tpoint_spatialfuncs.c:1167
void interpolate_point4d_sphere(const POINT3D *p1, const POINT3D *p2, const POINT4D *v1, const POINT4D *v2, double f, POINT4D *p)
Find interpolation point p between geography points p1 and p2 so that the len(p1,p) == len(p1...
Definition: geography_functions.c:514
Datum tpointseqset_twcentroid(const TSequenceSet *ts)
Returns the time-weighed centroid of the temporal geometry point of sequence set type.
Definition: tpoint_spatialfuncs.c:3086
datum_func2 get_distance_fn(int16 flags)
Select the appropriate distance function.
Definition: tpoint_spatialfuncs.c:277
long double closest_point2d_on_segment_ratio(const POINT2D *p, const POINT2D *A, const POINT2D *B, POINT2D *closest)
Returns a long double between 0 and 1 representing the location of the closest point on the segment t...
Definition: tpoint_spatialfuncs.c:711
void ensure_not_geodetic_gs(const GSERIALIZED *gs)
Ensure that the spatial argument has planar coordinates.
Definition: tpoint_spatialfuncs.c:384
void geography_interpolate_point4d(const POINT3D *p1, const POINT3D *p2, const POINT4D *v1, const POINT4D *v2, double f, POINT4D *p)
void ensure_point_type(const GSERIALIZED *gs)
Ensure that the geometry/geography is a point.
Definition: tpoint_spatialfuncs.c:653
LWLINE * geopoint_lwline(Datum value1, Datum value2)
Compute the trajectory from two geometry points.
Definition: tpoint_spatialfuncs.c:1313
void ensure_has_not_Z(int16 flags)
Datum tpoint_minus_stbox(PG_FUNCTION_ARGS)
Restricts the temporal value to the complement of the spatiotemporal box.
Definition: tpoint_spatialfuncs.c:5318
Datum tpointseq_trajectory(const TSequence *seq)
Returns the precomputed trajectory of a temporal sequence point.
Definition: tpoint_spatialfuncs.c:1391
void ensure_same_geodetic_gs(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Ensure that the spatiotemporal argument have the same type of coordinates, either planar or geodetic...
Definition: tpoint_spatialfuncs.c:424
Structure to represent temporal values of sequence set subtype.
Definition: temporal.h:293
long double closest_point3dz_on_segment_ratio(const POINT3DZ *p, const POINT3DZ *A, const POINT3DZ *B, POINT3DZ *closest)
Returns a float between 0 and 1 representing the location of the closest point on the segment to the ...
Definition: tpoint_spatialfuncs.c:761
Temporal * tpoint_set_srid_internal(Temporal *temp, int32 srid)
Set the SRID of a temporal point (dispatch function)
Definition: tpoint_spatialfuncs.c:1752
Datum tpoint_speed(PG_FUNCTION_ARGS)
Returns the speed of the temporal point.
Definition: tpoint_spatialfuncs.c:2969
Datum tpointseq_trajectory_copy(const TSequence *seq)
Copy the precomputed trajectory of a temporal sequence point.
Definition: tpoint_spatialfuncs.c:1402
TInstantSet ** tpointinstset_make_simple1(const TInstantSet *ti, int *count)
Split a temporal point into an array of non self-intersecting pieces.
Definition: tpoint_spatialfuncs.c:4132
Datum pt_distance2d(Datum geom1, Datum geom2)
Returns the 2D distance between the two geometric points.
Definition: tpoint_spatialfuncs.c:343
Datum tpoint_cumulative_length(PG_FUNCTION_ARGS)
Returns the cumulative length traversed by the temporal point.
Definition: tpoint_spatialfuncs.c:2884
Datum tpointinstset_trajectory(const TInstantSet *ti)
Compute the trajectory of a temporal instant set point.
Definition: tpoint_spatialfuncs.c:1283
Structure to represent temporal values of instant set subtype.
Definition: temporal.h:266
Datum geo_set_precision(PG_FUNCTION_ARGS)
Sets the precision of the coordinates of the geometry.
Definition: tpoint_spatialfuncs.c:2564
bool datum_point_eq(Datum geopoint1, Datum geopoint2)
Returns true if the two points are equal.
Definition: tpoint_spatialfuncs.c:211
Datum tgeompoint_to_tgeogpoint(PG_FUNCTION_ARGS)
Converts a temporal geometry point to a temporal geography point.
Definition: tpoint_spatialfuncs.c:2181
Datum tpoint_get_z(PG_FUNCTION_ARGS)
Get the Z coordinates of the temporal point.
Definition: tpoint_spatialfuncs.c:2698
Datum tpoint_get_x(PG_FUNCTION_ARGS)
Get the X coordinates of the temporal point.
Definition: tpoint_spatialfuncs.c:2672
void ensure_non_empty(const GSERIALIZED *gs)
Ensure that the geometry/geography is not empty.
Definition: tpoint_spatialfuncs.c:665
TSequence ** tpointseq_at_geometry(const TSequence *seq, Datum geo, int *count)
Restricts the temporal sequence point to the geometry.
Definition: tpoint_spatialfuncs.c:4826
Datum geom_distance3d(Datum geom1, Datum geom2)
Returns the 3D distance between the two geometries.
Definition: tpoint_spatialfuncs.c:320
Datum(* datum_func2)(Datum, Datum)
Definition: temporal.h:358
TSequence ** tpointseq_make_simple1(const TSequence *seq, int *count)
Split a temporal point into an array of non self-intersecting pieces.
Definition: tpoint_spatialfuncs.c:4248
Datum geom_bearing(Datum point1, Datum point2)
Computes the bearing between two geometric points.
Definition: tpoint_spatialfuncs.c:3356
void tpoint_trajectory_free(const Temporal *temp, Datum traj)
Free the trajectory after a call to tpoint_trajectory_internal.
Definition: tpoint_spatialfuncs.c:1515
LWGEOM * lwpointarr_make_trajectory(LWGEOM **lwpoints, int count, bool linear)
Compute a trajectory from a set of points.
Definition: tpoint_spatialfuncs.c:1261
const POINT3DZ * gs_get_point3dz_p(GSERIALIZED *gs)
Returns a 3DZ point from the serialized geometry.
Definition: tpoint_spatialfuncs.c:173
Datum tpoint_at_geometry(PG_FUNCTION_ARGS)
Restricts the temporal point to the geometry.
Definition: tpoint_spatialfuncs.c:5055
Period ** tpointseq_interperiods(const TSequence *seq, GSERIALIZED *gsinter, int *count)
Get the periods at which the temporal sequence point with linear interpolation intersects the geometr...
Definition: tpoint_spatialfuncs.c:4601
bool tpointseq_intersection_value(const TInstant *inst1, const TInstant *inst2, Datum value, TimestampTz *t)
Returns true if the segment of the temporal point value intersects the base value at the timestamp...
Definition: tpoint_spatialfuncs.c:1020
Datum pt_distance3d(Datum geom1, Datum geom2)
Returns the 3D distance between the two geometric points.
Definition: tpoint_spatialfuncs.c:354
bool tgeompointseq_intersection(const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
Returns true if the two segments of the temporal geometric point values intersect at the timestamp...
Definition: tpoint_spatialfuncs.c:1059
void ensure_same_srid_tpoint_stbox(const Temporal *temp, const STBOX *box)
Ensure that the temporal point and the spatiotemporal boxes have the same SRID.
Definition: tpoint_spatialfuncs.c:464
void ensure_same_dimensionality_gs(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Ensure that the geometries/geographies have the same dimensionality.
Definition: tpoint_spatialfuncs.c:516
TSequenceSet * tgeogpoints_to_tgeompoints(const TSequenceSet *ts)
TInstant * tgeogpointinst_to_tgeompointinst(const TInstant *inst)
Datum geom_distance2d(Datum geom1, Datum geom2)
Returns the 2D distance between the two geometries.
Definition: tpoint_spatialfuncs.c:307
long double geoseg_locate_point(Datum start, Datum end, Datum point, double *dist)
Returns a float between 0 and 1 representing the location of the closest point on the geometry segmen...
Definition: tpoint_spatialfuncs.c:931
void ensure_has_not_Z_gs(const GSERIALIZED *gs)
Ensure that the geometry/geography has not Z dimension.
Definition: tpoint_spatialfuncs.c:605
int tpointinst_srid(const TInstant *inst)
Returns the SRID of a temporal instant point.
Definition: tpoint_spatialfuncs.c:1589
Datum tpoint_srid(PG_FUNCTION_ARGS)
Returns the SRID of a temporal point.
Definition: tpoint_spatialfuncs.c:1649
Datum tpoint_length(PG_FUNCTION_ARGS)
Returns the length traversed by the temporal sequence (set) point.
Definition: tpoint_spatialfuncs.c:2749
Temporal * tpoint_restrict_geometry_internal(const Temporal *temp, Datum geom, bool atfunc)
Restricts the temporal point to the (complement of the) geometry (dispatch function) ...
Definition: tpoint_spatialfuncs.c:4985
const POINT2D * datum_get_point2d_p(Datum value)
Returns a pointer to a 2D point from the datum.
Definition: tpoint_spatialfuncs.c:133
Datum tpoint_get_y(PG_FUNCTION_ARGS)
Get the Y coordinates of the temporal point.
Definition: tpoint_spatialfuncs.c:2685
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
Datum tpoint_set_precision(PG_FUNCTION_ARGS)
Set the precision of the coordinates of the temporal point to the number of decimal places...
Definition: tpoint_spatialfuncs.c:2579
Temporal * tpoint_at_stbox_internal(const Temporal *temp, const STBOX *box, bool exc_upper)
Restrict the temporal point to the spatiotemporal box.
Definition: tpoint_spatialfuncs.c:5162
void ensure_same_srid(int32_t srid1, int32_t srid2)
Ensure that the two spatial "objects" have the same SRID.
Definition: tpoint_spatialfuncs.c:439
Datum geog_bearing(Datum point1, Datum point2)
Computes the bearing between two geographic points.
Definition: tpoint_spatialfuncs.c:3388
void ensure_spatial_validity(const Temporal *temp1, const Temporal *temp2)
Ensure that the spatial constraints required for operating on two temporal geometries are satisfied...
Definition: tpoint_spatialfuncs.c:370
void ensure_same_dimensionality(int16 flags1, int16 flags2)
Ensure that the temporal values have the same dimensionality.
Definition: tpoint_spatialfuncs.c:489
Datum geoseg_interpolate_point(Datum value1, Datum value2, long double ratio)
Returns a point interpolated from the geometry/geography segment with respect to the fraction of its ...
Definition: tpoint_spatialfuncs.c:881
Datum geopoint_line(Datum value1, Datum value2)
Compute the trajectory from two points.
Definition: tpoint_spatialfuncs.c:1336
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253