MobilityDB 1.1
Macros | Functions
tbox.c File Reference
#include "general/tbox.h"
#include <assert.h>
#include <meos.h>
#include <meos_internal.h>
#include "general/pg_types.h"
#include "general/set.h"
#include "general/tnumber_mathfuncs.h"
#include "general/type_parser.h"
#include "general/type_util.h"
Include dependency graph for tbox.c:

Macros

#define MAXTBOXLEN   128
 Functions for temporal bounding boxes. More...
 

Functions

bool adjacent_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the temporal boxes are adjacent. More...
 
bool after_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is strictly after the second one. More...
 
bool before_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is strictly before the second one. More...
 
bool contained_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is contained by the second one. More...
 
bool contains_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box contains the second one. More...
 
void ensure_has_T_tbox (const TBox *box)
 Ensure that a temporal box has T values. More...
 
void ensure_has_X_tbox (const TBox *box)
 Ensure that a temporal box has X values. More...
 
void ensure_same_dimensionality_tbox (const TBox *box1, const TBox *box2)
 Ensure that a temporal boxes have the same dimensionality. More...
 
TBoxfloat_period_to_tbox (double d, const Span *p)
 Return a temporal box from a float and a period. More...
 
void float_set_tbox (double d, TBox *box)
 Set a temporal box from a float. More...
 
TBoxfloat_timestamp_to_tbox (double d, TimestampTz t)
 Return a temporal box from a float and a timestamp. More...
 
TBoxfloat_to_tbox (double d)
 Cast a float to a temporal box. More...
 
TBoxint_period_to_tbox (int i, const Span *p)
 Return a temporal box from an integer and a period. More...
 
void int_set_tbox (int i, TBox *box)
 Set a temporal box from an integer. More...
 
TBoxint_timestamp_to_tbox (int i, TimestampTz t)
 Return a temporal box from an integer and a timestamp. More...
 
TBoxint_to_tbox (int i)
 Cast an integer to a temporal box. More...
 
bool inter_tbox_tbox (const TBox *box1, const TBox *box2, TBox *result)
 Set a temporal box with the result of the intersection of the first two temporal boxes. More...
 
TBoxintersection_tbox_tbox (const TBox *box1, const TBox *box2)
 Return the intersection of the spatiotemporal boxes. More...
 
bool left_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is strictly to the left of the second one. More...
 
TBoxnumber_period_to_tbox (Datum d, meosType basetype, const Span *p)
 Return a temporal box from an integer and a period. More...
 
void number_set_tbox (Datum value, meosType basetype, TBox *box)
 Set a temporal box from a number. More...
 
TBoxnumber_timestamp_to_tbox (Datum d, meosType basetype, TimestampTz t)
 Return a temporal box from an integer and a timestamp. More...
 
void numset_set_tbox (const Set *s, TBox *box)
 Set a temporal box from a number set. More...
 
TBoxnumset_to_tbox (const Set *s)
 Cast a set to a temporal box. More...
 
void numspan_set_tbox (const Span *s, TBox *box)
 Set a temporal box from a number span. More...
 
TBoxnumspan_to_tbox (const Span *s)
 Cast a span to a temporal box. More...
 
void numspanset_set_tbox (const SpanSet *ss, TBox *box)
 Set a temporal box from a span set. More...
 
TBoxnumspanset_to_tbox (const SpanSet *ss)
 Cast a span set to a temporal box. More...
 
bool overafter_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box does not extend before the second one. More...
 
bool overbefore_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box does not extend after the second one. More...
 
bool overlaps_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the temporal boxes overlap. More...
 
bool overleft_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box does not extend to the right of the second one. More...
 
bool overright_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box does not extend to the left of the second one. More...
 
void period_set_tbox (const Span *p, TBox *box)
 Set a temporal box from a period. More...
 
TBoxperiod_to_tbox (const Span *p)
 Cast a period to a temporal box. More...
 
void periodset_set_tbox (const SpanSet *ps, TBox *box)
 Set a temporal box from a period set. More...
 
