MobilityDB 1.3
Loading...
Searching...
No Matches
meos_internal_geo.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code seq 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 seq 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 __MEOS_INTERNAL_GEO_H__
35#define __MEOS_INTERNAL_GEO_H__
36
37/* C */
38#include <stddef.h>
39/* JSON-C */
40#include <json-c/json.h>
41/* PROJ */
42#include <proj.h>
43/* PostgreSQL */
44/* MEOS */
45#include <meos.h>
46#include <meos_geo.h>
47#include <meos_internal.h>
48
49/*****************************************************************************
50 * Direct access to a single point in the GSERIALIZED struct
51 *****************************************************************************/
52
53/*
54 * Obtain a geometry/geography point from the GSERIALIZED WITHOUT creating
55 * the corresponding LWGEOM. These functions constitute a **SERIOUS**
56 * break of encapsulation but it is the only way to achieve reasonable
57 * performance when manipulating mobility data.
58 * The datum_* functions suppose that the GSERIALIZED has been already
59 * detoasted. This is typically the case when the datum is within a Temporal*
60 * that has been already detoasted with PG_GETARG_TEMPORAL*
61 * The first variant (e.g. datum_point2d) is slower than the second (e.g.
62 * datum_point2d_p) since the point is passed by value and thus the bytes
63 * are copied. The second version is declared const because you aren't allowed
64 * to modify the values, only read them.
65 */
66
71#define DatumGetGserializedP(X) ((GSERIALIZED *) DatumGetPointer(X))
72#define GserializedPGetDatum(X) PointerGetDatum(X)
73
77// #define LWFLAG_EXTFLAGS 0x20
78#define LWFLAG_VERSBIT2 0x80
79
80// #define FLAGS_GET_EXTFLAGS(flags) (((flags) & LWFLAG_EXTFLAGS)>>5)
81#define FLAGS_GET_VERSBIT2(flags) (((flags) & LWFLAG_VERSBIT2)>>7)
82
83#define GS_POINT_PTR(gs) ( (uint8_t *) ((gs)->data) + 8 + \
84 FLAGS_GET_BBOX((gs)->gflags) * FLAGS_NDIMS_BOX((gs)->gflags) * 8 + \
85 FLAGS_GET_VERSBIT2((gs)->gflags) * 8 )
86
90#define DATUM_POINT2D_P(gs) ( (POINT2D *) GS_POINT_PTR(DatumGetGserializedP(gs)) )
91#define DATUM_POINT3DZ_P(gs) ( (POINT3DZ *) GS_POINT_PTR(DatumGetGserializedP(gs)) )
92
93#define GSERIALIZED_POINT2D_P(gs) ( (POINT2D *) GS_POINT_PTR((gs)) )
94#define GSERIALIZED_POINT3DZ_P(gs) ( (POINT3DZ *) GS_POINT_PTR((gs)) )
95
96/*****************************************************************************
97 * Internal function accessing the PROJ library
98 *****************************************************************************/
99
100extern PJ_CONTEXT *proj_get_context(void);
101
102/*****************************************************************************
103 * Round functions
104 *****************************************************************************/
105
106extern Datum datum_geo_round(Datum value, Datum size);
107extern GSERIALIZED *point_round(const GSERIALIZED *gs, int maxdd);
108
109/******************************************************************************
110 * Functions for box types
111 *****************************************************************************/
112
113/* Constructor functions for box types */
114
115extern void stbox_set(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s, STBox *box);
116
117/*****************************************************************************/
118
119/* Conversion functions for box types */
120
121extern STBox *box3d_to_stbox(const BOX3D *box);
122extern void gbox_set_stbox(const GBOX *box, int32_t srid, STBox *result);
123extern bool geo_set_stbox(const GSERIALIZED *gs, STBox *box);
124extern void geoarr_set_stbox(const Datum *values, int count, STBox *box);
125extern bool spatial_set_stbox(Datum d, meosType basetype, STBox *box);
126extern void spatialset_set_stbox(const Set *set, STBox *box);
127extern void stbox_set_box3d(const STBox *box, BOX3D *box3d);
128extern void stbox_set_gbox(const STBox *box, GBOX *gbox);
129extern void tstzset_set_stbox(const Set *s, STBox *box);
130extern void tstzspan_set_stbox(const Span *s, STBox *box);
131extern void tstzspanset_set_stbox(const SpanSet *s, STBox *box);
132
133/*****************************************************************************/
134
135/* Transformation functions for box types */
136
137extern void stbox_expand(const STBox *box1, STBox *box2);
138
139/*****************************************************************************/
140
141/* Set functions for box types */
142
143extern bool inter_stbox_stbox(const STBox *box1, const STBox *box2, STBox *result);
144extern GSERIALIZED *stbox_geo(const STBox *box);
145
146/*****************************************************************************
147 * Functions for temporal types
148 *****************************************************************************/
149
150/* Input and output functions for temporal types */
151
152extern TInstant *tgeogpointinst_from_mfjson(json_object *mfjson, int32_t srid);
153extern TInstant *tgeogpointinst_in(const char *str);
154extern TSequence *tgeogpointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
155extern TSequence *tgeogpointseq_in(const char *str, interpType interp);
156extern TSequenceSet *tgeogpointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
157extern TSequenceSet *tgeogpointseqset_in(const char *str);
158extern TInstant *tgeompointinst_from_mfjson(json_object *mfjson, int32_t srid);
159extern TInstant *tgeompointinst_in(const char *str);
160extern TSequence *tgeompointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
161extern TSequence *tgeompointseq_in(const char *str, interpType interp);
162extern TSequenceSet *tgeompointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
163extern TSequenceSet *tgeompointseqset_in(const char *str);
164extern TInstant *tgeographyinst_from_mfjson(json_object *mfjson, int32_t srid);
165extern TInstant *tgeographyinst_in(const char *str);
166extern TSequence *tgeographyseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
167extern TSequence *tgeographyseq_in(const char *str, interpType interp);
168extern TSequenceSet *tgeographyseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
169extern TSequenceSet *tgeographyseqset_in(const char *str);
170extern TInstant *tgeometryinst_from_mfjson(json_object *mfjson, int32_t srid);
171extern TInstant *tgeometryinst_in(const char *str);
172extern TSequence *tgeometryseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
173extern TSequence *tgeometryseq_in(const char *str, interpType interp);
174extern TSequenceSet *tgeometryseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
175extern TSequenceSet *tgeometryseqset_in(const char *str);
176
177/*****************************************************************************/
178
179/* Constructor functions for temporal types */
180
181extern TSequence *tpointseq_make_coords(const double *xcoords, const double *ycoords, const double *zcoords, const TimestampTz *times, int count, int32 srid, bool geodetic, bool lower_inc, bool upper_inc, interpType interp, bool normalize);
182
183/*****************************************************************************/
184
185/* Conversion functions for temporal types */
186
187/*****************************************************************************/
188
189/* Accessor functions for temporal types */
190
191/*****************************************************************************/
192
193/* Transformation functions for temporal types */
194
195/*****************************************************************************/
196
197/* Modification functions for temporal types */
198
199/*****************************************************************************/
200
201/* Bounding box functions for temporal types */
202
203extern void tspatial_set_stbox(const Temporal *temp, STBox *box);
204extern void tgeoinst_set_stbox(const TInstant *inst, STBox *box);
205extern void tspatialseq_set_stbox(const TSequence *seq, STBox *box);
206extern void tspatialseqset_set_stbox(const TSequenceSet *ss, STBox *box);
207
208/*****************************************************************************/
209
210/* Restriction functions for temporal types */
211
212extern Temporal *tgeo_restrict_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, bool atfunc);
213extern Temporal *tgeo_restrict_stbox(const Temporal *temp, const STBox *box, bool border_inc, bool atfunc);
214extern TInstant *tgeoinst_restrict_geom(const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, bool atfunc);
215extern TInstant *tgeoinst_restrict_stbox(const TInstant *inst, const STBox *box, bool border_inc, bool atfunc);
216extern Temporal *tgeoseq_restrict_geom(const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc);
217extern Temporal *tgeoseq_restrict_stbox(const TSequence *seq, const STBox *box, bool border_inc, bool atfunc);
218extern TSequenceSet *tgeoseqset_restrict_geom(const TSequenceSet *ss, const GSERIALIZED *gs, const Span *zspan, bool atfunc);
219extern TSequenceSet *tgeoseqset_restrict_stbox(const TSequenceSet *ss, const STBox *box, bool border_inc, bool atfunc);
220
221/*****************************************************************************/
222
223/* Traditional comparison functions for temporal types */
224
225/*****************************************************************************/
226
227/* Ever/always functions for temporal types */
228
229/*****************************************************************************/
230
231/* Mathematical functions for temporal types */
232
233/*****************************************************************************/
234
235/* Distance functions for temporal types */
236
237/*****************************************************************************
238 * Spatial functions for temporal points
239 *****************************************************************************/
240
241/* Spatial accessor functions for temporal points */
242
243extern int32_t spatial_srid(Datum d, meosType basetype);
244extern bool spatial_set_srid(Datum d, meosType basetype, int32_t srid);
245extern int tspatialinst_srid(const TInstant *inst);
246extern TSequenceSet *tpointseq_azimuth(const TSequence *seq);
247extern TSequence *tpointseq_cumulative_length(const TSequence *seq, double prevlength);
248extern bool tpointseq_is_simple(const TSequence *seq);
249extern double tpointseq_length(const TSequence *seq);
250extern GSERIALIZED *tpointseq_linear_trajectory(const TSequence *seq, bool unary_union);
251extern TSequence *tpointseq_speed(const TSequence *seq);
252extern STBox *tgeoseq_stboxes(const TSequence *seq, int *count);
253extern STBox *tgeoseq_split_n_stboxes(const TSequence *seq, int max_count, int *count);
256extern bool tpointseqset_is_simple(const TSequenceSet *ss);
257extern double tpointseqset_length(const TSequenceSet *ss);
259extern STBox *tgeoseqset_stboxes(const TSequenceSet *ss, int *count);
260extern STBox *tgeoseqset_split_n_stboxes(const TSequenceSet *ss, int max_count, int *count);
261extern Temporal *tpoint_get_coord(const Temporal *temp, int coord);
262
263/*****************************************************************************/
264
265/* Spatial transformation functions for temporal points */
266
267extern TInstant *tgeominst_tgeoginst(const TInstant *inst, bool oper);
268extern TSequence *tgeomseq_tgeogseq(const TSequence *seq, bool oper);
269extern TSequenceSet *tgeomseqset_tgeogseqset(const TSequenceSet *ss, bool oper);
270extern Temporal *tgeom_tgeog(const Temporal *temp, bool oper);
271extern Temporal *tgeo_tpoint(const Temporal *temp, bool oper);
272extern void tspatialinst_set_srid(TInstant *inst, int32_t srid);
273extern TSequence **tpointseq_make_simple(const TSequence *seq, int *count);
274extern void tspatialseq_set_srid(TSequence *seq, int32_t srid);
275extern TSequence **tpointseqset_make_simple(const TSequenceSet *ss, int *count);
276extern void tspatialseqset_set_srid(TSequenceSet *ss, int32_t srid);
277
278/*****************************************************************************/
279
280/* Local aggregate functions for temporal types */
281
282extern GSERIALIZED *tpointseq_twcentroid(const TSequence *seq);
284
285/*****************************************************************************/
286
287/* Compact functions for final append aggregate */
288
289
290/*****************************************************************************/
291
292/* Aggregate functions for temporal types */
293
294
295/*****************************************************************************/
296
297/* Tile functions for span and temporal types */
298
299
300/*****************************************************************************/
301
302/* Similarity functions for temporal types */
303
304
305/*****************************************************************************/
306
307#endif /* __MEOS_INTERNAL_GEO_H__ */
STBox * box3d_to_stbox(const BOX3D *box)
Convert a BOX3D into a spatiotemporal box.
Definition: stbox.c:711
void stbox_set(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s, STBox *box)
Return in the last argument a spatiotemporal box constructed from the given arguments.
Definition: stbox.c:361
bool geo_set_stbox(const GSERIALIZED *gs, STBox *box)
Return in the last argument the spatiotemporal box of a geometry/geography.
Definition: stbox.c:765
bool spatial_set_stbox(Datum d, meosType basetype, STBox *box)
Return in the last argument a spatiotemporal box constructed from a spatial base value.
Definition: stbox.c:1021
void spatialset_set_stbox(const Set *set, STBox *box)
Return in the last argument the bounding box of a spatial set.
Definition: tspatial.c:392
void gbox_set_stbox(const GBOX *box, int32_t srid, STBox *result)
Set the a spatiotemporal box in the last argument from the GBOX and the SRID.
Definition: stbox.c:666
void tstzspanset_set_stbox(const SpanSet *s, STBox *box)
Return in the last argument a spatiotemporal box constructed from a timestamptz span set.
Definition: stbox.c:980
void tstzset_set_stbox(const Set *s, STBox *box)
Return in the last argument a spatiotemporal box constructed from a timestamptz set.
Definition: stbox.c:910
void geoarr_set_stbox(const Datum *values, int count, STBox *box)
Return in the last argument a spatiotemporal box constructed from an array of geometries/geographies.
Definition: stbox.c:856
void stbox_set_box3d(const STBox *box, BOX3D *box3d)
Return in the last argument a BOX3D constructed from a spatiotemporal box.
Definition: stbox.c:503
void tstzspan_set_stbox(const Span *s, STBox *box)
Return in the last argument a spatiotemporal box constructed from a timestamptz span.
Definition: stbox.c:946
void stbox_set_gbox(const STBox *box, GBOX *gbox)
Return in the last argument a GBOX constructed from a spatiotemporal box.
Definition: stbox.c:474
bool inter_stbox_stbox(const STBox *box1, const STBox *box2, STBox *result)
Return in the last argument the intersection of two spatiotemporal boxes.
Definition: stbox.c:2250
void stbox_expand(const STBox *box1, STBox *box2)
Return the second spatiotemporal box expanded with the first one.
Definition: stbox.c:93
TSequence * tpointseq_cumulative_length(const TSequence *seq, double prevlength)
Return the cumulative length traversed by a temporal point sequence.
Definition: tpoint_spatialfuncs.c:2673
GSERIALIZED * tpointseqset_twcentroid(const TSequenceSet *ss)
Return the time-weighed centroid of a temporal geometry point sequence set.
Definition: tpoint_spatialfuncs.c:2922
GSERIALIZED * tpointseq_linear_trajectory(const TSequence *seq, bool unary_union)
Return the trajectory of a temporal point sequence.
Definition: tpoint_spatialfuncs.c:1149
double tpointseq_length(const TSequence *seq)
Return the length traversed by a temporal point sequence.
Definition: tpoint_spatialfuncs.c:2599
Temporal * tpoint_get_coord(const Temporal *temp, int coord)
Return one of the coordinates of a temporal point as a temporal float.
Definition: tpoint_spatialfuncs.c:164
TSequenceSet * tpointseqset_cumulative_length(const TSequenceSet *ss)
Return the cumulative length traversed by a temporal point sequence set.
Definition: tpoint_spatialfuncs.c:2714
TSequenceSet * tpointseqset_speed(const TSequenceSet *ss)
Return the speed of a temporal point sequence set.
Definition: tpoint_spatialfuncs.c:2808
TSequenceSet * tpointseq_azimuth(const TSequence *seq)
Return the temporal azimuth of a temporal geometry point sequence.
Definition: tpoint_spatialfuncs.c:3174
double tpointseqset_length(const TSequenceSet *ss)
Return the length traversed by a temporal point sequence set.
Definition: tpoint_spatialfuncs.c:2630
bool tpointseq_is_simple(const TSequence *seq)
Return true if a temporal point does not self-intersect.
Definition: tpoint_spatialfuncs.c:4231
bool tpointseqset_is_simple(const TSequenceSet *ss)
Return true if a temporal point does not self-intersect.
Definition: tpoint_spatialfuncs.c:4254
GSERIALIZED * tpointseq_twcentroid(const TSequence *seq)
Return the time-weighed centroid of a temporal geometry point sequence.
Definition: tpoint_spatialfuncs.c:2896
TSequenceSet * tpointseqset_azimuth(const TSequenceSet *ss)
Return the temporal azimuth of a temporal geometry point sequence set.
Definition: tpoint_spatialfuncs.c:3190
TSequence * tpointseq_speed(const TSequence *seq)
Return the speed of a temporal point sequence.
Definition: tpoint_spatialfuncs.c:2766
GSERIALIZED * point_round(const GSERIALIZED *gs, int maxdd)
Return a point with the coordinates set to a number of decimal places.
Definition: geo_round.c:82
void tspatialseqset_set_stbox(const TSequenceSet *ss, STBox *box)
Return in the last argument the spatiotemporal box of a temporal spatial sequence set.
Definition: tgeo_boxops.c:164
void tspatialseq_set_stbox(const TSequence *seq, STBox *box)
Return in the last argument the spatiotemporal box of a temporal spatial sequence.
Definition: tgeo_boxops.c:147
STBox * tgeoseqset_split_n_stboxes(const TSequenceSet *ss, int max_count, int *count)
Return an array of N spatiotemporal boxes from the segments of a temporal geo sequence set.
Definition: tgeo_boxops.c:663
STBox * tgeoseqset_stboxes(const TSequenceSet *ss, int *count)
Return an array of spatiotemporal boxes from the segments of a temporal geo sequence set.
Definition: tgeo_boxops.c:475
STBox * tgeoseq_split_n_stboxes(const TSequence *seq, int max_count, int *count)
Return an array of N spatiotemporal boxes from the instants or segments of a temporal geo sequence,...
Definition: tgeo_boxops.c:634
void tgeoinst_set_stbox(const TInstant *inst, STBox *box)
Return in the last argument the spatiotemporal box of a temporal geo instant.
Definition: tgeo_boxops.c:90
STBox * tgeoseq_stboxes(const TSequence *seq, int *count)
Return an array of spatiotemporal boxes from the instants or segments of a temporal geo sequence,...
Definition: tgeo_boxops.c:449
GSERIALIZED * stbox_geo(const STBox *box)
Return a spatiotemporal box converted as a geometry/geography.
Definition: stbox.c:569
void tspatial_set_stbox(const Temporal *temp, STBox *box)
Return in the last argument the spatiotemporal box of a temporal spatial value.
Definition: tspatial.c:426
TInstant * tgeominst_tgeoginst(const TInstant *inst, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:964
Temporal * tgeom_tgeog(const Temporal *temp, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:1035
TSequence * tgeomseq_tgeogseq(const TSequence *seq, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:991
Temporal * tgeo_tpoint(const Temporal *temp, bool oper)
Return a temporal geo transformed from/to a temporal point.
Definition: tgeo_spatialfuncs.c:1235
TSequenceSet * tgeomseqset_tgeogseqset(const TSequenceSet *ss, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:1011
TInstant * tgeogpointinst_from_mfjson(json_object *mfjson, int32_t srid)
Return a temporal geography point instant from its MF-JSON representation.
Definition: tgeo_meos.c:289
TSequence * tgeompointseq_in(const char *str, interpType interp)
Return a temporal geometry point sequence from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:128
TSequence * tgeographyseq_in(const char *str, interpType interp)
Return a temporal geography sequence from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:185
TInstant * tgeogpointinst_in(const char *str)
Return a temporal instant geography point from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:77
TSequence * tgeographyseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geography sequence from its MF-JSON representation.
Definition: tgeo_meos.c:375
TSequence * tgeogpointseq_in(const char *str, interpType interp)
Return a temporal geography point sequence from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:147
TSequenceSet * tgeographyseqset_in(const char *str)
Return a temporal geography sequence set from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:253
TSequence * tgeompointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geometry point sequence from its MF-JSON representation.
Definition: tgeo_meos.c:332
TInstant * tgeompointinst_from_mfjson(json_object *mfjson, int32_t srid)
Return a temporal geometry point instant from its MF-JSON representation.
Definition: tgeo_meos.c:275
TInstant * tgeometryinst_from_mfjson(json_object *mfjson, int32_t srid)
Return a temporal geometry instant from its MF-JSON representation.
Definition: tgeo_meos.c:302
TSequence * tgeogpointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geography point sequence from its MF-JSON representation.
Definition: tgeo_meos.c:347
TInstant * tgeompointinst_in(const char *str)
Return a temporal geometry point instant from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:61
TSequenceSet * tgeompointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geometry point sequence set from its MF-JSON representation.
Definition: tgeo_meos.c:392
TSequence * tgeometryseq_in(const char *str, interpType interp)
Return a temporal geometry sequence from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:166
TSequenceSet * tgeometryseqset_in(const char *str)
Return a temporal geometry sequence set from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:237
TSequenceSet * tgeogpointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geography point sequence set from its MF-JSON representation.
Definition: tgeo_meos.c:407
TInstant * tgeometryinst_in(const char *str)
Return a temporal geometry instant from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:93
TSequence * tgeometryseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geometry sequence from its MF-JSON representation.
Definition: tgeo_meos.c:361
TSequenceSet * tgeographyseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geography sequence set from its MF-JSON representation.
Definition: tgeo_meos.c:437
TSequenceSet * tgeometryseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp)
Return a temporal geometry sequence set from its MF-JSON representation.
Definition: tgeo_meos.c:422
TSequenceSet * tgeogpointseqset_in(const char *str)
Return a temporal geography point sequence set from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:221
TSequenceSet * tgeompointseqset_in(const char *str)
Return a temporal geometry point sequence set from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:205
TInstant * tgeographyinst_from_mfjson(json_object *mfjson, int32_t srid)
Return a temporal geography instant from its MF-JSON representation.
Definition: tgeo_meos.c:315
TInstant * tgeographyinst_in(const char *str)
Return a temporal geography instant from its Well-Known Text (WKT) representation.
Definition: tgeo_meos.c:109
Temporal * tgeo_restrict_stbox(const Temporal *temp, const STBox *box, bool border_inc, bool atfunc)
Return a temporal geo restricted to (the complement of) a spatiotemporal box.
Definition: tgeo_restrict.c:1111
Temporal * tgeo_restrict_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
Return a temporal geo restricted to (the complement of) a geometry and possibly a Z span.
Definition: tgeo_restrict.c:2045
TInstant * tgeoinst_restrict_stbox(const TInstant *inst, const STBox *box, bool border_inc, bool atfunc)
Return a temporal geo instant restricted to (the complement of) a spatiotemporal box.
Definition: tgeo_restrict.c:599
TSequenceSet * tgeoseqset_restrict_stbox(const TSequenceSet *ss, const STBox *box, bool border_inc, bool atfunc)
Return a temporal geo sequence set restricted to (the complement of) a spatiotemporal box.
Definition: tgeo_restrict.c:1057
Temporal * tgeoseq_restrict_geom(const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
Return a temporal geo sequence restricted to (the complement of) a geometry and possibly a Z span and...
Definition: tgeo_restrict.c:1944
TInstant * tgeoinst_restrict_geom(const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
Return a temporal geo instant restricted to (the complement of) a geometry and possibly a Z span and ...
Definition: tgeo_restrict.c:1477
TSequenceSet * tgeoseqset_restrict_geom(const TSequenceSet *ss, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
Return a temporal geo sequence set restricted to (the complement of) a geometry and possibly a Z span...
Definition: tgeo_restrict.c:1991
Temporal * tgeoseq_restrict_stbox(const TSequence *seq, const STBox *box, bool border_inc, bool atfunc)
Return a temporal geo sequence restricted to (the complement of) a spatiotemporal box.
Definition: tgeo_restrict.c:1005
int tspatialinst_srid(const TInstant *inst)
Return the SRID of a spatiotemporal instant.
Definition: tspatial_srid.c:200
void tspatialseqset_set_srid(TSequenceSet *ss, int32_t srid)
Set the coordinates of a spatiotemporal sequence set to an SRID.
Definition: tspatial_srid.c:277
void tspatialseq_set_srid(TSequence *seq, int32_t srid)
Set the coordinates of a spatiotemporal sequence to an SRID.
Definition: tspatial_srid.c:258
void tspatialinst_set_srid(TInstant *inst, int32_t srid)
Set the coordinates of a spatiotemporal instant to an SRID.
Definition: tspatial_srid.c:243
TSequence ** tpointseq_make_simple(const TSequence *seq, int *count)
Return a temporal point sequence split into an array of non self-intersecting fragments.
Definition: tpoint_spatialfuncs.c:4404
TSequence ** tpointseqset_make_simple(const TSequenceSet *ss, int *count)
Return a temporal point sequence set split into an array of non self-intersecting fragments.
Definition: tpoint_spatialfuncs.c:4449
TSequence * tpointseq_make_coords(const double *xcoords, const double *ycoords, const double *zcoords, const TimestampTz *times, int count, int32 srid, bool geodetic, bool lower_inc, bool upper_inc, interpType interp, bool normalize)
Return a temporal sequence from arrays of coordinates, one per dimension, and timestamps.
Definition: tsequence.c:1242
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
set(CBUFFER_SRCS cbuffer.c tcbuffer.c tcbuffer_boxops.c tcbuffer_compops.c tcbuffer_distance.c tcbuffer_spatialfuncs.c tcbuffer_spatialrels.c tcbuffer_tempspatialrels.c) if(1) list(APPEND CBUFFER_SRCS cbufferset_meos.c) endif() add_library(cbuffer OBJECT $
Definition: CMakeLists.txt:1
interpType
Enumeration that defines the interpolation types used in MEOS.
Definition: meos.h:161
External API of the Mobility Engine Open Source (MEOS) library.
int32_t spatial_srid(Datum d, meosType basetype)
Return the SRID of a spatial value.
Definition: tspatial_srid.c:81
Datum datum_geo_round(Datum value, Datum size)
Return a geometry with the precision of the coordinates set to a number of decimal places.
Definition: geo_round.c:579
bool spatial_set_srid(Datum d, meosType basetype, int32_t srid)
Return true if the first argument has been successfully transformed to another SRID.
Definition: tspatial_srid.c:113
PJ_CONTEXT * proj_get_context(void)
Get the random generator used by temporal aggregation.
Definition: meos.c:146
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
signed int int32
Definition: postgres_ext_defs.in.h:11
Definition: postgis_ext_defs.in.h:65
Definition: postgis_ext_defs.in.h:79
Definition: postgis_ext_defs.in.h:170
Structure to represent spatiotemporal boxes.
Definition: meos.h:134
Structure to represent sets of values.
Definition: meos.h:80
Structure to represent span sets.
Definition: meos.h:108
Structure to represent spans (a.k.a.
Definition: meos.h:94
Structure to represent temporal values of instant subtype.
Definition: meos.h:185
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:224
Structure to represent temporal values of sequence subtype.
Definition: meos.h:202
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:173
int const GSERIALIZED * gs
Definition: trgeo_spatialrels.h:52