MobilityDB 1.3
Loading...
Searching...
No Matches
meos_geo.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2025, 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-2025, 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 __MEOS_GEO_H__
35#define __MEOS_GEO_H__
36
37/* C */
38#include <stdbool.h>
39#include <stdint.h>
40
41/* MEOS */
42#include <meos.h>
43/* PostGIS */
44#include <liblwgeom.h>
45
46/*****************************************************************************
47 * Type definitions
48 *****************************************************************************/
49
54typedef enum
55{
59 COVERS = 3,
61
62/*****************************************************************************
63 * Validity macros
64 *****************************************************************************/
65
69#if MEOS
70 #define VALIDATE_GEOMSET(set, ret) \
71 do { \
72 if (! ensure_not_null((void *) (set)) || \
73 ! ensure_set_isof_type(set, T_GEOMSET) ) \
74 return (ret); \
75 } while (0)
76#else
77 #define VALIDATE_GEOMSET(set, ret) \
78 do { \
79 assert(temp); \
80 assert((set)->settype == T_GEOMSET); \
81 } while (0)
82#endif /* MEOS */
83
87#if MEOS
88 #define VALIDATE_GEOGSET(set, ret) ( \
89 do { \
90 if (! ensure_not_null((void *) (set)) || \
91 ! ensure_set_isof_type(set, T_GEOGSET) ) \
92 return (ret); \
93 } while (0)
94#else
95 #define VALIDATE_GEOGSET(set, ret) \
96 do { \
97 assert(temp); \
98 assert((set)->settype == T_GEOGSET); \
99 } while (0)
100#endif /* MEOS */
101
105#if MEOS
106 #define VALIDATE_GEOSET(set, ret) \
107 do { \
108 if (! ensure_not_null((void *) (set)) || \
109 ! ensure_geoset_type((set)->settype) ) \
110 return (ret); \
111 } while (0)
112#else
113 #define VALIDATE_GEOSET(set, ret) \
114 do { \
115 assert(temp); \
116 assert(geoset_type((set)->settype); \
117 } while (0)
118#endif /* MEOS */
119
123#if MEOS
124 #define VALIDATE_SPATIALSET(set, ret) \
125 do { \
126 if (! ensure_not_null((void *) (set)) || \
127 ! ensure_spatialset_type((set)->settype) ) \
128 return (ret); \
129 } while (0)
130#else
131 #define VALIDATE_SPATIALSET(set, ret) \
132 do { \
133 assert(set); \
134 assert(spatialset_type((set)->settype)); \
135 } while (0)
136#endif /* MEOS */
137
138/*****************************************************************************/
139
145#if MEOS
146 #define VALIDATE_TGEOMETRY(temp, ret) \
147 do { \
148 if (! ensure_not_null((void *) (temp)) || \
149 ! ensure_temporal_isof_type((Temporal *) (temp), T_TGEOMETRY) ) \
150 return (ret); \
151 } while (0)
152#else
153 #define VALIDATE_TGEOMETRY(temp, ret) \
154 do { \
155 assert(temp); \
156 assert((temp)->temptype == T_TGEOMETRY); \
157 } while (0)
158#endif /* MEOS */
159
165#if MEOS
166 #define VALIDATE_TGEOGRAPHY(temp, ret) \
167 do { \
168 if (! ensure_not_null((void *) (temp)) || \
169 ! ensure_temporal_isof_type((Temporal *) (temp), T_TGEOGRAPHY) ) \
170 return (ret); \
171 } while (0)
172#else
173 #define VALIDATE_TGEOGRAPHY(temp, ret) \
174 do { \
175 assert(temp); \
176 assert((temp)->temptype == T_TGEOGRAPHY); \
177 } while (0)
178#endif /* MEOS */
179
185#if MEOS
186 #define VALIDATE_TGEOMPOINT(temp, ret) \
187 do { \
188 if (! ensure_not_null((void *) (temp)) || \
189 ! ensure_temporal_isof_type((Temporal *) (temp), T_TGEOMPOINT) ) \
190 return (ret); \
191 } while (0)
192#else
193 #define VALIDATE_TGEOMPOINT(temp, ret) \
194 do { \
195 assert(temp); \
196 assert((temp)->temptype == T_TGEOMPOINT); \
197 } while (0)
198#endif /* MEOS */
199
205#if MEOS
206 #define VALIDATE_TGEOGPOINT(temp, ret) \
207 do { \
208 if (! ensure_not_null((void *) (temp)) || \
209 ! ensure_temporal_isof_type((Temporal *) (temp), T_TGEOGPOINT) ) \
210 return (ret); \
211 } while (0)
212#else
213 #define VALIDATE_TGEOGPOINT(temp, ret) \
214 do { \
215 assert(temp); \
216 assert((temp)->temptype == T_TGEOGPOINT); \
217 } while (0)
218#endif /* MEOS */
219
226#if MEOS
227 #define VALIDATE_TGEO(temp, ret) \
228 do { \
229 if (! ensure_not_null((void *) (temp)) || \
230 ! ensure_tgeo_type_all(((Temporal *) (temp))->temptype) ) \
231 return (ret); \
232 } while (0)
233#else
234 #define VALIDATE_TGEO(temp, ret) \
235 do { \
236 assert(temp); \
237 assert(tgeo_type_all(((Temporal *) (temp))->temptype)); \
238 } while (0)
239#endif /* MEOS */
240
246#if MEOS
247 #define VALIDATE_TGEOM(temp, ret) \
248 do { \
249 if (! ensure_not_null((void *) (temp)) || \
250 ! ensure_tgeometry_type(((Temporal *) (temp))->temptype) ) \
251 return (ret); \
252 } while (0)
253#else
254 #define VALIDATE_TGEOM(temp, ret) \
255 do { \
256 assert(temp); \
257 assert(tgeometry_type(((Temporal *) (temp))->temptype)); \
258 } while (0)
259#endif /* MEOS */
260
266#if MEOS
267 #define VALIDATE_TGEOG(temp, ret) \
268 do { \
269 if (! ensure_not_null((void *) (temp)) || \
270 ! ensure_tgeodetic_type(((Temporal *) (temp))->temptype) ) \
271 return (ret); \
272 } while (0)
273#else
274 #define VALIDATE_TGEOG(temp, ret) \
275 do { \
276 assert(temp); \
277 assert(tgeodetic_type(((Temporal *) (temp))->temptype)); \
278 } while (0)
279#endif /* MEOS */
280
287#if MEOS
288 #define VALIDATE_TPOINT(temp, ret) \
289 do { \
290 if (! ensure_not_null((void *) (temp)) || \
291 ! ensure_tpoint_type(((Temporal *) (temp))->temptype) ) \
292 return (ret); \
293 } while (0)
294#else
295 #define VALIDATE_TPOINT(temp, ret) \
296 do { \
297 assert(temp); \
298 assert(tpoint_type(((Temporal *) (temp))->temptype)); \
299 } while (0)
300#endif /* MEOS */
301
307#if MEOS
308 #define VALIDATE_TSPATIAL(temp, ret) \
309 do { \
310 if (! ensure_not_null((void *) (temp)) || \
311 ! ensure_tspatial_type(((Temporal *) (temp))->temptype) ) \
312 return (ret); \
313 } while (0)
314#else
315 #define VALIDATE_TSPATIAL(temp, ret) \
316 do { \
317 assert(temp); \
318 assert(tspatial_type(((Temporal *) (temp))->temptype)); \
319 } while (0)
320#endif /* MEOS */
321
322/*===========================================================================*
323 * Functions for static geometries
324 *===========================================================================*/
325
326/* Input and output functions */
327
328extern uint8_t *geo_as_ewkb(const GSERIALIZED *gs, const char *endian, size_t *size);
329extern char *geo_as_ewkt(const GSERIALIZED *gs, int precision);
330extern char *geo_as_geojson(const GSERIALIZED *gs, int option, int precision, const char *srs);
331extern char *geo_as_hexewkb(const GSERIALIZED *gs, const char *endian);
332extern char *geo_as_text(const GSERIALIZED *gs, int precision);
333extern GSERIALIZED *geo_from_ewkb(const uint8_t *wkb, size_t wkb_size, int32 srid);
334extern GSERIALIZED *geo_from_geojson(const char *geojson);
335extern GSERIALIZED *geo_from_text(const char *wkt, int32_t srid);
336extern char *geo_out(const GSERIALIZED *gs);
337extern GSERIALIZED *geog_from_binary(const char *wkb_bytea);
338extern GSERIALIZED *geog_from_hexewkb(const char *wkt);
339extern GSERIALIZED *geog_in(const char *str, int32 typmod);
340extern GSERIALIZED *geom_from_hexewkb(const char *wkt);
341extern GSERIALIZED *geom_in(const char *str, int32 typmod);
342
343/* Constructor functions */
344
345extern GSERIALIZED *geo_copy(const GSERIALIZED *g);
346extern GSERIALIZED *geogpoint_make2d(int32_t srid, double x, double y);
347extern GSERIALIZED *geogpoint_make3dz(int32_t srid, double x, double y, double z);
348extern GSERIALIZED *geompoint_make2d(int32_t srid, double x, double y);
349extern GSERIALIZED *geompoint_make3dz(int32_t srid, double x, double y, double z);
350
351/* Conversion functions */
352
353extern GSERIALIZED *geom_to_geog(const GSERIALIZED *geom);
354extern GSERIALIZED *geog_to_geom(const GSERIALIZED *geog);
355
356/* Accessor functions */
357
358extern bool geo_is_empty(const GSERIALIZED *g);
359extern bool geo_is_unitary(const GSERIALIZED *gs);
360extern const char *geo_typename(int type);
361extern double geog_area(const GSERIALIZED *g, bool use_spheroid);
362extern GSERIALIZED *geog_centroid(const GSERIALIZED *g, bool use_spheroid);
363extern double geog_length(const GSERIALIZED *g, bool use_spheroid);
364extern double geog_perimeter(const GSERIALIZED *g, bool use_spheroid);
365extern bool geom_azimuth(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double *result);
366extern double geom_length(const GSERIALIZED *gs);
367extern double geom_perimeter(const GSERIALIZED *gs);
368extern int line_numpoints(const GSERIALIZED *gs);
369extern GSERIALIZED *line_point_n(const GSERIALIZED *geom, int n);
370
371/* Transformation functions */
372
373extern GSERIALIZED *geo_reverse(const GSERIALIZED *gs);
374extern GSERIALIZED *geo_round(const GSERIALIZED *gs, int maxdd);
375
376/* Spatial reference system functions */
377
378extern GSERIALIZED *geo_set_srid(const GSERIALIZED *gs, int32_t srid);
379extern int32_t geo_srid(const GSERIALIZED *gs);
380extern GSERIALIZED *geo_transform(GSERIALIZED *geom, int32_t srid_to);
381extern GSERIALIZED *geo_transform_pipeline(const GSERIALIZED *gs, char *pipeline, int32_t srid_to, bool is_forward);
382
383/* Spatial processing functions */
384
385extern GSERIALIZED *geo_collect_garray(GSERIALIZED **gsarr, int count);
386extern GSERIALIZED *geo_makeline_garray(GSERIALIZED **gsarr, int count);
387extern int geo_npoints(const GSERIALIZED *gs);
388extern GSERIALIZED **geo_pointarr(const GSERIALIZED *gs, int *count);
390extern GSERIALIZED *geom_array_union(GSERIALIZED **gsarr, int count);
392extern GSERIALIZED *geom_buffer(const GSERIALIZED *gs, double size, char *params);
395extern GSERIALIZED *geom_difference2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
396extern GSERIALIZED *geom_intersection2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
398extern GSERIALIZED *geom_shortestline2d(const GSERIALIZED *gs1, const GSERIALIZED *s2);
399extern GSERIALIZED *geom_shortestline3d(const GSERIALIZED *gs1, const GSERIALIZED *s2);
400extern GSERIALIZED *geom_unary_union(GSERIALIZED *gs, double prec);
401extern GSERIALIZED *line_interpolate_point(GSERIALIZED *gs, double distance_fraction, bool repeat);
402extern double line_locate_point(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
403extern GSERIALIZED *line_substring(const GSERIALIZED *gs, double from, double to);
404
405/* Spatial relationship functions */
406
407extern bool geog_dwithin(const GSERIALIZED *g1, const GSERIALIZED *g2, double tolerance, bool use_spheroid);
408extern bool geog_intersects(const GSERIALIZED *gs1, const GSERIALIZED *gs2, bool use_spheroid);
409extern bool geom_contains(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
410extern bool geom_covers(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
411extern bool geom_disjoint2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
412extern bool geom_dwithin2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double tolerance);
413extern bool geom_dwithin3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double tolerance);
414extern bool geom_intersects2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
415extern bool geom_intersects3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
416extern bool geom_relate_pattern(const GSERIALIZED *gs1, const GSERIALIZED *gs2, char *patt);
417extern bool geom_touches(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
418
419/* Bounding box functions */
420
421extern STBox *geo_expand_space(const GSERIALIZED *gs, double d);
422extern STBox *geo_stboxes(const GSERIALIZED *gs, int *count);
423extern STBox *geo_split_each_n_stboxes(const GSERIALIZED *gs, int elem_count, int *count);
424extern STBox *geo_split_n_stboxes(const GSERIALIZED *gs, int box_count, int *count);
425
426/* Distance functions */
427
428extern double geog_distance(const GSERIALIZED *g1, const GSERIALIZED *g2);
429extern double geom_distance2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
430extern double geom_distance3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
431
432/* Comparison functions */
433
434extern int geo_equals(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
435extern bool geo_same(const GSERIALIZED *gs1, const GSERIALIZED *gs2);
436
437/*****************************************************************************
438 * Functions for spatial sets
439 *****************************************************************************/
440
441/* Input and output functions */
442
443extern Set *geogset_in(const char *str);
444extern Set *geomset_in(const char *str);
445extern char *spatialset_as_text(const Set *set, int maxdd);
446extern char *spatialset_as_ewkt(const Set *set, int maxdd);
447
448/* Constructor functions */
449
450extern Set *geoset_make(const GSERIALIZED **values, int count);
451
452/* Conversion functions */
453
454extern Set *geo_to_set(const GSERIALIZED *gs);
455
456/* Accessor functions */
457
458extern GSERIALIZED *geoset_end_value(const Set *s);
459extern GSERIALIZED *geoset_start_value(const Set *s);
460extern bool geoset_value_n(const Set *s, int n, GSERIALIZED **result);
461extern GSERIALIZED **geoset_values(const Set *s);
462
463/* Set operations */
464
465extern bool contained_geo_set(const GSERIALIZED *gs, const Set *s);
466extern bool contains_set_geo(const Set *s, GSERIALIZED *gs);
467extern Set *geo_union_transfn(Set *state, const GSERIALIZED *gs);
468extern Set *intersection_geo_set(const GSERIALIZED *gs, const Set *s);
469extern Set *intersection_set_geo(const Set *s, const GSERIALIZED *gs);
470extern Set *minus_geo_set(const GSERIALIZED *gs, const Set *s);
471extern Set *minus_set_geo(const Set *s, const GSERIALIZED *gs);
472extern Set *union_geo_set(const GSERIALIZED *gs, const Set *s);
473extern Set *union_set_geo(const Set *s, const GSERIALIZED *gs);
474
475/* SRID functions */
476
477extern Set *spatialset_set_srid(const Set *s, int32_t srid);
478extern int32_t spatialset_srid(const Set *s);
479extern Set *spatialset_transform(const Set *s, int32_t srid);
480extern Set *spatialset_transform_pipeline(const Set *s, const char *pipelinestr, int32_t srid, bool is_forward);
481
482/*****************************************************************************
483 * Functions for spatiotemporal boxes
484 *****************************************************************************/
485
486/* Input/output functions */
487
488extern char *stbox_as_hexwkb(const STBox *box, uint8_t variant, size_t *size);
489extern uint8_t *stbox_as_wkb(const STBox *box, uint8_t variant, size_t *size_out);
490extern STBox *stbox_from_hexwkb(const char *hexwkb);
491extern STBox *stbox_from_wkb(const uint8_t *wkb, size_t size);
492extern STBox *stbox_in(const char *str);
493extern char *stbox_out(const STBox *box, int maxdd);
494
495/* Constructor functions */
496
498extern STBox *geo_tstzspan_to_stbox(const GSERIALIZED *gs, const Span *s);
499extern STBox *stbox_copy(const STBox *box);
500extern STBox *stbox_make(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s);
501
502/* Conversion functions */
503
504extern STBox *geo_to_stbox(const GSERIALIZED *gs);
505extern STBox *spatialset_to_stbox(const Set *s);
506extern BOX3D *stbox_to_box3d(const STBox *box);
507extern GBOX *stbox_to_gbox(const STBox *box);
508extern GSERIALIZED *stbox_to_geo(const STBox *box);
509extern Span *stbox_to_tstzspan(const STBox *box);
511extern STBox *tstzset_to_stbox(const Set *s);
512extern STBox *tstzspan_to_stbox(const Span *s);
513extern STBox *tstzspanset_to_stbox(const SpanSet *ss);
514
515/* Accessor functions */
516
517extern double stbox_area(const STBox *box, bool spheroid);
518extern bool stbox_hast(const STBox *box);
519extern bool stbox_hasx(const STBox *box);
520extern bool stbox_hasz(const STBox *box);
521extern bool stbox_isgeodetic(const STBox *box);
522extern double stbox_perimeter(const STBox *box, bool spheroid);
523extern bool stbox_tmax(const STBox *box, TimestampTz *result);
524extern bool stbox_tmax_inc(const STBox *box, bool *result);
525extern bool stbox_tmin(const STBox *box, TimestampTz *result);
526extern bool stbox_tmin_inc(const STBox *box, bool *result);
527extern double stbox_volume(const STBox *box);
528extern bool stbox_xmax(const STBox *box, double *result);
529extern bool stbox_xmin(const STBox *box, double *result);
530extern bool stbox_ymax(const STBox *box, double *result);
531extern bool stbox_ymin(const STBox *box, double *result);
532extern bool stbox_zmax(const STBox *box, double *result);
533extern bool stbox_zmin(const STBox *box, double *result);
534
535/* Transformation functions */
536
537extern STBox *stbox_expand_space(const STBox *box, double d);
538extern STBox *stbox_expand_time(const STBox *box, const Interval *interv);
539extern STBox *stbox_get_space(const STBox *box);
540extern STBox *stbox_quad_split(const STBox *box, int *count);
541extern STBox *stbox_round(const STBox *box, int maxdd);
542extern STBox *stbox_shift_scale_time(const STBox *box, const Interval *shift, const Interval *duration);
543extern STBox *stboxarr_round(const STBox *boxarr, int count, int maxdd);
544
545/* SRID functions */
546
547extern STBox *stbox_set_srid(const STBox *box, int32_t srid);
548extern int32_t stbox_srid(const STBox *box);
549extern STBox *stbox_transform(const STBox *box, int32_t srid);
550extern STBox *stbox_transform_pipeline(const STBox *box, const char *pipelinestr, int32_t srid, bool is_forward);
551
552/* Topological functions */
553
554extern bool adjacent_stbox_stbox(const STBox *box1, const STBox *box2);
555extern bool contained_stbox_stbox(const STBox *box1, const STBox *box2);
556extern bool contains_stbox_stbox(const STBox *box1, const STBox *box2);
557extern bool overlaps_stbox_stbox(const STBox *box1, const STBox *box2);
558extern bool same_stbox_stbox(const STBox *box1, const STBox *box2);
559
560/* Position functions */
561
562extern bool above_stbox_stbox(const STBox *box1, const STBox *box2);
563extern bool after_stbox_stbox(const STBox *box1, const STBox *box2);
564extern bool back_stbox_stbox(const STBox *box1, const STBox *box2);
565extern bool before_stbox_stbox(const STBox *box1, const STBox *box2);
566extern bool below_stbox_stbox(const STBox *box1, const STBox *box2);
567extern bool front_stbox_stbox(const STBox *box1, const STBox *box2);
568extern bool left_stbox_stbox(const STBox *box1, const STBox *box2);
569extern bool overabove_stbox_stbox(const STBox *box1, const STBox *box2);
570extern bool overafter_stbox_stbox(const STBox *box1, const STBox *box2);
571extern bool overback_stbox_stbox(const STBox *box1, const STBox *box2);
572extern bool overbefore_stbox_stbox(const STBox *box1, const STBox *box2);
573extern bool overbelow_stbox_stbox(const STBox *box1, const STBox *box2);
574extern bool overfront_stbox_stbox(const STBox *box1, const STBox *box2);
575extern bool overleft_stbox_stbox(const STBox *box1, const STBox *box2);
576extern bool overright_stbox_stbox(const STBox *box1, const STBox *box2);
577extern bool right_stbox_stbox(const STBox *box1, const STBox *box2);
578
579/* Set functions */
580
581extern STBox *union_stbox_stbox(const STBox *box1, const STBox *box2, bool strict);
582extern STBox *intersection_stbox_stbox(const STBox *box1, const STBox *box2);
583
584/* Comparisons */
585
586extern int stbox_cmp(const STBox *box1, const STBox *box2);
587extern bool stbox_eq(const STBox *box1, const STBox *box2);
588extern bool stbox_ge(const STBox *box1, const STBox *box2);
589extern bool stbox_gt(const STBox *box1, const STBox *box2);
590extern bool stbox_le(const STBox *box1, const STBox *box2);
591extern bool stbox_lt(const STBox *box1, const STBox *box2);
592extern bool stbox_ne(const STBox *box1, const STBox *box2);
593
594/* RTree functions */
595
596extern RTree *rtree_create_stbox();
597extern void rtree_free(RTree *rtree);
598extern void rtree_insert(RTree *rtree, STBox *box, int64 id);
599extern int *rtree_search(const RTree *rtree,const STBox *query, int *count);
600
601/*****************************************************************************
602 * Functions for temporal geometries/geographies
603 *****************************************************************************/
604
605/* Input and output functions */
606
607extern char *tgeo_out(const Temporal *temp, int maxdd);
608extern Temporal *tgeogpoint_from_mfjson(const char *str);
609extern Temporal *tgeogpoint_in(const char *str);
610extern Temporal *tgeography_from_mfjson(const char *mfjson);
611extern Temporal *tgeography_in(const char *str);
612extern Temporal *tgeometry_from_mfjson(const char *str);
613extern Temporal *tgeometry_in(const char *str);
614extern Temporal *tgeompoint_from_mfjson(const char *str);
615extern Temporal *tgeompoint_in(const char *str);
616extern char *tspatial_as_ewkt(const Temporal *temp, int maxdd);
617extern char *tspatial_as_text(const Temporal *temp, int maxdd);
618
619/* Constructor functions */
620
621extern Temporal *tgeo_from_base_temp(const GSERIALIZED *gs, const Temporal *temp);
623extern TSequence *tgeoseq_from_base_tstzset(const GSERIALIZED *gs, const Set *s);
624extern TSequence *tgeoseq_from_base_tstzspan(const GSERIALIZED *gs, const Span *s, interpType interp);
626extern Temporal *tpoint_from_base_temp(const GSERIALIZED *gs, const Temporal *temp);
628extern TSequence *tpointseq_from_base_tstzset(const GSERIALIZED *gs, const Set *s);
629extern TSequence *tpointseq_from_base_tstzspan(const GSERIALIZED *gs, const Span *s, interpType interp);
631
632/* Conversion functions */
633
634extern STBox *box3d_to_stbox(const BOX3D *box);
635extern STBox *gbox_to_stbox(const GBOX *box);
637extern Temporal *tgeogpoint_to_tgeography(const Temporal *temp);
638extern Temporal *tgeography_to_tgeogpoint(const Temporal *temp);
639extern Temporal *tgeography_to_tgeometry(const Temporal *temp);
640extern Temporal *tgeometry_to_tgeography(const Temporal *temp);
641extern Temporal *tgeometry_to_tgeompoint(const Temporal *temp);
642extern Temporal *tgeompoint_to_tgeometry(const Temporal *temp);
643extern bool tpoint_as_mvtgeom(const Temporal *temp, const STBox *bounds, int32_t extent, int32_t buffer, bool clip_geom, GSERIALIZED **gsarr, int64 **timesarr, int *count);
644extern bool tpoint_tfloat_to_geomeas(const Temporal *tpoint, const Temporal *measure, bool segmentize, GSERIALIZED **result);
645extern STBox *tspatial_to_stbox(const Temporal *temp);
646
647/* Accessor functions */
648
649extern bool bearing_point_point(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double *result);
650extern Temporal *bearing_tpoint_point(const Temporal *temp, const GSERIALIZED *gs, bool invert);
651extern Temporal *bearing_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2);
652extern Temporal *tgeo_centroid(const Temporal *temp);
653extern GSERIALIZED *tgeo_convex_hull(const Temporal *temp);
654extern GSERIALIZED *tgeo_end_value(const Temporal *temp);
655extern GSERIALIZED *tgeo_start_value(const Temporal *temp);
656extern GSERIALIZED *tgeo_traversed_area(const Temporal *temp);
657extern bool tgeo_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, GSERIALIZED **value);
658extern bool tgeo_value_n(const Temporal *temp, int n, GSERIALIZED **result);
659extern GSERIALIZED **tgeo_values(const Temporal *temp, int *count);
660extern Temporal *tpoint_angular_difference(const Temporal *temp);
661extern Temporal *tpoint_azimuth(const Temporal *temp);
662extern Temporal *tpoint_cumulative_length(const Temporal *temp);
663extern bool tpoint_direction(const Temporal *temp, double *result);
664extern Temporal *tpoint_get_x(const Temporal *temp);
665extern Temporal *tpoint_get_y(const Temporal *temp);
666extern Temporal *tpoint_get_z(const Temporal *temp);
667extern bool tpoint_is_simple(const Temporal *temp);
668extern double tpoint_length(const Temporal *temp);
669extern Temporal *tpoint_speed(const Temporal *temp);
670extern GSERIALIZED *tpoint_trajectory(const Temporal *temp);
671extern GSERIALIZED *tpoint_twcentroid(const Temporal *temp);
672
673/* Transformation functions */
674
675extern Temporal *tgeo_affine(const Temporal *temp, const AFFINE *a);
676extern Temporal *tgeo_scale(const Temporal *temp, const GSERIALIZED *scale, const GSERIALIZED *sorigin);
677extern Temporal **tpoint_make_simple(const Temporal *temp, int *count);
678
679/* SRID functions */
680
681int32_t tspatial_srid(const Temporal *temp);
682extern Temporal *tspatial_set_srid(const Temporal *temp, int32_t srid);
683extern Temporal *tspatial_transform(const Temporal *temp, int32_t srid);
684extern Temporal *tspatial_transform_pipeline(const Temporal *temp, const char *pipelinestr, int32_t srid, bool is_forward);
685
686/* Restriction functions */
687
688extern Temporal *tgeo_at_geom(const Temporal *temp, const GSERIALIZED *gs);
689extern Temporal *tgeo_at_stbox(const Temporal *temp, const STBox *box, bool border_inc);
690extern Temporal *tgeo_at_value(const Temporal *temp, GSERIALIZED *gs);
691extern Temporal *tgeo_minus_geom(const Temporal *temp, const GSERIALIZED *gs);
692extern Temporal *tgeo_minus_stbox(const Temporal *temp, const STBox *box, bool border_inc);
693extern Temporal *tgeo_minus_value(const Temporal *temp, GSERIALIZED *gs);
694extern Temporal *tpoint_at_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan);
695extern Temporal *tpoint_at_value(const Temporal *temp, GSERIALIZED *gs);
696extern Temporal *tpoint_minus_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan);
697extern Temporal *tpoint_minus_value(const Temporal *temp, GSERIALIZED *gs);
698
699/* Ever and always comparisons */
700
701extern int always_eq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
702extern int always_eq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
703extern int always_eq_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
704extern int always_ne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
705extern int always_ne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
706extern int always_ne_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
707extern int ever_eq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
708extern int ever_eq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
709extern int ever_eq_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
710extern int ever_ne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
711extern int ever_ne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
712extern int ever_ne_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
713
714/* Temporal comparisons */
715
716extern Temporal *teq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
717extern Temporal *teq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
718extern Temporal *tne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
719extern Temporal *tne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
720
721/* Bounding box functions */
722
723extern STBox *tspatial_expand_space(const Temporal *temp, double d);
724extern STBox *tgeo_stboxes(const Temporal *temp, int *count);
725extern STBox *tgeo_space_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, int *count);
726extern STBox *tgeo_space_time_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, int *count);
727extern STBox *tgeo_split_each_n_stboxes(const Temporal *temp, int elem_count, int *count);
728extern STBox *tgeo_split_n_stboxes(const Temporal *temp, int box_count, int *count);
729
730/* Topological functions */
731
732extern bool adjacent_stbox_tspatial(const STBox *box, const Temporal *temp);
733extern bool adjacent_tspatial_stbox(const Temporal *temp, const STBox *box);
734extern bool adjacent_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
735extern bool contained_stbox_tspatial(const STBox *box, const Temporal *temp);
736extern bool contained_tspatial_stbox(const Temporal *temp, const STBox *box);
737extern bool contained_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
738extern bool contains_stbox_tspatial(const STBox *box, const Temporal *temp);
739extern bool contains_tspatial_stbox(const Temporal *temp, const STBox *box);
740extern bool contains_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
741extern bool overlaps_stbox_tspatial(const STBox *box, const Temporal *temp);
742extern bool overlaps_tspatial_stbox(const Temporal *temp, const STBox *box);
743extern bool overlaps_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
744extern bool same_stbox_tspatial(const STBox *box, const Temporal *temp);
745extern bool same_tspatial_stbox(const Temporal *temp, const STBox *box);
746extern bool same_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
747
748/* Position functions */
749
750extern bool above_stbox_tspatial(const STBox *box, const Temporal *temp);
751extern bool above_tspatial_stbox(const Temporal *temp, const STBox *box);
752extern bool above_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
753extern bool after_stbox_tspatial(const STBox *box, const Temporal *temp);
754extern bool after_tspatial_stbox(const Temporal *temp, const STBox *box);
755extern bool after_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
756extern bool back_stbox_tspatial(const STBox *box, const Temporal *temp);
757extern bool back_tspatial_stbox(const Temporal *temp, const STBox *box);
758extern bool back_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
759extern bool before_stbox_tspatial(const STBox *box, const Temporal *temp);
760extern bool before_tspatial_stbox(const Temporal *temp, const STBox *box);
761extern bool before_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
762extern bool below_stbox_tspatial(const STBox *box, const Temporal *temp);
763extern bool below_tspatial_stbox(const Temporal *temp, const STBox *box);
764extern bool below_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
765extern bool front_stbox_tspatial(const STBox *box, const Temporal *temp);
766extern bool front_tspatial_stbox(const Temporal *temp, const STBox *box);
767extern bool front_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
768extern bool left_stbox_tspatial(const STBox *box, const Temporal *temp);
769extern bool left_tspatial_stbox(const Temporal *temp, const STBox *box);
770extern bool left_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
771extern bool overabove_stbox_tspatial(const STBox *box, const Temporal *temp);
772extern bool overabove_tspatial_stbox(const Temporal *temp, const STBox *box);
773extern bool overabove_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
774extern bool overafter_stbox_tspatial(const STBox *box, const Temporal *temp);
775extern bool overafter_tspatial_stbox(const Temporal *temp, const STBox *box);
776extern bool overafter_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
777extern bool overback_stbox_tspatial(const STBox *box, const Temporal *temp);
778extern bool overback_tspatial_stbox(const Temporal *temp, const STBox *box);
779extern bool overback_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
780extern bool overbefore_stbox_tspatial(const STBox *box, const Temporal *temp);
781extern bool overbefore_tspatial_stbox(const Temporal *temp, const STBox *box);
782extern bool overbefore_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
783extern bool overbelow_stbox_tspatial(const STBox *box, const Temporal *temp);
784extern bool overbelow_tspatial_stbox(const Temporal *temp, const STBox *box);
785extern bool overbelow_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
786extern bool overfront_stbox_tspatial(const STBox *box, const Temporal *temp);
787extern bool overfront_tspatial_stbox(const Temporal *temp, const STBox *box);
788extern bool overfront_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
789extern bool overleft_stbox_tspatial(const STBox *box, const Temporal *temp);
790extern bool overleft_tspatial_stbox(const Temporal *temp, const STBox *box);
791extern bool overleft_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
792extern bool overright_stbox_tspatial(const STBox *box, const Temporal *temp);
793extern bool overright_tspatial_stbox(const Temporal *temp, const STBox *box);
794extern bool overright_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
795extern bool right_stbox_tspatial(const STBox *box, const Temporal *temp);
796extern bool right_tspatial_stbox(const Temporal *temp, const STBox *box);
797extern bool right_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2);
798
799/* Ever and always spatial relationships */
800
801extern int acontains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
802extern int acontains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
803extern int acontains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
804extern int adisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
805extern int adisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
806extern int adwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist);
807extern int adwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist);
808extern int aintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
809extern int aintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
810extern int atouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
811extern int atouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
812extern int atouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs);
813extern int econtains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
814extern int econtains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
815extern int econtains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
816extern int ecovers_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp);
817extern int ecovers_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
818extern int ecovers_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
819extern int edisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
820extern int edisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
821extern int edwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist);
822extern int edwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist);
823extern int eintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
824extern int eintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
825extern int etouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
826extern int etouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
827extern int etouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs);
828
829/* Spatiotemporal relationships */
830
831extern Temporal *tcontains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue);
832extern Temporal *tcontains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue);
833extern Temporal *tcontains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue);
834extern Temporal *tcovers_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue);
835extern Temporal *tcovers_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue);
836extern Temporal *tcovers_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue);
837extern Temporal *tdisjoint_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue);
838extern Temporal *tdisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue);
839extern Temporal *tdisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue);
840extern Temporal *tdwithin_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, double dist, bool restr, bool atvalue);
841extern Temporal *tdwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist, bool restr, bool atvalue);
842extern Temporal *tdwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist, bool restr, bool atvalue);
843extern Temporal *tintersects_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue);
844extern Temporal *tintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue);
845extern Temporal *tintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue);
846extern Temporal *ttouches_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue);
847extern Temporal *ttouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue);
848extern Temporal *ttouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue);
849
850/* Distance */
851
852extern Temporal *distance_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
853extern Temporal *distance_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
854extern double nad_stbox_geo(const STBox *box, const GSERIALIZED *gs);
855extern double nad_stbox_stbox(const STBox *box1, const STBox *box2);
856extern double nad_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
857extern double nad_tgeo_stbox(const Temporal *temp, const STBox *box);
858extern double nad_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
859extern TInstant *nai_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
860extern TInstant *nai_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
861extern GSERIALIZED *shortestline_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs);
862extern GSERIALIZED *shortestline_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2);
863
864/* Aggregates */
865
868extern STBox *tspatial_extent_transfn(STBox *box, const Temporal *temp);
869
870/* Tile functions */
871
872extern STBox *stbox_get_space_tile(const GSERIALIZED *point, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin);
873extern STBox *stbox_get_space_time_tile(const GSERIALIZED *point, TimestampTz t, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin);
874extern STBox *stbox_get_time_tile(TimestampTz t, const Interval *duration, TimestampTz torigin);
875extern STBox *stbox_space_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool border_inc, int *count);
876extern STBox *stbox_space_time_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool border_inc, int *count);
877extern STBox *stbox_time_tiles(const STBox *bounds, const Interval *duration, TimestampTz torigin, bool border_inc, int *count);
878extern Temporal **tgeo_space_split(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, int *count);
879extern Temporal **tgeo_space_time_split(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, TimestampTz **time_bins, int *count);
880
881
882/*****************************************************************************/
883
884#endif
Temporal * tpoint_angular_difference(const Temporal *temp)
Return the temporal angular difference of a temporal geometry point.
Definition: tpoint_spatialfuncs.c:3235
double tpoint_length(const Temporal *temp)
Return the length traversed by a temporal point sequence (set)
Definition: tpoint_spatialfuncs.c:2648
bool tgeo_value_at_timestamptz(const Temporal *temp, TimestampTz t, bool strict, GSERIALIZED **value)
Return the value of a temporal geo at a timestamptz.
Definition: tgeo_restrict.c:133
GSERIALIZED * tgeo_convex_hull(const Temporal *temp)
Return the convex hull of a temporal geo.
Definition: tgeo_spatialfuncs.c:1581
GSERIALIZED * tgeo_traversed_area(const Temporal *temp)
Return the traversed area of a temporal geo or the trajectory for a temporal point with discrete or s...
Definition: tgeo_spatialfuncs.c:1604
GSERIALIZED * tpoint_twcentroid(const Temporal *temp)
Return the time-weighed centroid of a temporal geometry point.
Definition: tpoint_spatialfuncs.c:2958
Temporal * tpoint_speed(const Temporal *temp)
Return the speed of a temporal point.
Definition: tpoint_spatialfuncs.c:2832
GSERIALIZED * tpoint_trajectory(const Temporal *temp)
Return the trajectory of a temporal point.
Definition: tpoint_spatialfuncs.c:1236
GSERIALIZED * tgeo_end_value(const Temporal *temp)
Return a copy of the end value of a temporal geo.
Definition: tgeo_meos.c:728
bool bearing_point_point(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double *result)
Return the temporal bearing between two geometry/geography points.
Definition: tpoint_spatialfuncs.c:3480
GSERIALIZED ** tgeo_values(const Temporal *temp, int *count)
Return the array of copies of base values of a temporal geo.
Definition: tgeo_meos.c:763
bool tgeo_value_n(const Temporal *temp, int n, GSERIALIZED **result)
Return a copy of the n-th value of a temporal geo.
Definition: tgeo_meos.c:744
Temporal * tpoint_get_y(const Temporal *temp)
Return the Y coordinates of a temporal point as a temporal float.
Definition: tpoint_spatialfuncs.c:206
Temporal * tgeo_centroid(const Temporal *temp)
Return the centroid of a temporal geo as a temporal point.
Definition: tgeo_spatialfuncs.c:1633
Temporal * tpoint_cumulative_length(const Temporal *temp)
Return the cumulative length traversed by a temporal point.
Definition: tpoint_spatialfuncs.c:2740
Temporal * tpoint_get_z(const Temporal *temp)
Return the Z coordinates of a temporal point as a temporal float.
Definition: tpoint_spatialfuncs.c:219
bool tpoint_is_simple(const Temporal *temp)
Return true if a temporal point does not self-intersect.
Definition: tpoint_spatialfuncs.c:4274
Temporal * bearing_tpoint_tpoint(const Temporal *temp1, const Temporal *temp2)
Return the temporal bearing between two temporal points.
Definition: tpoint_spatialfuncs.c:3533
GSERIALIZED * tgeo_start_value(const Temporal *temp)
Return a copy of the start value of a temporal geo.
Definition: tgeo_meos.c:713
Temporal * tpoint_get_x(const Temporal *temp)
Return the X coordinates of a temporal point as a temporal float.
Definition: tpoint_spatialfuncs.c:193
Temporal * bearing_tpoint_point(const Temporal *temp, const GSERIALIZED *gs, bool invert)
Return the temporal bearing between a temporal point and a point.
Definition: tpoint_spatialfuncs.c:3505
bool tpoint_direction(const Temporal *temp, double *result)
Return the direction of a temporal point.
Definition: tpoint_spatialfuncs.c:3080
Temporal * tpoint_azimuth(const Temporal *temp)
Return the temporal azimuth of a temporal geometry point.
Definition: tpoint_spatialfuncs.c:3214
Temporal * tpoint_tcentroid_finalfn(SkipList *state)
Final function for temporal centroid aggregation of temporal points.
Definition: tgeo_aggfuncs.c:379
SkipList * tpoint_tcentroid_transfn(SkipList *state, Temporal *temp)
Transition function for temporal centroid aggregation of temporal points.
Definition: tgeo_aggfuncs.c:211
STBox * tspatial_extent_transfn(STBox *box, const Temporal *temp)
Transition function for temporal extent aggregation of spatiotemporal values.
Definition: tgeo_aggfuncs.c:256
double geom_length(const GSERIALIZED *gs)
Return the length of a geometry.
Definition: postgis_funcs.c:458
bool geom_azimuth(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double *result)
Return in the last argument the azimuth of a segment defined by two points.
Definition: postgis_funcs.c:703
double geom_perimeter(const GSERIALIZED *gs)
Return the perimeter of a geometry.
Definition: postgis_funcs.c:481
bool geo_is_empty(const GSERIALIZED *g)
Get the SRID of a geometry/geography.
Definition: postgis_funcs.c:188
double geog_area(const GSERIALIZED *g, bool use_spheroid)
Returns the area of a geography in square meters.
Definition: postgis_funcs.c:2405
int line_numpoints(const GSERIALIZED *gs)
Return the number of points of a line.
Definition: postgis_funcs.c:3849
double geog_perimeter(const GSERIALIZED *g, bool use_spheroid)
Returns the perimeter of a geography in meters.
Definition: postgis_funcs.c:2476
GSERIALIZED * line_point_n(const GSERIALIZED *geom, int n)
Return the n-th point of a line.
Definition: postgis_funcs.c:3802
double geog_length(const GSERIALIZED *g, bool use_spheroid)
Return double length in meters.
Definition: postgis_funcs.c:2532
GSERIALIZED * geog_centroid(const GSERIALIZED *g, bool use_spheroid)
Return the centroid of a geometry.
Definition: postgis_funcs.c:2292
const char * geo_typename(int type)
Return a string representation of a geometry's type.
Definition: postgis_funcs.c:3785
STBox * geo_stboxes(const GSERIALIZED *gs, int *count)
Return an array of spatial boxes from the segments of a (mult)linestring.
Definition: tgeo_boxops.c:1132
STBox * geo_split_each_n_stboxes(const GSERIALIZED *gs, int elem_count, int *count)
Return an array of spatial boxes from the segments of a (multi)linestring @csqlfn Geo_split_each_n_st...
Definition: tgeo_boxops.c:1559
STBox * geo_split_n_stboxes(const GSERIALIZED *gs, int box_count, int *count)
Return an array of N spatial boxes from the segments of a (multi)linestring @sqlfn splitNStboxes()
Definition: tgeo_boxops.c:1376
bool geo_same(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if the geometries/geographies are the same.
Definition: postgis_funcs.c:3272
int geo_equals(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if the geometries/geographies are equal, false otherwise.
Definition: postgis_funcs.c:1869
GSERIALIZED * geompoint_make3dz(int32_t srid, double x, double y, double z)
Return a 3DZ geometry point constructed from the arguments.
Definition: postgis_funcs.c:129
GSERIALIZED * geompoint_make2d(int32_t srid, double x, double y)
Return a 2D geometry point constructed from the arguments.
Definition: postgis_funcs.c:102
GSERIALIZED * geo_copy(const GSERIALIZED *g)
Return a copy of a geometry.
Definition: postgis_funcs.c:88
GSERIALIZED * geogpoint_make2d(int32_t srid, double x, double y)
Return a 2D geography point constructed from the arguments.
Definition: postgis_funcs.c:115
GSERIALIZED * geogpoint_make3dz(int32_t srid, double x, double y, double z)
Return a 3DZ geography point constructed from the arguments.
Definition: postgis_funcs.c:141
GSERIALIZED * geog_to_geom(const GSERIALIZED *geog)
Return a geometry from a geography.
Definition: postgis_funcs.c:3481
GSERIALIZED * geom_to_geog(const GSERIALIZED *geom)
Return a geography from a geometry.
Definition: postgis_funcs.c:3444
double geom_distance3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return the 3D distance between two geometries.
Definition: postgis_funcs.c:589
double geog_distance(const GSERIALIZED *g1, const GSERIALIZED *g2)
Return the distance between two geographies.
Definition: postgis_funcs.c:2641
double geom_distance2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return the distance between two geometries.
Definition: postgis_funcs.c:565
char * geo_as_hexewkb(const GSERIALIZED *gs, const char *endian)
Return the ASCII hex-encoded Well-Known Binary (HexWKB) representation of a geometry/geography.
Definition: postgis_funcs.c:3075
char * geo_out(const GSERIALIZED *gs)
Return the ASCII hex-encoded Well-Known Binary (HexWKB) representation of a geometry/geography.
Definition: postgis_funcs.c:2926
GSERIALIZED * geom_in(const char *str, int32 typmod)
Return a geometry from its Well-Known Text (WKT), Well-Known Binary (WKB) or GeoJSON representation.
Definition: postgis_funcs.c:2812
GSERIALIZED * geo_from_ewkb(const uint8_t *wkb, size_t wkb_size, int32 srid)
Return a geometry/geography from its EWKB representation.
Definition: postgis_funcs.c:3108
GSERIALIZED * geog_in(const char *str, int32 typmod)
Return a geography from its Well-Known Text or Binary (WKT or Binary) representation.
Definition: postgis_funcs.c:3354
GSERIALIZED * geo_from_text(const char *wkt, int32_t srid)
Return a geometry/geography from its WKT representation (and optionally a SRID)
Definition: postgis_funcs.c:2946
GSERIALIZED * geog_from_hexewkb(const char *wkt)
Return a geography from its ASCII hex-encoded Well-Known Binary (HexEWKB) representation.
Definition: postgis_funcs.c:3061
char * geo_as_ewkt(const GSERIALIZED *gs, int precision)
Return the Extended Well-Known Text (EWKT) representation of a geometry/geography.
Definition: postgis_funcs.c:3029
GSERIALIZED * geom_from_hexewkb(const char *wkt)
Return a geometry from its ASCII hex-encoded Well-Known Binary (HexEWKB) representation.
Definition: postgis_funcs.c:3046
uint8_t * geo_as_ewkb(const GSERIALIZED *gs, const char *endian, size_t *size)
Return the Extended Well-Known Binary (EWKB) representation of a geometry/geography.
Definition: postgis_funcs.c:3142
GSERIALIZED * geog_from_binary(const char *wkb_bytea)
Return a geography from its binary representation.
Definition: postgis_funcs.c:3412
char * geo_as_geojson(const GSERIALIZED *gs, int option, int precision, const char *srs)
Return the GeoJSON representation of a geometry/geography.
Definition: postgis_funcs.c:3217
GSERIALIZED * geo_from_geojson(const char *geojson)
Return a geometry/geography from its GeoJSON representation.
Definition: postgis_funcs.c:3177
char * geo_as_text(const GSERIALIZED *gs, int precision)
Return the Well-Known Text (WKT) representation of a geometry/geography.
Definition: postgis_funcs.c:3012
bool geom_relate_pattern(const GSERIALIZED *gs1, const GSERIALIZED *gs2, char *patt)
Return true if two geometries satisfy a spatial relationship given by a pattern.
Definition: postgis_funcs.c:1270
bool geom_touches(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if the two geometries intersect on a border.
Definition: postgis_funcs.c:1229
bool geom_covers(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if the first geometry covers the second one.
Definition: postgis_funcs.c:1242
bool geog_intersects(const GSERIALIZED *gs1, const GSERIALIZED *gs2, bool use_spheroid)
Return true if the geographies intersect.
Definition: postgis_funcs.c:2622
bool geom_dwithin2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double tolerance)
Return true if two geometries are within a distance.
Definition: postgis_funcs.c:634
bool geom_intersects3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if the 3D geometries intersect.
Definition: postgis_funcs.c:613
bool geom_intersects2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if two geometries intersects.
Definition: postgis_funcs.c:1203
bool geom_dwithin3d(const GSERIALIZED *gs1, const GSERIALIZED *gs2, double tolerance)
Return true if two geometries are within a distance.
Definition: postgis_funcs.c:660
bool geom_contains(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if the first geometry contains the second one.
Definition: postgis_funcs.c:1216
bool geog_dwithin(const GSERIALIZED *g1, const GSERIALIZED *g2, double tolerance, bool use_spheroid)
Return true if two geographies are within a distance.
Definition: postgis_funcs.c:2578
bool geom_disjoint2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return true if two geometries are disjoint in 2D.
Definition: postgis_funcs.c:1254
GSERIALIZED * geom_difference2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return the difference of two geometries.
Definition: postgis_funcs.c:1344
GSERIALIZED * line_interpolate_point(GSERIALIZED *gs, double distance_fraction, bool repeat)
Interpolate one or several points from a line.
Definition: postgis_funcs.c:3534
GSERIALIZED * geom_unary_union(GSERIALIZED *gs, double prec)
Return the unary union of a geometry.
Definition: postgis_funcs.c:1488
GSERIALIZED * geom_convex_hull(const GSERIALIZED *gs)
Return the convex hull of the geometry.
Definition: postgis_funcs.c:1506
GSERIALIZED * geom_shortestline3d(const GSERIALIZED *gs1, const GSERIALIZED *s2)
Return the shortest line between two 3D geometries.
Definition: postgis_funcs.c:542
GSERIALIZED * geom_shortestline2d(const GSERIALIZED *gs1, const GSERIALIZED *s2)
Return the shortest 2D line between two geometries.
Definition: postgis_funcs.c:520
GSERIALIZED * geom_centroid(const GSERIALIZED *gs)
Return the centroid of a geometry.
Definition: postgis_funcs.c:965
GSERIALIZED * geo_collect_garray(GSERIALIZED **gsarr, int count)
Collect the array of geometries/geographies into a geo collection.
Definition: postgis_funcs.c:769
GSERIALIZED * geo_makeline_garray(GSERIALIZED **gsarr, int count)
Return a line from an array of geometries/geographies.
Definition: postgis_funcs.c:846
GSERIALIZED * geom_array_union(GSERIALIZED **gsarr, int count)
Return the union of an array of geometries.
Definition: postgis_funcs.c:1366
GSERIALIZED * geom_buffer(const GSERIALIZED *gs, double size, char *params)
Return a POLYGON or a MULTIPOLYGON that represents all points whose distance from a geometry/geograph...
Definition: postgis_funcs.c:1582
GSERIALIZED * geom_intersection2d(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Return the intersection of two geometries.
Definition: postgis_funcs.c:1325
int geo_npoints(const GSERIALIZED *gs)
Return the number of points of a geometry.
Definition: postgis_funcs.c:946
GSERIALIZED * geom_boundary(const GSERIALIZED *gs)
Return the boundary of a geometry.
Definition: postgis_funcs.c:496
double line_locate_point(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
Locate a point into a line.
Definition: postgis_funcs.c:3719
GSERIALIZED * line_substring(const GSERIALIZED *gs, double from, double to)
Return a subline from a line.
Definition: postgis_funcs.c:3575
GSERIALIZED * geo_transform(GSERIALIZED *geom, int32_t srid_to)
Returns the geometry/geography transformed to an SRID.
Definition: postgis_funcs.c:1996
GSERIALIZED * geo_transform_pipeline(const GSERIALIZED *gs, char *pipeline, int32_t srid_to, bool is_forward)
Return a geometry/geography transformed to another SRID using a pipeline.
Definition: postgis_funcs.c:2052
GSERIALIZED * geo_set_srid(const GSERIALIZED *gs, int32_t srid)
Set the SRID of a geometry/geography.
Definition: postgis_funcs.c:174
int32_t geo_srid(const GSERIALIZED *gs)
Get the SRID of a geometry/geography.
Definition: postgis_funcs.c:161
GSERIALIZED * geo_reverse(const GSERIALIZED *gs)
Reverse vertex order of a geometry.
Definition: postgis_funcs.c:684
GSERIALIZED * geo_round(const GSERIALIZED *gs, int maxdd)
Return a geometry with the precision of the coordinates set to a number of decimal places.
Definition: geo_round.c:529
bool left_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is to the left of the second one.
Definition: tspatial_posops_meos.c:512
bool overleft_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box does not extend to the right of a spatiotemporal value.
Definition: tspatial_posops_meos.c:78
bool above_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is above a spatiotemporal value.
Definition: tspatial_posops_meos.c:146
bool after_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is after a spatiotemporal value.
Definition: tspatial_posops_meos.c:257
bool overbefore_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is not after a spatiotemporal box.
Definition: tspatial_posops_meos.c:469
bool below_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is below a spatiotemporal value.
Definition: tspatial_posops_meos.c:119
bool right_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is to the right of a temporal point.
Definition: tspatial_posops_meos.c:92
bool back_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is at the back of a spatiotemporal box.
Definition: tspatial_posops_meos.c:427
bool overfront_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value does not extend to the back of the second one.
Definition: tspatial_posops_meos.c:630
bool overbelow_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value does not extend above a spatiotemporal box.
Definition: tspatial_posops_meos.c:358
bool overbelow_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value does not extend above the second one.
Definition: tspatial_posops_meos.c:577
bool overfront_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box does not extend to the back of a spatiotemporal value.
Definition: tspatial_posops_meos.c:188
bool overafter_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is not before the second one.
Definition: tspatial_posops_meos.c:708
bool after_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is after a spatiotemporal box.
Definition: tspatial_posops_meos.c:482
bool below_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is below the second one.
Definition: tspatial_posops_meos.c:564
bool right_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is to the right of the second one.
Definition: tspatial_posops_meos.c:538
bool overabove_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value does not extend below the second one.
Definition: tspatial_posops_meos.c:604
bool after_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is after the second one.
Definition: tspatial_posops_meos.c:695
bool before_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is before a spatiotemporal box.
Definition: tspatial_posops_meos.c:455
bool overfront_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value does not extend to the back of a spatiotemporal box.
Definition: tspatial_posops_meos.c:413
bool back_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is at the back of a temporal point.
Definition: tspatial_posops_meos.c:202
bool front_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is in front of a spatiotemporal value.
Definition: tspatial_posops_meos.c:174
bool above_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is above a spatiotemporal box.
Definition: tspatial_posops_meos.c:371
bool overbefore_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is not after the second one.
Definition: tspatial_posops_meos.c:682
bool before_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is before a spatiotemporal value.
Definition: tspatial_posops_meos.c:230
bool overafter_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is not before a spatiotemporal box.
Definition: tspatial_posops_meos.c:496
bool overback_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value does not extend to the front of a spatiotemporal box.
Definition: tspatial_posops_meos.c:441
bool front_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is in front of a spatiotemporal box.
Definition: tspatial_posops_meos.c:399
bool above_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is above the second one.
Definition: tspatial_posops_meos.c:590
bool front_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is in front of the second one.
Definition: tspatial_posops_meos.c:617
bool overabove_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value does not extend below a spatiotemporal box.
Definition: tspatial_posops_meos.c:385
bool overbefore_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is not after a spatiotemporal value.
Definition: tspatial_posops_meos.c:244
bool overback_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value does not extend to the front of the second one.
Definition: tspatial_posops_meos.c:656
bool overabove_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box does not extend below a temporal point.
Definition: tspatial_posops_meos.c:160
bool overright_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value does not extend to the left of the second one.
Definition: tspatial_posops_meos.c:551
bool below_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is below a spatiotemporal box.
Definition: tspatial_posops_meos.c:344
bool overback_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box does not extend to the front of a spatiotemporal value.
Definition: tspatial_posops_meos.c:216
bool overright_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value does not extend to the left of a spatiotemporal box.
Definition: tspatial_posops_meos.c:331
bool overleft_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value does not extend to the right of a spatiotemporal box.
Definition: tspatial_posops_meos.c:303
bool back_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is at the back of the second one.
Definition: tspatial_posops_meos.c:643
bool overbelow_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box does not extend above a temporal point.
Definition: tspatial_posops_meos.c:133
bool overafter_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is not before a spatiotemporal value.
Definition: tspatial_posops_meos.c:271
bool before_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value is before the second one.
Definition: tspatial_posops_meos.c:669
bool overright_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box does not extend to the left of a spatiotemporal value.
Definition: tspatial_posops_meos.c:106
bool right_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is to the right of a spatiotemporal box.
Definition: tspatial_posops_meos.c:317
bool left_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is to the left of a temporal point.
Definition: tspatial_posops_meos.c:64
bool left_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if a spatiotemporal value is to the left of a spatiotemporal box.
Definition: tspatial_posops_meos.c:289
bool overleft_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the first spatiotemporal value does not extend to the right of the second one.
Definition: tspatial_posops_meos.c:525
STBox * tgeo_split_each_n_stboxes(const Temporal *temp, int elem_count, int *count)
Return an array of spatiotemporal boxes obtained by merging consecutive instants or segments of a tem...
Definition: tgeo_boxops.c:913
STBox * tgeo_split_n_stboxes(const Temporal *temp, int box_count, int *count)
Return an array of N spatiotemporal boxes obtained by merging consecutive instants or segments of a t...
Definition: tgeo_boxops.c:740
STBox * tgeo_stboxes(const Temporal *temp, int *count)
Return an array of spatiotemporal boxes from the instants or segments of a temporal geo,...
Definition: tgeo_boxops.c:501
bool same_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box and the spatiotemporal box of a spatiotemporal value are equal in...
Definition: tspatial_topops_meos.c:200
bool adjacent_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the spatiotemporal boxes of two spatiotemporal values are adjacent.
Definition: tspatial_topops_meos.c:272
bool contained_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the spatiotemporal box of the first spatiotemporal value is contained in the one of th...
Definition: tspatial_topops_meos.c:182
bool overlaps_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if the spatiotemporal box of a spatiotemporal value and a spatiotemporal box overlap.
Definition: tspatial_topops_meos.c:79
bool overlaps_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the spatiotemporal boxes of two spatiotemporal values overlap.
Definition: tspatial_topops_meos.c:92
bool contains_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if the spatiotemporal box of a spatiotemporal value contains a spatiotemporal box.
Definition: tspatial_topops_meos.c:124
bool adjacent_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if the spatiotemporal box of a spatiotemporal value and a spatiotemporal box are adjacent...
Definition: tspatial_topops_meos.c:259
bool adjacent_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box and the spatiotemporal box of a spatiotemporal value are adjacent...
Definition: tspatial_topops_meos.c:245
bool contains_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box contains the one of a temporal point.
Definition: tspatial_topops_meos.c:110
bool contained_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box is contained in the spatiotemporal box of a spatiotemporal value.
Definition: tspatial_topops_meos.c:155
bool same_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the spatiotemporal boxes of two spatiotemporal values are equal in the common dimensio...
Definition: tspatial_topops_meos.c:227
bool contained_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if the spatiotemporal box of a spatiotemporal value is contained in the spatiotemporal bo...
Definition: tspatial_topops_meos.c:169
bool same_tspatial_stbox(const Temporal *temp, const STBox *box)
Return true if the spatiotemporal box of a spatiotemporal value and a spatiotemporal box are equal in...
Definition: tspatial_topops_meos.c:214
bool overlaps_stbox_tspatial(const STBox *box, const Temporal *temp)
Return true if a spatiotemporal box and the spatiotemporal box of a spatiotemporal value overlap.
Definition: tspatial_topops_meos.c:65
bool contains_tspatial_tspatial(const Temporal *temp1, const Temporal *temp2)
Return true if the spatiotemporal box of the first spatiotemporal value contains the one of the secon...
Definition: tspatial_topops_meos.c:137
double stbox_area(const STBox *box, bool spheroid)
Return the area of a spatiotemporal box.
Definition: stbox.c:1319
bool stbox_xmax(const STBox *box, double *result)
Return in the last argument the maximum X value of a spatiotemporal box.
Definition: stbox.c:1139
bool stbox_hasz(const STBox *box)
Return true if a spatiotemporal box has Z dimension.
Definition: stbox.c:1073
bool stbox_zmax(const STBox *box, double *result)
Return in the last argument the maximum Z value of a spatiotemporal box.
Definition: stbox.c:1219
bool stbox_tmax_inc(const STBox *box, bool *result)
Return in the last argument whether the maximum T value of a spatiotemporal box is inclusive.
Definition: stbox.c:1299
bool stbox_xmin(const STBox *box, double *result)
Return in the last argument the minimum X value of a spatiotemporal box.
Definition: stbox.c:1118
bool stbox_tmin_inc(const STBox *box, bool *result)
Return in the last argument whether the maximum T value of a spatiotemporal box is inclusive.
Definition: stbox.c:1259
bool stbox_hast(const STBox *box)
Return true if a spatiotemporal box has time dimension.
Definition: stbox.c:1087
double stbox_volume(const STBox *box)
Return the volume of a 3D spatiotemporal box.
Definition: stbox.c:1343
double stbox_perimeter(const STBox *box, bool spheroid)
Return the permieter of the spatiotemporal box.
Definition: stbox.c:1364
bool stbox_ymin(const STBox *box, double *result)
Return in the last argument the minimum Y value of a spatiotemporal box.
Definition: stbox.c:1159
bool stbox_ymax(const STBox *box, double *result)
Return in the last argument the maximum Y value of a spatiotemporal box.
Definition: stbox.c:1179
bool stbox_isgeodetic(const STBox *box)
Return true if a spatiotemporal box is geodetic.
Definition: stbox.c:1101
bool stbox_tmax(const STBox *box, TimestampTz *result)
Return in the last argument the maximum T value of a spatiotemporal box.
Definition: stbox.c:1279
bool stbox_zmin(const STBox *box, double *result)
Return in the last argument the minimum Z value of a spatiotemporal box.
Definition: stbox.c:1199
bool stbox_tmin(const STBox *box, TimestampTz *result)
Return in the last argument the minimum T value of a spatiotemporal box.
Definition: stbox.c:1239
bool stbox_hasx(const STBox *box)
Return true if a spatiotemporal box has value dimension.
Definition: stbox.c:1059
bool stbox_eq(const STBox *box1, const STBox *box2)
Return true if the spatiotemporal boxes are equal.
Definition: stbox.c:2414
int stbox_cmp(const STBox *box1, const STBox *box2)
Return -1, 0, or 1 depending on whether the first spatiotemporal box is less than,...
Definition: stbox.c:2448
bool stbox_ne(const STBox *box1, const STBox *box2)
Return true if the spatiotemporal boxes are different.
Definition: stbox.c:2435
bool stbox_lt(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is less than the second one.
Definition: stbox.c:2520
bool stbox_ge(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is greater than or equal to the second one.
Definition: stbox.c:2546
bool stbox_le(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is less than or equal to the second one.
Definition: stbox.c:2533
bool stbox_gt(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is greater than the second one.
Definition: stbox.c:2559
STBox * stbox_make(bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *s)
Return a spatiotemporal box from the arguments.
Definition: stbox.c:328
STBox * geo_timestamptz_to_stbox(const GSERIALIZED *gs, TimestampTz t)
Return a spatiotemporal box from a geometry/geography and a timestamptz.
Definition: stbox.c:423
STBox * geo_tstzspan_to_stbox(const GSERIALIZED *gs, const Span *s)
Return a spatiotemporal box from a geometry/geography and a timestamptz span.
Definition: stbox.c:447
STBox * stbox_copy(const STBox *box)
Return a copy of a spatiotemporal box.
Definition: stbox.c:403
Span * stbox_to_tstzspan(const STBox *box)
Convert a spatiotemporal box into a timestamptz span.
Definition: stbox.c:644
STBox * gbox_to_stbox(const GBOX *box)
Convert a GBOX into a spatiotemporal box.
Definition: stbox.c:695
STBox * tstzset_to_stbox(const Set *s)
Convert a timestamptz set into a spatiotemporal box.
Definition: stbox.c:928
GSERIALIZED * stbox_to_geo(const STBox *box)
Return a spatiotemporal box converted as a geometry/geography.
Definition: stbox.c:628
STBox * timestamptz_to_stbox(TimestampTz t)
Convert a timestamptz into a spatiotemporal box.
Definition: stbox.c:895
STBox * tstzspan_to_stbox(const Span *s)
Convert a timestamptz span into a spatiotemporal box.
Definition: stbox.c:963
GBOX * stbox_to_gbox(const STBox *box)
Convert a spatiotemporal box into a GBOX
Definition: stbox.c:530
STBox * box3d_to_stbox(const BOX3D *box)
Convert a BOX3D into a spatiotemporal box.
Definition: stbox.c:711
STBox * tstzspanset_to_stbox(const SpanSet *ss)
Convert a timestamptz span set into a spatiotemporal box.
Definition: stbox.c:998
BOX3D * stbox_to_box3d(const STBox *box)
Convert a spatiotemporal box into a BOX3D
Definition: stbox.c:548
STBox * spatialset_to_stbox(const Set *s)
Convert a spatiotemporal set into a spatiotemporal box.
Definition: tspatial.c:407
STBox * geo_to_stbox(const GSERIALIZED *gs)
Convert a geometry/geography into a spatiotemporal box.
Definition: stbox.c:838
void rtree_insert(RTree *rtree, STBox *box, int64 id)
Insert an STBox into the RTree index.
Definition: tspatial_rtree.c:666
RTree * rtree_create_stbox()
Creates an RTree index for STBoxes.
Definition: tspatial_rtree.c:703
void rtree_free(RTree *rtree)
Frees the RTree.
Definition: tspatial_rtree.c:734
int * rtree_search(const RTree *rtree, const STBox *query, int *count)
Queries an RTree with an STBox.
Definition: tspatial_rtree.c:719
STBox * stbox_from_wkb(const uint8_t *wkb, size_t size)
Return a spatiotemporal box from its Well-Known Binary (WKB) representation.
Definition: stbox.c:249
STBox * stbox_in(const char *str)
Return a spatiotemporal box from its Well-Known Text (WKT) representation.
Definition: stbox.c:141
uint8_t * stbox_as_wkb(const STBox *box, uint8_t variant, size_t *size_out)
Return the Well-Known Binary (WKB) representation of a spatiotemporal box.
Definition: stbox.c:284
char * stbox_as_hexwkb(const STBox *box, uint8_t variant, size_t *size)
Return the ASCII hex-encoded Well-Known Binary (HexWKB) representation of a spatiotemporal box.
Definition: stbox.c:302
STBox * stbox_from_hexwkb(const char *hexwkb)
Return a spatiotemporal box from its ASCII hex-encoded Well-Known Binary (WKB) representation.
Definition: stbox.c:264
char * stbox_out(const STBox *box, int maxdd)
Return the Well-Known Text (WKT) representation of a spatiotemporal box.
Definition: stbox.c:157
bool overback_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box does not extend to the front of the second one.
Definition: stbox.c:2126
bool overbelow_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box does not extend above the second one.
Definition: stbox.c:2019
bool left_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is to the left of the second one.
Definition: stbox.c:1930
bool right_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is to the right of the second one.
Definition: stbox.c:1966
bool overabove_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box does not extend below the second one.
Definition: stbox.c:2054
bool overright_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box does not extend to the left of the second one.
Definition: stbox.c:1984
bool overafter_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is not before the second one.
Definition: stbox.c:2196
bool back_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is at the back of the second one.
Definition: stbox.c:2108
bool after_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is after the second one.
Definition: stbox.c:2178
bool front_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is in front of the the second one.
Definition: stbox.c:2072
bool overfront_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box does not extend to the back of the second one.
Definition: stbox.c:2090
bool above_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is above the second one.
Definition: stbox.c:2036
bool overbefore_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is not after the second one.
Definition: stbox.c:2161
bool before_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is before the second one.
Definition: stbox.c:2143
bool below_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is below the second one.
Definition: stbox.c:2001
bool overleft_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box does not extend to the right of the second one.
Definition: stbox.c:1948
STBox * union_stbox_stbox(const STBox *box1, const STBox *box2, bool strict)
Return the union of the spatiotemporal boxes.
Definition: stbox.c:2218
STBox * intersection_stbox_stbox(const STBox *box1, const STBox *box2)
Return the intersection of the spatiotemporal boxes.
Definition: stbox.c:2302
STBox * stbox_set_srid(const STBox *box, int32_t srid)
Return a spatiotemporal box with the coordinates set to an SRID.
Definition: stbox.c:1597
int32_t stbox_srid(const STBox *box)
Return the SRID of a spatiotemporal box.
Definition: stbox.c:1580
STBox * stbox_transform_pipeline(const STBox *box, const char *pipelinestr, int32_t srid, bool is_forward)
Return a spatiotemporal box transformed to another SRID using a pipeline.
Definition: stbox.c:1701
STBox * stbox_transform(const STBox *box, int32_t srid)
Return a spatiotemporal box transformed to another SRID.
Definition: stbox.c:1671
bool adjacent_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the spatiotemporal boxes are adjacent.
Definition: stbox.c:1867
bool overlaps_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the spatiotemporal boxes overlap @csqlfn Overlaps_stbox_stbox()
Definition: stbox.c:1815
bool contained_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box is contained in the second one.
Definition: stbox.c:1804
bool contains_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the first spatiotemporal box contains the second one.
Definition: stbox.c:1777
bool same_stbox_stbox(const STBox *box1, const STBox *box2)
Return true if the spatiotemporal boxes are equal in the common dimensions.
Definition: stbox.c:1842
STBox * stbox_quad_split(const STBox *box, int *count)
Return a spatiotemporal box split with respect to its space bounds in four quadrants (2D) or eight oc...
Definition: stbox.c:2343
STBox * stbox_round(const STBox *box, int maxdd)
Return a spatiotemporal box with the precision of the coordinates set to a number of decimal places.
Definition: stbox.c:1417
STBox * stbox_get_space(const STBox *box)
Return a spatiotemporal box with only the space dimension @csqlfn Stbox_get_space()
Definition: stbox.c:1493
STBox * stbox_expand_time(const STBox *box, const Interval *interv)
Return a spatiotemporal box with the time span expanded/decreased by an interval.
Definition: stbox.c:1554
STBox * stbox_shift_scale_time(const STBox *box, const Interval *shift, const Interval *duration)
Return a spatiotemporal box with the time span expanded and/or scaled by two intervals.
Definition: stbox.c:1465
STBox * stboxarr_round(const STBox *boxarr, int count, int maxdd)
Return an array of spatiotemporal boxes with the precision of the coordinates set to a number of deci...
Definition: stbox.c:1439
STBox * stbox_expand_space(const STBox *box, double d)
Return a spatiotemporal box with the space bounds expanded/decreased by a double.
Definition: stbox.c:1516
int always_ne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return true if a geo is always different from a temporal geo.
Definition: tgeo_compops.c:177
int ever_eq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return true if a geo is ever equal to a temporal geo.
Definition: tgeo_compops.c:99
int ever_eq_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal geos are ever equal.
Definition: tgeo_compops.c:204
int ever_ne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return true if a geo is ever different from a temporal geo.
Definition: tgeo_compops.c:125
int always_eq_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal geos are always equal.
Definition: tgeo_compops.c:228
int ever_eq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return true if a temporal geo is ever equal to a geo.
Definition: tgeo_compops.c:112
int ever_ne_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal geos are ever different.
Definition: tgeo_compops.c:216
int always_eq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return true if a geo is always equal to a temporal geo.
Definition: tgeo_compops.c:151
int always_eq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return true if a temporal geo is always equal to a geo.
Definition: tgeo_compops.c:164
int always_ne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return true if a temporal geo is always different from a geo.
Definition: tgeo_compops.c:190
int always_ne_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return true if two temporal geos are always different.
Definition: tgeo_compops.c:240
int ever_ne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return true if a temporal geo is ever different from a geo.
Definition: tgeo_compops.c:138
Temporal * tne_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the temporal inequality of a temporal geo and a geo.
Definition: tgeo_compops.c:336
Temporal * teq_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the temporal equality of a temporal geo and a geo.
Definition: tgeo_compops.c:323
Temporal * teq_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return the temporal equality of a geo and a temporal geo.
Definition: tgeo_compops.c:295
Temporal * tne_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return the temporal inequality of a geo and a temporal geo.
Definition: tgeo_compops.c:308
TSequence * tgeoseq_from_base_tstzset(const GSERIALIZED *gs, const Set *s)
Return a temporal geo discrete sequence from a geometry/geography and a timestamptz set.
Definition: tgeo_meos.c:546
TInstant * tgeoinst_make(const GSERIALIZED *gs, TimestampTz t)
Return a temporal instant geo from a geometry and a timestamptz.
Definition: tgeo.c:76
TSequence * tgeoseq_from_base_tstzspan(const GSERIALIZED *gs, const Span *s, interpType interp)
Return a temporal geo sequence from a geometry/geography and a timestamptz span.
Definition: tgeo_meos.c:589
TSequence * tpointseq_from_base_tstzspan(const GSERIALIZED *gs, const Span *s, interpType interp)
Return a temporal point sequence from a point and a timestamptz span.
Definition: tgeo_meos.c:567
Temporal * tgeo_from_base_temp(const GSERIALIZED *gs, const Temporal *temp)
Return a temporal geo from a geometry/geography and the time frame of another temporal value.
Definition: tgeo_meos.c:696
Temporal * tpoint_from_base_temp(const GSERIALIZED *gs, const Temporal *temp)
Return a temporal point from a point and the time frame of another temporal value.
Definition: tgeo_meos.c:683
TSequenceSet * tpointseqset_from_base_tstzspanset(const GSERIALIZED *gs, const SpanSet *ss, interpType interp)
Return a temporal point sequence set from a point and a timestamptz span set.
Definition: tgeo_meos.c:613
TInstant * tpointinst_make(const GSERIALIZED *gs, TimestampTz t)
Return a temporal point instant from a point and a timestamptz.
Definition: tgeo.c:56
TSequenceSet * tgeoseqset_from_base_tstzspanset(const GSERIALIZED *gs, const SpanSet *ss, interpType interp)
Return a temporal geo sequence set from a point and a timestamptz span set.
Definition: tgeo_meos.c:635
TSequence * tpointseq_from_base_tstzset(const GSERIALIZED *gs, const Set *s)
Return a temporal geometry point discrete sequence from a point and a timestamptz set.
Definition: tgeo_meos.c:527
Temporal * geomeas_to_tpoint(const GSERIALIZED *gs)
Return a geometry/geography with M measure encoding timestamps transformed to a temporal point.
Definition: tpoint_spatialfuncs.c:1976
bool tpoint_tfloat_to_geomeas(const Temporal *tpoint, const Temporal *measure, bool segmentize, GSERIALIZED **result)
Return a geometry/geography with M measure from a temporal point and optionally a temporal float.
Definition: tpoint_spatialfuncs.c:1690
Temporal * tgeometry_to_tgeompoint(const Temporal *temp)
Return a temporal geometry point from a temporal geometry.
Definition: tgeo_spatialfuncs.c:1263
bool tpoint_as_mvtgeom(const Temporal *temp, const STBox *bounds, int32_t extent, int32_t buffer, bool clip_geom, GSERIALIZED **gsarr, int64 **timesarr, int *count)
Return a temporal point transformed to Mapbox Vector Tile format.
Definition: tpoint_spatialfuncs.c:2492
Temporal * tgeompoint_to_tgeometry(const Temporal *temp)
Return a temporal geometry from a temporal geometry point.
Definition: tgeo_spatialfuncs.c:1290
STBox * tspatial_to_stbox(const Temporal *temp)
Convert a spatiotemporal value into a spatiotemporal box.
Definition: tspatial.c:472
Temporal * tgeogpoint_to_tgeography(const Temporal *temp)
Return a temporal geography from a temporal geography point.
Definition: tgeo_spatialfuncs.c:1303
Temporal * tgeography_to_tgeogpoint(const Temporal *temp)
Return a temporal geography point from a temporal geography.
Definition: tgeo_spatialfuncs.c:1276
Temporal * tgeography_to_tgeometry(const Temporal *temp)
Return a temporal geometry from to a temporal geography.
Definition: tgeo_spatialfuncs.c:1074
Temporal * tgeometry_to_tgeography(const Temporal *temp)
Return a temporal geography from a temporal geometry.
Definition: tgeo_spatialfuncs.c:1061
GSERIALIZED * shortestline_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return the line connecting the nearest approach point between two temporal geos.
Definition: tgeo_distance.c:965
double nad_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the nearest approach distance between a temporal geo and a geometry/geography.
Definition: tgeo_distance.c:730
double nad_stbox_geo(const STBox *box, const GSERIALIZED *gs)
Return the nearest approach distance between a spatiotemporal box and a geometry/geography.
Definition: tgeo_distance.c:759
double nad_tgeo_stbox(const Temporal *temp, const STBox *box)
Return the nearest approach distance between a temporal geo and a spatiotemporal box.
Definition: tgeo_distance.c:821
Temporal * distance_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return the temporal distance between two temporal geos.
Definition: tgeo_distance.c:411
Temporal * distance_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the temporal distance between a temporal geo and a geometry/geography.
Definition: tgeo_distance.c:378
GSERIALIZED * shortestline_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the line connecting the nearest approach point between a temporal geo and a geometry/geography...
Definition: tgeo_distance.c:930
TInstant * nai_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return the nearest approach instant between two temporal geos.
Definition: tgeo_distance.c:693
double nad_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return the nearest approach distance between two temporal geos.
Definition: tgeo_distance.c:867
double nad_stbox_stbox(const STBox *box1, const STBox *box2)
Return the nearest approach distance between two spatiotemporal boxes.
Definition: tgeo_distance.c:783
TInstant * nai_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return the nearest approach instant between a temporal geo and a geometry/geography.
Definition: tgeo_distance.c:654
Temporal * tgeogpoint_from_mfjson(const char *str)
Return a temporal geography point from its MF-JSON representation.
Definition: tgeo_meos.c:465
Temporal * tgeogpoint_in(const char *str)
Return a temporal geography point from its Well-Known Text (WKT) representation.
Definition: tspatial_parser.c:662
Temporal * tgeompoint_in(const char *str)
Return a temporal geometry point from its Well-Known Text (WKT) representation.
Definition: tspatial_parser.c:648
char * tspatial_as_ewkt(const Temporal *temp, int maxdd)
Return the Extended Well-Known Text (EWKT) representation of a spatiotemporal value.
Definition: tspatial.c:286
Temporal * tgeometry_from_mfjson(const char *str)
Return a temporal geometry from its MF-JSON representation.
Definition: tgeo_meos.c:477
Temporal * tgeompoint_from_mfjson(const char *str)
Return a temporal geometry point from its MF-JSON representation.
Definition: tgeo_meos.c:452
char * tgeo_out(const Temporal *temp, int maxdd)
Return the Well-Known Text (WKT) representation of a temporal geo.
Definition: tgeo_meos.c:506
char * tspatial_as_text(const Temporal *temp, int maxdd)
Return the Well-Known Text (WKT) representation of a temporal spatial value.
Definition: tspatial.c:256
Temporal * tgeography_in(const char *str)
Return a temporal geography from its Well-Known Text (WKT) representation.
Definition: tspatial_parser.c:689
Temporal * tgeometry_in(const char *str)
Return a temporal geometry from its Well-Known Text (WKT) representation.
Definition: tspatial_parser.c:676
Temporal * tgeography_from_mfjson(const char *mfjson)
Return a temporal geography from its MF-JSON representation.
Definition: tgeo_meos.c:490
int ecovers_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return 1 if a geometry ever covers a temporal geo, 0 if not, and -1 on error or if the geometry is em...
Definition: tgeo_spatialrels.c:803
int adisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry and a geometry are always disjoint, 0 if not, and -1 on error or if t...
Definition: tgeo_spatialrels.c:1004
int edwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist)
Return 1 if two temporal geos are ever within a distance, 0 if not, -1 on error or if they do not int...
Definition: tgeo_spatialrels.c:1713
int eintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if the temporal geos ever intersect, 0 if not, and -1 on error or if the temporal geos do no...
Definition: tgeo_spatialrels.c:1170
int atouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if a temporal geometry always touches another one, 0 if not, and -1 on error.
Definition: tgeo_spatialrels.c:1423
int edisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if the temporal geos are ever disjoint, 0 if not, and -1 on error or if the temporal geos do...
Definition: tgeo_spatialrels.c:1041
int acontains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return 1 if a geometry always contains a temporal geo, 0 if not, and -1 on error or if the geometry i...
Definition: tgeo_spatialrels.c:641
int atouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry always touches a geometry, 0 if not, and -1 on error or if the geomet...
Definition: tgeo_spatialrels.c:1357
int adwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist)
Return 1 if a geometry and a temporal geo are always within a distance, 0 if not, -1 on error or if t...
Definition: tgeo_spatialrels.c:1497
int acontains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a geometry always contains a temporal geo, 0 if not, and -1 on error or if the geometry i...
Definition: tgeo_spatialrels.c:669
int aintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if the temporal geos always intersect, 0 if not, and -1 on error or if the temporal geos do ...
Definition: tgeo_spatialrels.c:1183
int adisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if the temporal geos are always disjoint, 0 if not, and -1 on error or if the temporal geos ...
Definition: tgeo_spatialrels.c:1054
int ecovers_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry ever covers a geo, 0 if not, and -1 on error or if the geometry is em...
Definition: tgeo_spatialrels.c:831
int acontains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if a temporal geometry ever contains another one, 0 if not, and -1 on error.
Definition: tgeo_spatialrels.c:723
int edisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry and a geometry are ever disjoint, 0 if not, and -1 on error or if the...
Definition: tgeo_spatialrels.c:990
int eintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry ever intersects a temporal geometry, 0 if not, and -1 on error or if ...
Definition: tgeo_spatialrels.c:1118
int econtains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp)
Return 1 if a geometry ever contains a temporal geo, 0 if not, and -1 on error or if the geometry is ...
Definition: tgeo_spatialrels.c:627
int econtains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry ever contains a geo, 0 if not, and -1 on error or if the geometry is ...
Definition: tgeo_spatialrels.c:655
int aintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry always intersects a temporal geometry, 0 if not, and -1 on error or i...
Definition: tgeo_spatialrels.c:1132
int etouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal geometry ever touches a geometry, 0 if not, and -1 on error or if the geometry...
Definition: tgeo_spatialrels.c:1343
int edwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist)
Return 1 if a geometry and a temporal geo are ever within the given distance, 0 if not,...
Definition: tgeo_spatialrels.c:1482
int econtains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if a temporal geometry ever contains another one, 0 if not, and -1 on error.
Definition: tgeo_spatialrels.c:710
int ecovers_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if a temporal geometry ever covers another one, 0 if not, and -1 on error.
Definition: tgeo_spatialrels.c:886
int adwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist)
Return 1 if two temporal geos are always within a distance, 0 if not, -1 on error or if they do not i...
Definition: tgeo_spatialrels.c:1727
int etouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2)
Return 1 if a temporal geometry ever touches another one, 0 if not, and -1 on error.
Definition: tgeo_spatialrels.c:1410
Temporal * tcovers_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue)
Return a temporal Boolean that states whether a spatiotemporal value covers another one.
Definition: tspatial_tempspatialrels.c:848
Temporal * tcontains_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue)
Return a temporal Boolean that states whether a geometry contains a temporal geometry.
Definition: tspatial_tempspatialrels.c:692
Temporal * tintersects_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geo and a geometry intersect.
Definition: tspatial_tempspatialrels.c:924
Temporal * tcovers_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue)
Return a temporal Boolean that states whether a geometry covers a temporal geometry.
Definition: tspatial_tempspatialrels.c:806
Temporal * tcontains_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geometry contains a geometry.
Definition: tspatial_tempspatialrels.c:753
Temporal * ttouches_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue)
Return a temporal Boolean that states whether a geometry touches a temporal geo.
Definition: tspatial_tempspatialrels.c:1046
Temporal * ttouches_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geometry touches another one.
Definition: tspatial_tempspatialrels.c:1067
Temporal * tintersects_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue)
Return a temporal Boolean that states whether two temporal geos intersect.
Definition: tspatial_tempspatialrels.c:957
Temporal * tcovers_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geometry covers a geometry.
Definition: tspatial_tempspatialrels.c:828
Temporal * tdwithin_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, double dist, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geo and a geometry are within a distance.
Definition: tspatial_tempspatialrels.c:1570
Temporal * tdisjoint_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geo and a geometry are disjoint.
Definition: tspatial_tempspatialrels.c:870
Temporal * tdwithin_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, double dist, bool restr, bool atvalue)
Return a temporal Boolean that states whether two temporal geos are within a distance.
Definition: tspatial_tempspatialrels.c:1686
Temporal * ttouches_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geo touches a geometry.
Definition: tspatial_tempspatialrels.c:986
Temporal * tintersects_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geo and a geometry intersect.
Definition: tspatial_tempspatialrels.c:941
Temporal * tcontains_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geometry contains another one.
Definition: tspatial_tempspatialrels.c:773
Temporal * tdisjoint_tgeo_geo(const Temporal *temp, const GSERIALIZED *gs, bool restr, bool atvalue)
Return a temporal Boolean that states whether a temporal geo and a geometry are disjoint.
Definition: tspatial_tempspatialrels.c:887
Temporal * tdisjoint_tgeo_tgeo(const Temporal *temp1, const Temporal *temp2, bool restr, bool atvalue)
Return a temporal Boolean that states whether two temporal geos are disjoint.
Definition: tspatial_tempspatialrels.c:903
Temporal * tpoint_at_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan)
Return a temporal point restricted to a geometry.
Definition: tgeo_restrict.c:2125
Temporal * tpoint_minus_value(const Temporal *temp, GSERIALIZED *gs)
Return a temporal point restricted to the complement of a point.
Definition: tgeo_restrict.c:100
Temporal * tgeo_at_geom(const Temporal *temp, const GSERIALIZED *gs)
Return a temporal geo restricted to a geometry.
Definition: tgeo_restrict.c:2138
Temporal * tpoint_at_value(const Temporal *temp, GSERIALIZED *gs)
Return a temporal point restricted to a point.
Definition: tgeo_restrict.c:70
Temporal * tgeo_at_stbox(const Temporal *temp, const STBox *box, bool border_inc)
Return a temporal geo restricted to a spatiotemporal box.
Definition: tgeo_restrict.c:1183
Temporal * tgeo_minus_geom(const Temporal *temp, const GSERIALIZED *gs)
Return a temporal geo restricted to the complement of a geometry.
Definition: tgeo_restrict.c:2168
Temporal * tgeo_at_value(const Temporal *temp, GSERIALIZED *gs)
Return a temporal geo restricted to a geometry/geography.
Definition: tgeo_restrict.c:85
Temporal * tgeo_minus_stbox(const Temporal *temp, const STBox *box, bool border_inc)
Return a temporal geo restricted to the complement of a spatiotemporal box.
Definition: tgeo_restrict.c:1198
Temporal * tgeo_minus_value(const Temporal *temp, GSERIALIZED *gs)
Return a temporal geo restricted to the complement of a geo.
Definition: tgeo_restrict.c:115
Temporal * tpoint_minus_geom(const Temporal *temp, const GSERIALIZED *gs, const Span *zspan)
Return a temporal point restricted to the complement of a geometry.
Definition: tgeo_restrict.c:2154
GSERIALIZED ** geoset_values(const Set *s)
Return an array of copies of the values of a geo set.
Definition: geoset_meos.c:204
GSERIALIZED * geoset_start_value(const Set *s)
Return a copy of the start value of a geo set.
Definition: geoset_meos.c:153
GSERIALIZED * geoset_end_value(const Set *s)
Return a copy of the end value of a geo set.
Definition: geoset_meos.c:168
bool geoset_value_n(const Set *s, int n, GSERIALIZED **result)
Return in the last argument a copy of the n-th value of a geo set.
Definition: geoset_meos.c:186
Set * geoset_make(const GSERIALIZED **values, int count)
Return a geo set from an array of values.
Definition: geoset_meos.c:90
Set * geo_to_set(const GSERIALIZED *gs)
Convert a geometry/geography into a geo set.
Definition: geoset_meos.c:134
Set * geogset_in(const char *str)
Return a set from its Well-Known Text (WKT) representation.
Definition: geoset_meos.c:71
char * spatialset_as_ewkt(const Set *set, int maxdd)
Return the Extended Well-Known Text (EWKT) representation of a geo set.
Definition: tspatial.c:198
char * spatialset_as_text(const Set *set, int maxdd)
Return the Well-Known Text (WKT) representation of a spatial set @csqlfn Spatialset_as_text()
Definition: tspatial.c:185
Set * geomset_in(const char *str)
Return a set from its Well-Known Text (WKT) representation.
Definition: geoset_meos.c:57
Set * intersection_geo_set(const GSERIALIZED *gs, const Set *s)
Return the intersection of a geometry/geography and a set.
Definition: geoset_meos.c:319
Set * union_geo_set(const GSERIALIZED *gs, const Set *s)
Return the union of a geometry/geography and a set.
Definition: geoset_meos.c:290
Set * intersection_set_geo(const Set *s, const GSERIALIZED *gs)
Return the intersection of a set and a geometry/geography.
Definition: geoset_meos.c:303
Set * union_set_geo(const Set *s, const GSERIALIZED *gs)
Return the union of a set and a geometry/geography.
Definition: geoset_meos.c:274
Set * minus_geo_set(const GSERIALIZED *gs, const Set *s)
Return the difference of a geometry/geography and a set.
Definition: geoset_meos.c:332
bool contains_set_geo(const Set *s, GSERIALIZED *gs)
Return true if a set contains a geometry/geography.
Definition: geoset_meos.c:242
Set * geo_union_transfn(Set *state, const GSERIALIZED *gs)
Transition function for set union aggregate of geometries/geographies.
Definition: geoset_meos.c:367
bool contained_geo_set(const GSERIALIZED *gs, const Set *s)
Return true if a geometry/geography is contained in a set.
Definition: geoset_meos.c:258
Set * minus_set_geo(const Set *s, const GSERIALIZED *gs)
Return the difference of a set and a geometry/geography.
Definition: geoset_meos.c:348
int32_t spatialset_srid(const Set *s)
Return the SRID of a spatial set.
Definition: tspatial_srid.c:150
Set * spatialset_transform(const Set *s, int32_t srid)
Return a spatial set transformed to another SRID.
Definition: tspatial_srid.c:512
Set * spatialset_transform_pipeline(const Set *s, const char *pipelinestr, int32_t srid, bool is_forward)
Return a spatial set transformed to another SRID using a pipeline.
Definition: tspatial_srid.c:544
Set * spatialset_set_srid(const Set *s, int32_t srid)
Return a spatial set with the coordinates set to an SRID.
Definition: tspatial_srid.c:166
Temporal * tspatial_set_srid(const Temporal *temp, int32_t srid)
Return a spatiotemporal value with the coordinates set to an SRID.
Definition: tspatial_srid.c:304
int32_t tspatial_srid(const Temporal *temp)
Return the SRID of a spatiotemporal value.
Definition: tspatial_srid.c:215
Temporal * tspatial_transform_pipeline(const Temporal *temp, const char *pipelinestr, int32_t srid, bool is_forward)
Return a spatiotemporal value transformed to another SRID using a pipeline.
Definition: tspatial_srid.c:707
Temporal * tspatial_transform(const Temporal *temp, int32_t srid)
Return a spatiotemporal value transformed to another SRID.
Definition: tspatial_srid.c:672
STBox * stbox_get_space_tile(const GSERIALIZED *point, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin)
Return a tile in the spatial grid of a spatiotemporal box.
Definition: tgeo_tile.c:918
STBox * stbox_time_tiles(const STBox *bounds, const Interval *duration, TimestampTz torigin, bool border_inc, int *count)
Return the spatiotemporal grid of a spatiotemporal box.
Definition: tgeo_tile.c:800
STBox * stbox_space_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool border_inc, int *count)
Return the spatial grid of a spatiotemporal box.
Definition: tgeo_tile.c:781
STBox * stbox_get_time_tile(TimestampTz t, const Interval *duration, TimestampTz torigin)
Return a tile in the temporal grid of a spatiotemporal box.
Definition: tgeo_tile.c:934
STBox * stbox_get_space_time_tile(const GSERIALIZED *point, TimestampTz t, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin)
Return a tile in the spatiotemporal grid of a spatiotemporal box.
Definition: tgeo_tile.c:901
STBox * stbox_space_time_tiles(const STBox *bounds, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool border_inc, int *count)
Return the spatiotemporal grid of a spatiotemporal box.
Definition: tgeo_tile.c:675
STBox * tgeo_space_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, int *count)
Return the spatiotemporal boxes of a temporal geo split with respect to a space grid.
Definition: tgeo_tile.c:1045
Temporal ** tgeo_space_time_split(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, TimestampTz **time_bins, int *count)
Return the fragments a temporal geo split according to a space and possibly a time grid.
Definition: tgeo_tile.c:1374
Temporal ** tgeo_space_split(const Temporal *temp, double xsize, double ysize, double zsize, const GSERIALIZED *sorigin, bool bitmatrix, bool border_inc, GSERIALIZED ***space_bins, int *count)
Return the fragments a temporal geo split according to a space and possibly a time grid.
Definition: tgeo_tile.c:1467
Temporal * tgeo_scale(const Temporal *temp, const GSERIALIZED *scale, const GSERIALIZED *sorigin)
Scale a temporal geo by given factors.
Definition: tgeo_spatialfuncs.c:1487
Temporal * tgeo_affine(const Temporal *temp, const AFFINE *a)
Return the 3D affine transform of a temporal geo to do things like translate, rotate,...
Definition: tgeo_spatialfuncs.c:1393
Temporal ** tpoint_make_simple(const Temporal *temp, int *count)
Return a temporal point split into an array of non self-intersecting fragments.
Definition: tpoint_spatialfuncs.c:4481
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.
spatialRel
API of the Mobility Engine Open Source (MEOS) library.
Definition: meos_geo.h:55
@ INTERSECTS
Definition: meos_geo.h:56
@ COVERS
Definition: meos_geo.h:59
@ TOUCHES
Definition: meos_geo.h:58
@ CONTAINS
Definition: meos_geo.h:57
GSERIALIZED * geom_intersection2d_coll(const GSERIALIZED *gs1, const GSERIALIZED *gs2)
GSERIALIZED ** geo_pointarr(const GSERIALIZED *gs, int *count)
GSERIALIZED * geo_points(const GSERIALIZED *gs)
STBox * tgeo_space_time_boxes(const Temporal *temp, double xsize, double ysize, double zsize, const Interval *duration, const GSERIALIZED *sorigin, TimestampTz torigin, bool bitmatrix, bool border_inc, int *count)
Return the spatiotemporal boxes of a temporal point split with respect to a space and possibly a time...
Definition: tgeo_tile.c:961
bool geo_is_unitary(const GSERIALIZED *gs)
STBox * geo_expand_space(const GSERIALIZED *gs, double d)
int etouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal point ever touches a geometry, 0 if not, and -1 on error or if the geometry is...
Definition: tgeo_spatialrels.c:1276
Temporal * tdwithin_geo_tgeo(const GSERIALIZED *gs, const Temporal *temp, double dist, bool restr, bool atvalue)
Definition: tspatial_tempspatialrels.c:1593
STBox * tspatial_expand_space(const Temporal *temp, double d)
int atouches_tpoint_geo(const Temporal *temp, const GSERIALIZED *gs)
Return 1 if a temporal point always touches a geometry, 0 if not, and -1 on error or if the geometry ...
Definition: tgeo_spatialrels.c:1290
Datum buffer(PG_FUNCTION_ARGS)
int64 TimestampTz
Definition: postgres_ext_defs.in.h:22
signed int int32
Definition: postgres_ext_defs.in.h:11
long int int64
Definition: postgres_ext_defs.in.h:12
Definition: postgis_ext_defs.in.h:58
Definition: postgis_ext_defs.in.h:65
Definition: postgis_ext_defs.in.h:79
Definition: postgis_ext_defs.in.h:170
Definition: postgres_ext_defs.in.h:27
Rtree in memory index basic structure.
Definition: tspatial_rtree.h:81
Structure to represent spatiotemporal boxes.
Definition: meos.h:134
Structure to represent sets of values.
Definition: meos.h:80
Structure to represent skiplists that keep the current state of an aggregation.
Definition: meos.h:272
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
Definition: pgtz.h:42
int const GSERIALIZED * gs
Definition: trgeo_spatialrels.h:52