TBoxperiodset_to_tbox (const SpanSet *ps)
 Cast a period set to a temporal box. More...
 
bool right_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is strictly to the right of the second one. More...
 
bool same_tbox_tbox (const TBox *box1, const TBox *box2)
 Return true if the temporal boxes are equal on the common dimensions. More...
 
TBoxspan_period_to_tbox (const Span *span, const Span *p)
 Return a temporal box from a span and a period. More...
 
TBoxspan_timestamp_to_tbox (const Span *span, TimestampTz t)
 Return a temporal box from a span and a timestamp. More...
 
int tbox_cmp (const TBox *box1, const TBox *box2)
 Return -1, 0, or 1 depending on whether the first temporal box is less than, equal to, or greater than the second one. More...
 
TBoxtbox_copy (const TBox *box)
 Return a copy of a temporal box. More...
 
bool tbox_eq (const TBox *box1, const TBox *box2)
 Return true if the temporal boxes are equal. More...
 
void tbox_expand (const TBox *box1, TBox *box2)
 Expand the second temporal box with the first one. More...
 
TBoxtbox_expand_time (const TBox *box, const Interval *interval)
 Return a temporal box expanded in the time dimension by an interval. More...
 
TBoxtbox_expand_value (const TBox *box, const double d)
 Return a temporal box expanded in the value dimension by a double. More...
 
bool tbox_ge (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is greater than or equal to the second one. More...
 
bool tbox_gt (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is greater than the second one. More...
 
bool tbox_hast (const TBox *box)
 Return true if a temporal box has time dimension. More...
 
bool tbox_hasx (const TBox *box)
 Return true if a temporal box has value dimension. More...
 
TBoxtbox_in (const char *str)
 Return a temporal box from its Well-Known Text (WKT) representation. More...
 
bool tbox_le (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is less than or equal to the second one. More...
 
bool tbox_lt (const TBox *box1, const TBox *box2)
 Return true if the first temporal box is less than the second one. More...
 
TBoxtbox_make (const Span *p, const Span *s)
 Construct a temporal box from the arguments. More...
 
bool tbox_ne (const TBox *box1, const TBox *box2)
 Return true if the temporal boxes are different. More...
 
char * tbox_out (const TBox *box, int maxdd)
 Return the Well-Known Text (WKT) representation of a temporal box. More...
 
void tbox_set (const Span *p, const Span *s, TBox *box)
 Set a temporal box from the arguments. More...
 
void tbox_shift_tscale (TBox *box, const Interval *shift, const Interval *duration)
 Return a temporal box shifted and/or scaled in the time dimension by the intervals. More...
 
static void tbox_tbox_flags (const TBox *box1, const TBox *box2, bool *hasx, bool *hast)
 Set the ouput variables with the values of the flags of the boxes. More...
 
bool tbox_tmax (const TBox *box, TimestampTz *result)
 Return true if the temporal box has time dimension. More...
 
bool tbox_tmin (const TBox *box, TimestampTz *result)
 Return true if the temporal box has time dimension. More...
 
Spantbox_to_floatspan (const TBox *box)
 Cast a temporal box as a span. More...
 
Spantbox_to_period (const TBox *box)
 Cast a temporal box as a period. More...
 
bool tbox_xmax (const TBox *box, double *result)
 Return true if the temporal box has value dimension. More...
 
bool tbox_xmin (const TBox *box, double *result)
 Return true if the temporal box has value dimension. More...
 
void timestamp_set_tbox (TimestampTz t, TBox *box)
 Set a temporal box from a timestamp. More...
 
TBoxtimestamp_to_tbox (TimestampTz t)
 Cast a timestamp to a temporal box. More...
 
static void topo_tbox_tbox_init (const TBox *box1, const TBox *box2, bool *hasx, bool *hast)
 Set the ouput variables with the values of the flags of the boxes. More...
 
void tstzset_set_tbox (const Set *s, TBox *box)
 Set a temporal box from a timestamp set. More...
 
TBoxunion_tbox_tbox (const TBox *box1, const TBox *box2)
 Return the union of the temporal boxes. More...