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 void gbox_set_stbox(const GBOX *box, int32_t srid, STBox *result);
122extern bool geo_set_stbox(const GSERIALIZED *gs, STBox *box);
123extern void geoarr_set_stbox(const Datum *values, int count, STBox *box);
124extern bool spatial_set_stbox(Datum d, MeosType basetype, STBox *box);
125extern void spatialset_set_stbox(const Set *set, STBox *box);
126extern void stbox_set_box3d(const STBox *box, BOX3D *box3d);
127extern void stbox_set_gbox(const STBox *box, GBOX *gbox);
128extern void tstzset_set_stbox(const Set *s, STBox *box);
129extern void tstzspan_set_stbox(const Span *s, STBox *box);
130extern void tstzspanset_set_stbox(const SpanSet *s, STBox *box);
131
132/*****************************************************************************/
133
134/* Transformation functions for box types */
135
136extern void stbox_expand(const STBox *box1, STBox *box2);
137
138/*****************************************************************************/
139
140/* Set functions for box types */
141
142extern bool inter_stbox_stbox(const STBox *box1, const STBox *box2, STBox *result);
143extern GSERIALIZED *stbox_geo(const STBox *box);
144
145/*****************************************************************************
146 * Functions for temporal types
147 *****************************************************************************/
148
149/* Input and output functions */
150
151extern TInstant *tgeogpointinst_from_mfjson(json_object *mfjson, int32_t srid);
152extern TInstant *tgeogpointinst_in(const char *str);
153extern TSequence *tgeogpointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
154extern TSequence *tgeogpointseq_in(const char *str, interpType interp);
155extern TSequenceSet *tgeogpointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
156extern TSequenceSet *tgeogpointseqset_in(const char *str);
157extern TInstant *tgeompointinst_from_mfjson(json_object *mfjson, int32_t srid);
158extern TInstant *tgeompointinst_in(const char *str);
159extern TSequence *tgeompointseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
160extern TSequence *tgeompointseq_in(const char *str, interpType interp);
161extern TSequenceSet *tgeompointseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
162extern TSequenceSet *tgeompointseqset_in(const char *str);
163extern TInstant *tgeographyinst_from_mfjson(json_object *mfjson, int32_t srid);
164extern TInstant *tgeographyinst_in(const char *str);
165extern TSequence *tgeographyseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
166extern TSequence *tgeographyseq_in(const char *str, interpType interp);
167extern TSequenceSet *tgeographyseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
168extern TSequenceSet *tgeographyseqset_in(const char *str);
169extern TInstant *tgeometryinst_from_mfjson(json_object *mfjson, int32_t srid);
170extern TInstant *tgeometryinst_in(const char *str);
171extern TSequence *tgeometryseq_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
172extern TSequence *tgeometryseq_in(const char *str, interpType interp);
173extern TSequenceSet *tgeometryseqset_from_mfjson(json_object *mfjson, int32_t srid, interpType interp);
174extern TSequenceSet *tgeometryseqset_in(const char *str);
175
176/*****************************************************************************/
177
178/* Constructor functions */
179
180/*****************************************************************************/
181
182/* Conversion functions */
183
184/*****************************************************************************/
185
186/* Accessor functions */
187
188/*****************************************************************************/
189
190/* Transformation functions */
191
192/*****************************************************************************/
193
194/* Modification functions */
195
196/*****************************************************************************/
197
198/* Bounding box functions */
199
200extern void tspatial_set_stbox(const Temporal *temp, STBox *box);
201extern void tgeoinst_set_stbox(const TInstant *inst, STBox *box);
202extern void tspatialseq_set_stbox(const TSequence *seq, STBox *box);
203extern void tspatialseqset_set_stbox(const TSequenceSet *ss, STBox *box);
204
205/*****************************************************************************/
206
207/* Restriction functions */
208
209extern Temporal *tgeo_restrict_elevation(const Temporal *temp, const Span *s, bool atfunc);
210extern Temporal *tgeo_restrict_geom(const Temporal *temp, const GSERIALIZED *gs, bool atfunc);
211extern Temporal *tgeo_restrict_stbox(const Temporal *temp, const STBox *box, bool border_inc, bool atfunc);
212extern TInstant *tgeoinst_restrict_geom(const TInstant *inst, const GSERIALIZED *gs, bool atfunc);
213extern TInstant *tgeoinst_restrict_stbox(const TInstant *inst, const STBox *box, bool border_inc, bool atfunc);
214extern Temporal *tgeoseq_restrict_geom(const TSequence *seq, const GSERIALIZED *gs, bool atfunc);
215extern Temporal *tgeoseq_restrict_stbox(const TSequence *seq, const STBox *box, bool border_inc, bool atfunc);
216extern TSequenceSet *tgeoseqset_restrict_geom(const TSequenceSet *ss, const GSERIALIZED *gs, bool atfunc);
217extern TSequenceSet *tgeoseqset_restrict_stbox(const TSequenceSet *ss, const STBox *box, bool border_inc, bool atfunc);
218
219/*****************************************************************************/
220
221/* Traditional comparison functions */
222
223/*****************************************************************************/
224
225/* Ever/always functions */
226
227/*****************************************************************************/
228
229/* Mathematical functions */
230
231/*****************************************************************************/
232
233/* Distance functions */
234
235/*****************************************************************************
236 * Spatial functions for temporal points
237 *****************************************************************************/
238
239/* Spatial accessor functions for temporal points */
240
241extern int32_t spatial_srid(Datum d, MeosType basetype);
242extern bool spatial_set_srid(Datum d, MeosType basetype, int32_t srid);
243extern int tspatialinst_srid(const TInstant *inst);
244extern TSequenceSet *tpointseq_azimuth(const TSequence *seq);
245extern TSequence *tpointseq_cumulative_length(const TSequence *seq, double prevlength);
246extern bool tpointseq_is_simple(const TSequence *seq);
247extern double tpointseq_length(const TSequence *seq);
248extern GSERIALIZED *tpointseq_linear_trajectory(const TSequence *seq, bool unary_union);
249extern STBox *tgeoseq_stboxes(const TSequence *seq, int *count);
250extern STBox *tgeoseq_split_n_stboxes(const TSequence *seq, int max_count, int *count);
253extern bool tpointseqset_is_simple(const TSequenceSet *ss);
254extern double tpointseqset_length(const TSequenceSet *ss);
255extern STBox *tgeoseqset_stboxes(const TSequenceSet *ss, int *count);
256extern STBox *tgeoseqset_split_n_stboxes(const TSequenceSet *ss, int max_count, int *count);
257extern Temporal *tpoint_get_coord(const Temporal *temp, int coord);
258
259/*****************************************************************************/
260
261/* Spatial transformation functions for temporal points */
262
263extern TInstant *tgeominst_tgeoginst(const TInstant *inst, bool oper);
264extern TSequence *tgeomseq_tgeogseq(const TSequence *seq, bool oper);
265extern TSequenceSet *tgeomseqset_tgeogseqset(const TSequenceSet *ss, bool oper);
266extern Temporal *tgeom_tgeog(const Temporal *temp, bool oper);
267extern Temporal *tgeo_tpoint(const Temporal *temp, bool oper);
268extern void tspatialinst_set_srid(TInstant *inst, int32_t srid);
269extern TSequence **tpointseq_make_simple(const TSequence *seq, int *count);
270extern void tspatialseq_set_srid(TSequence *seq, int32_t srid);
271extern TSequence **tpointseqset_make_simple(const TSequenceSet *ss, int *count);
272extern void tspatialseqset_set_srid(TSequenceSet *ss, int32_t srid);
273
274/*****************************************************************************/
275
276/* Local aggregate functions */
277
278extern GSERIALIZED *tpointseq_twcentroid(const TSequence *seq);
280
281/*****************************************************************************/
282
283/* Compact functions for final append aggregate */
284
285
286/*****************************************************************************/
287
288/* Aggregate functions */
289
290
291/*****************************************************************************/
292
293/* Tile functions for span and temporal types */
294
295
296/*****************************************************************************/
297
298/* Similarity functions */
299
300
301/*****************************************************************************/
302
303#endif /* __MEOS_INTERNAL_GEO_H__ */
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:362
bool geo_set_stbox(const GSERIALIZED *gs, STBox *box)
Return in the last argument the spatiotemporal box of a geometry/geography.
Definition: stbox.c:769
void spatialset_set_stbox(const Set *set, STBox *box)
Return in the last argument the bounding box of a spatial set.
Definition: tspatial.c:391
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:670
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:984
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:914
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:1025
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:860
void stbox_set_box3d(const STBox *box, BOX3D *box3d)
Return in the last argument a BOX3D constructed from a spatiotemporal box.
Definition: stbox.c:504
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:950
void stbox_set_gbox(const STBox *box, GBOX *gbox)
Return in the last argument a GBOX constructed from a spatiotemporal box.
Definition: stbox.c:475
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:2254
void stbox_expand(const STBox *box1, STBox *box2)
Return the second spatiotemporal box expanded with the first one.
Definition: stbox.c:94
TSequence * tpointseq_cumulative_length(const TSequence *seq, double prevlength)
Return the cumulative length traversed by a temporal point sequence.
Definition: tpoint_spatialfuncs.c:2422
GSERIALIZED * tpointseqset_twcentroid(const TSequenceSet *ss)
Return the time-weighed centroid of a temporal geometry point sequence set.
Definition: tpoint_spatialfuncs.c:2574
GSERIALIZED * tpointseq_linear_trajectory(const TSequence *seq, bool unary_union)
Return the trajectory of a temporal point sequence.
Definition: tpoint_spatialfuncs.c:887
double tpointseq_length(const TSequence *seq)
Return the length traversed by a temporal point sequence.
Definition: tpoint_spatialfuncs.c:2335
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:167
TSequenceSet * tpointseqset_cumulative_length(const TSequenceSet *ss)
Return the cumulative length traversed by a temporal point sequence set.
Definition: tpoint_spatialfuncs.c:2463
TSequenceSet * tpointseq_azimuth(const TSequence *seq)
Return the temporal azimuth of a temporal geometry point sequence.
Definition: tpoint_spatialfuncs.c:2828
double tpointseqset_length(const TSequenceSet *ss)
Return the length traversed by a temporal point sequence set.
Definition: tpoint_spatialfuncs.c:2366
bool tpointseq_is_simple(const TSequence *seq)
Return true if a temporal point does not self-intersect.
Definition: tpoint_spatialfuncs.c:3901
bool tpointseqset_is_simple(const TSequenceSet *ss)
Return true if a temporal point does not self-intersect.
Definition: tpoint_spatialfuncs.c:3924
GSERIALIZED * tpointseq_twcentroid(const TSequence *seq)
Return the time-weighed centroid of a temporal geometry point sequence.
Definition: tpoint_spatialfuncs.c:2548
TSequenceSet * tpointseqset_azimuth(const TSequenceSet *ss)
Return the temporal azimuth of a temporal geometry point sequence set.
Definition: tpoint_spatialfuncs.c:2844
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:570
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:425
TInstant * tgeominst_tgeoginst(const TInstant *inst, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:966
Temporal * tgeom_tgeog(const Temporal *temp, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:1037
TSequence * tgeomseq_tgeogseq(const TSequence *seq, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:993
Temporal * tgeo_tpoint(const Temporal *temp, bool oper)
Return a temporal geo transformed from/to a temporal point.
Definition: tgeo_spatialfuncs.c:1237
TSequenceSet * tgeomseqset_tgeogseqset(const TSequenceSet *ss, bool oper)
Return a temporal geometry/geography transformed from/to a temporal geometry/geography.
Definition: tgeo_spatialfuncs.c:1013
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:1107
TInstant * tgeoinst_restrict_geom(const TInstant *inst, const GSERIALIZED *gs, bool atfunc)
Return a temporal geo instant restricted to (the complement of) a geometry.
Definition: tgeo_restrict.c:1459
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:595
Temporal * tgeo_restrict_elevation(const Temporal *temp, const Span *s, bool atfunc)
Return a temporal geo restricted to (the complement of) an elevation span.
Definition: tgeo_restrict.c:2111
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:1053
Temporal * tgeoseq_restrict_geom(const TSequence *seq, const GSERIALIZED *gs, bool atfunc)
Return a temporal geo sequence restricted to (the complement of) a geometry.
Definition: tgeo_restrict.c:1885
Temporal * tgeo_restrict_geom(const Temporal *temp, const GSERIALIZED *gs, bool atfunc)
Return a temporal geo restricted to (the complement of) a geometry.
Definition: tgeo_restrict.c:1982
TSequenceSet * tgeoseqset_restrict_geom(const TSequenceSet *ss, const GSERIALIZED *gs, bool atfunc)
Return a temporal geo sequence set restricted to (the complement of) a geometry.
Definition: tgeo_restrict.c:1931
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:1001
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:4073
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:4118
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:171
External API of the Mobility Engine Open Source (MEOS) library.
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
int32_t spatial_srid(Datum d, MeosType basetype)
Return the SRID of a spatial value.
Definition: tspatial_srid.c:81
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:151
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:144
Structure to represent sets of values.
Definition: meos.h:90
Structure to represent span sets.
Definition: meos.h:118
Structure to represent spans (a.k.a.
Definition: meos.h:104
Structure to represent temporal values of instant subtype.
Definition: meos.h:195
Structure to represent temporal values of sequence set subtype.
Definition: meos.h:234
Structure to represent temporal values of sequence subtype.
Definition: meos.h:212
Structure to represent the common structure of temporal values of any temporal subtype.
Definition: meos.h:183
int const GSERIALIZED * gs
Definition: trgeo_spatialrels.h:52