![]() |
MobilityDB 1.3
|
Bounding box operators for temporal types. More...
#include "temporal/temporal_boxops.h"
#include <assert.h>
#include <limits.h>
#include <utils/timestamp.h>
#include <meos.h>
#include <meos_internal.h>
#include <meos_internal_geo.h>
#include "temporal/span.h"
#include "temporal/type_util.h"
#include "geo/tspatial_boxops.h"
Functions | |
size_t | bbox_get_size (meosType bboxtype) |
Return the size of a bounding box type. More... | |
int | bbox_max_dims (meosType bboxtype) |
Return the maximum number of dimensions of a bounding box type. More... | |
bool | bbox_type (meosType bboxtype) |
Return true if the type is a bounding box type. More... | |
bool | boxop_temporal_temporal (const Temporal *temp1, const Temporal *temp2, bool(*func)(const Span *, const Span *)) |
Generic bounding box function for two temporal values. More... | |
bool | boxop_temporal_tstzspan (const Temporal *temp, const Span *s, bool(*func)(const Span *, const Span *), bool invert) |
Generic bounding box function for a temporal value and a timestamptz span. More... | |
bool | boxop_tnumber_numspan (const Temporal *temp, const Span *s, bool(*func)(const Span *, const Span *), bool invert) |
Generic bounding box function for a temporal number and a span. More... | |
bool | boxop_tnumber_tbox (const Temporal *temp, const TBox *box, bool(*func)(const TBox *, const TBox *), bool invert) |
Generic bounding box function for a temporal number and a temporal box. More... | |
bool | boxop_tnumber_tnumber (const Temporal *temp1, const Temporal *temp2, bool(*func)(const TBox *, const TBox *)) |
Generic bounding box function for two temporal numbers. More... | |
static int | tcontseq_spans_iter (const TSequence *seq, Span *result) |
Return an array of spans obtained from the segments of a temporal sequence with continuous interpolation (iterator function) More... | |
static int | tcontseq_split_each_n_spans_iter (const TSequence *seq, int elems_per_span, Span *result) |
Return an array of spans of a temporal number sequence with continuous interpolation obtained by merging consecutive segments (iterator function) More... | |
static int | tcontseq_split_n_spans_iter (const TSequence *seq, int span_count, Span *result) |
Return an array of N spans from the segments of a temporal sequence with continuous interpolation (iterator function) More... | |
static Span * | tdiscseq_spans (const TSequence *seq) |
Return an array of spans obtained from the instants of a temporal sequence with discrete interpolation. More... | |
static Span * | tdiscseq_split_each_n_spans (const TSequence *seq, int elems_per_span, int *count) |
Return an array of spans obtained by merging consecutive instants from a temporal number sequence with discrete interpolation. More... | |
static Span * | tdiscseq_split_n_spans (const TSequence *seq, int span_count, int *count) |
Return an array of N spans from the instants of a temporal sequence with discrete interpolation. More... | |
int | temporal_bbox_cmp (const void *box1, const void *box2, meosType temptype) |
Return -1, 0, or 1 depending on whether the first bounding box is less than, equal, or greater than the second one. More... | |
bool | temporal_bbox_eq (const void *box1, const void *box2, meosType temptype) |
Return true if two bounding boxes are equal. More... | |
size_t | temporal_bbox_size (meosType temptype) |
Return the size of a bounding box of a temporal type. More... | |
Span * | temporal_spans (const Temporal *temp, int *count) |
Return an array of spans obtained from the instants or segments of a temporal value, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
Span * | temporal_split_each_n_spans (const Temporal *temp, int elems_per_span, int *count) |
Return an array of spans obtained from the instants or segments of a temporal value, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
Span * | temporal_split_n_spans (const Temporal *temp, int span_count, int *count) |
Return an array of N spans obtained from the instants or segments of a temporal value, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
void | tinstant_set_bbox (const TInstant *inst, void *box) |
Return in the last argument the bounding box of a temporal instant. More... | |
static void | tinstant_set_span (const TInstant *inst, Span *result) |
Set the span in the last argument from a temporal instant. More... | |
Span * | tinstant_spans (const TInstant *inst) |
Return a singleton array of spans from a temporal instant. More... | |
void | tinstarr_set_bbox (const TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, void *box) |
Set a bounding box from an array of temporal instant values. More... | |
void | tnumber_set_tbox (const Temporal *temp, TBox *box) |
Return in the last argument the temporal box of a temporal number. More... | |
TBox * | tnumber_split_each_n_tboxes (const Temporal *temp, int elems_per_box, int *count) |
Return an array of temporal boxes obtained from the instants or segments of a temporal number, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
TBox * | tnumber_split_n_tboxes (const Temporal *temp, int box_count, int *count) |
Return an array of N temporal boxes obtained from the instants or segments of a temporal number, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
TBox * | tnumber_tboxes (const Temporal *temp, int *count) |
Return an array of temporal boxes obtained from the instants or segments of a temporal number, where the choice between instants or segments depends on whether the interpolation is discrete or continuous. More... | |
void | tnumberinst_set_tbox (const TInstant *inst, TBox *box) |
Return in the last argument the temporal box of a temporal number instant. More... | |
TBox * | tnumberinst_tboxes (const TInstant *inst) |
Return a singleton array of temporal boxes from a temporal number instant. More... | |
static void | tnumberinstarr_set_tbox (const TInstant **instants, int count, bool lower_inc, bool upper_inc, interpType interp, TBox *box) |
Set a temporal box from an array of temporal number instants. More... | |
static int | tnumberseq_cont_split_each_n_tboxes_iter (const TSequence *seq, int elems_per_box, TBox *result) |
Return an array of temporal boxes obtained from the segments of a temporal number sequence with continuous interpolation (iterator function) More... | |
static int | tnumberseq_cont_split_n_tboxes_iter (const TSequence *seq, int box_count, TBox *result) |
Return an array of N temporal boxes from the segments of a temporal number sequence with continuous interpolation (iterator function) More... | |
static int | tnumberseq_cont_tboxes_iter (const TSequence *seq, TBox *result) |
Return an array of temporal boxes from the segments of a temporal number sequence with continuous interpolation (iterator function) More... | |
static TBox * | tnumberseq_disc_split_each_n_tboxes (const TSequence *seq, int elems_per_box, int *count) |
Return an array of temporal boxes obtained from the instants of a temporal number sequence with discrete interpolation. More... | |
static TBox * | tnumberseq_disc_split_n_tboxes (const TSequence *seq, int box_count, int *count) |
Return an array of N temporal boxes from the instants of a temporal number sequence with discrete interpolation. More... | |
static TBox * | tnumberseq_disc_tboxes (const TSequence *seq) |
Return an array of temporal boxes obtained from the instants of a temporal number sequence with discrete interpolation. More... | |
static void | tnumberseq_expand_tbox (TSequence *seq, const TInstant *inst) |
Expand the bounding box of a temporal number sequence with an instant. More... | |
void | tnumberseq_set_tbox (const TSequence *seq, TBox *box) |
Return int the last argument the temporal box of a temporal number sequence. More... | |
static TBox * | tnumberseq_split_each_n_tboxes (const TSequence *seq, int elems_per_box, int *count) |
Return an array of temporal boxes obtained from the instants or segments of a temporal number sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
TBox * | tnumberseq_split_n_tboxes (const TSequence *seq, int box_count, int *count) |
Return an array of N temporal boxes from the instants or segments of a temporal number sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
TBox * | tnumberseq_tboxes (const TSequence *seq, int *count) |
Return an array of temporal boxes obtained from the instants or segments of a temporal number sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
static void | tnumberseqarr_set_tbox (const TSequence **sequences, int count, TBox *box) |
Return in the last argument a temporal box constructed from an array of temporal number sequences. More... | |
void | tnumberseqset_set_tbox (const TSequenceSet *ss, TBox *box) |
Return in the last argument the temporal box of a temporal number sequence. More... | |
static TBox * | tnumberseqset_split_each_n_tboxes (const TSequenceSet *ss, int elems_per_box, int *count) |
Return an array of temporal boxes obtained from the segments of a temporal number sequence set. More... | |
TBox * | tnumberseqset_split_n_tboxes (const TSequenceSet *ss, int box_count, int *count) |
Return an array of N temporal boxes from the segments of a temporal number sequence set. More... | |
TBox * | tnumberseqset_tboxes (const TSequenceSet *ss, int *count) |
Return an array of temporal boxes obtained from the segments of a temporal number sequence set. More... | |
void | tseqarr_compute_bbox (const TSequence **sequences, int count, void *box) |
Return in the last argument a bounding box constructed from an array of temporal sequences. More... | |
static void | tseqarr_set_tstzspan (const TSequence **sequences, int count, Span *s) |
Return in the last argument a timestamptz span constructed from an array of temporal sequences. More... | |
void | tsequence_compute_bbox (TSequence *seq) |
Recompute the bounding box of a temporal sequence. More... | |
void | tsequence_expand_bbox (TSequence *seq, const TInstant *inst) |
Expand the bounding box of a temporal sequence with an additional instant. More... | |
void | tsequence_set_bbox (const TSequence *seq, void *box) |
Return in the last argument the bounding box of a temporal sequence. More... | |
Span * | tsequence_spans (const TSequence *seq, int *count) |
Return an array of spans obtained from the instants or segments of a temporal sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
static Span * | tsequence_split_each_n_spans (const TSequence *seq, int elems_per_span, int *count) |
Return an array of spans of a temporal number sequence obtained by merging consecutive instants or segments, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
Span * | tsequence_split_n_spans (const TSequence *seq, int span_count, int *count) |
Return an array of N spans obtained from the instants or segments of a temporal sequence, where the choice between instants or segments depends, respectively, on whether the interpolation is discrete or continuous. More... | |
void | tsequenceset_compute_bbox (TSequenceSet *ss) |
(Re)compute the bounding box of a temporal sequence set More... | |
void | tsequenceset_expand_bbox (TSequenceSet *ss, const TSequence *seq) |
Expand the bounding box of a temporal sequence set with an additional sequence. More... | |
void | tsequenceset_set_bbox (const TSequenceSet *ss, void *box) |
Return in the last argument the bounding box of a temporal sequence set. More... | |
Span * | tsequenceset_spans (const TSequenceSet *ss, int *count) |
Return an array of spans obtained from the segments of a temporal sequence set. More... | |
static Span * | tsequenceset_split_each_n_spans (const TSequenceSet *ss, int elems_per_span, int *count) |
Return an array of spans of a temporal number sequence set obtained by merging consecutive segments. More... | |
Span * | tsequenceset_split_n_spans (const TSequenceSet *ss, int span_count, int *count) |
Return an array of N spans from the segments of a temporal sequence set. More... | |
Bounding box operators for temporal types.
The bounding box of temporal values are
Span
for temporal BooleansTBox
for temporal integers and floats, where the x
coordinate is for the value dimension and the t
coordinate is for the time dimension. The following operators are defined: overlaps
, contains
, contained
, same
, and adjacent
.The operators consider as many dimensions as they are shared in both arguments: only the value dimension, only the time dimension, or both the value and the time dimensions.