MobilityDB  1.0
Functions
temporal_boxops.c File Reference

Bounding box operators for temporal types. More...

#include "general/temporal_boxops.h"
#include <assert.h>
#include <utils/builtins.h>
#include <utils/timestamp.h>
#include "general/timestampset.h"
#include "general/period.h"
#include "general/periodset.h"
#include "general/timeops.h"
#include "general/temporaltypes.h"
#include "general/tempcache.h"
#include "general/temporal_util.h"
#include "general/rangetypes_ext.h"
#include "general/tbox.h"
#include "point/tpoint.h"
#include "point/stbox.h"
#include "point/tpoint_boxops.h"
#include "npoint/tnpoint_boxops.h"
Include dependency graph for temporal_boxops.c:

Functions

bool temporal_bbox_eq (const void *box1, const void *box2, Oid basetypid)
 Returns true if the bounding boxes are equal. More...
 
int temporal_bbox_cmp (const void *box1, const void *box2, Oid basetypid)
 Returns -1, 0, or 1 depending on whether the first bounding box is less than, equal, or greater than the second one. More...
 
void temporal_bbox_shift_tscale (void *box, const Interval *start, const Interval *duration, Oid basetypid)
 Shift and/or scale the time span of the bounding box with the two intervals. More...
 
void tinstant_make_bbox (void *box, const TInstant *inst)
 Set the bounding box from a temporal instant value. More...
 
static void tinstantarr_to_period (Period *period, const TInstant **instants, int count, bool lower_inc, bool upper_inc)
 Set the period from the array of temporal instant values. More...
 
static void tnumberinstarr_to_tbox (TBOX *box, const TInstant **instants, int count)
 Set the temporal box from the array of temporal number instant values. More...
 
void tinstantset_make_bbox (void *box, const TInstant **instants, int count)
 Set the bounding box from the array of temporal instant values (dispatch function) More...
 
void tsequence_make_bbox (void *box, const TInstant **instants, int count, bool lower_inc, bool upper_inc)
 Set the bounding box from the array of temporal instant values (dispatch function) More...
 
static void tsequencearr_to_period_internal (Period *period, const TSequence **sequences, int count)
 Set the period from the array of temporal sequence values. More...
 
static void tnumberseqarr_to_tbox_internal (TBOX *box, const TSequence **sequences, int count)
 Set the temporal box from the array of temporal number sequence values. More...
 
void tsequenceset_make_bbox (void *box, const TSequence **sequences, int count)
 Set the bounding box from the array of temporal sequence values (dispatch function) More...
 
Datum boxop_period_temporal (FunctionCallInfo fcinfo, bool(*func)(const Period *, const Period *))
 Generic bounding box operator for a period and a temporal value. More...
 
Datum boxop_temporal_period (FunctionCallInfo fcinfo, bool(*func)(const Period *, const Period *))
 Generic bounding box operator for a temporal value and a period. More...
 
Datum boxop_temporal_temporal (FunctionCallInfo fcinfo, bool(*func)(const Period *, const Period *))
 Generic bounding box operator for two temporal values. More...
 
PGDLLEXPORT Datum contains_bbox_period_temporal (PG_FUNCTION_ARGS)
 Returns true if the period contains the bounding period of the temporal value. More...
 
PGDLLEXPORT Datum contains_bbox_temporal_period (PG_FUNCTION_ARGS)
 Returns true if the bounding period of the temporal value contains the period. More...
 
PGDLLEXPORT Datum contains_bbox_temporal_temporal (PG_FUNCTION_ARGS)
 Returns true if the bounding period of the first temporal value contains the bounding period of the second one. More...
 
PGDLLEXPORT Datum contained_bbox_period_temporal (PG_FUNCTION_ARGS)
 Returns true if the period is contained the bounding period of the temporal value. More...
 
PGDLLEXPORT Datum contained_bbox_temporal_period (PG_FUNCTION_ARGS)
 Returns true if the bounding period of the temporal value is contained in the period. More...
 
PGDLLEXPORT Datum contained_bbox_temporal_temporal (PG_FUNCTION_ARGS)
 Returns true if the bounding period of the first temporal value is contained in the bounding period of the second one. More...
 
PGDLLEXPORT Datum overlaps_bbox_period_temporal (PG_FUNCTION_ARGS)
 Returns true if the period and the bounding period of the temporal value overlap. More...
 
PGDLLEXPORT Datum overlaps_bbox_temporal_period (PG_FUNCTION_ARGS)
 Returns true if the bounding period of the temporal value and the period overlap. More...
 
PGDLLEXPORT Datum overlaps_bbox_temporal_temporal (PG_FUNCTION_ARGS)
 Returns true if the bounding periods of the temporal values overlap. More...
 
PGDLLEXPORT Datum same_bbox_period_temporal (PG_FUNCTION_ARGS)
 Returns true if the period and the bounding period of the temporal value are equal. More...
 
PGDLLEXPORT Datum same_bbox_temporal_period (PG_FUNCTION_ARGS)
 Returns true if the bounding period of the temporal value and the period are equal. More...
 
PGDLLEXPORT Datum same_bbox_temporal_temporal (PG_FUNCTION_ARGS)
 Returns true if the bounding periods of the temporal values are equal. More...
 
PGDLLEXPORT Datum adjacent_bbox_period_temporal (PG_FUNCTION_ARGS)
 Returns true if the period and the bounding period of the temporal value are adjacent. More...
 
PGDLLEXPORT Datum adjacent_bbox_temporal_period (PG_FUNCTION_ARGS)
 Returns true if the bounding period of the temporal value and the period are adjacent. More...
 
PGDLLEXPORT Datum adjacent_bbox_temporal_temporal (PG_FUNCTION_ARGS)
 Returns true if the bounding periods of the temporal values are adjacent. More...
 
Datum boxop_range_tnumber (FunctionCallInfo fcinfo, bool(*func)(const TBOX *, const TBOX *))
 Generic bounding box operator for a range and a temporal number. More...
 
Datum boxop_tnumber_range (FunctionCallInfo fcinfo, bool(*func)(const TBOX *, const TBOX *))
 Generic bounding box operator for a temporal number and a range. More...
 
Datum boxop_tbox_tnumber (FunctionCallInfo fcinfo, bool(*func)(const TBOX *, const TBOX *))
 Generic bounding box operator for a temporal box and a temporal number. More...
 
Datum boxop_tnumber_tbox (FunctionCallInfo fcinfo, bool(*func)(const TBOX *, const TBOX *))
 Generic bounding box operator for a temporal number and a temporal box. More...
 
Datum boxop_tnumber_tnumber (FunctionCallInfo fcinfo, bool(*func)(const TBOX *, const TBOX *))
 Generic bounding box operator for two temporal numbers. More...
 
PGDLLEXPORT Datum contains_bbox_range_tnumber (PG_FUNCTION_ARGS)
 Returns true if the range contains the bounding box of the temporal number. More...
 
PGDLLEXPORT Datum contains_bbox_tnumber_range (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number contains the range. More...
 
PGDLLEXPORT Datum contains_bbox_tbox_tnumber (PG_FUNCTION_ARGS)
 Returns true if the temporal box contains the bounding box of the temporal number. More...
 
PGDLLEXPORT Datum contains_bbox_tnumber_tbox (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number contains the temporal box. More...
 
PGDLLEXPORT Datum contains_bbox_tnumber_tnumber (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the first temporal number contains the one of the second temporal number. More...
 
PGDLLEXPORT Datum contained_bbox_range_tnumber (PG_FUNCTION_ARGS)
 Returns true if the range is contained in the bounding box of the temporal number. More...
 
PGDLLEXPORT Datum contained_bbox_tnumber_range (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number is contained in the range. More...
 
PGDLLEXPORT Datum contained_bbox_tbox_tnumber (PG_FUNCTION_ARGS)
 Returns true if the temporal box is contained in the bounding box of the temporal number. More...
 
PGDLLEXPORT Datum contained_bbox_tnumber_tbox (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number is contained in the temporal box. More...
 
PGDLLEXPORT Datum contained_bbox_tnumber_tnumber (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the first temporal number is contained in the one of the second temporal number. More...
 
PGDLLEXPORT Datum overlaps_bbox_range_tnumber (PG_FUNCTION_ARGS)
 Returns true if the range and the bounding box of the temporal number overlap. More...
 
PGDLLEXPORT Datum overlaps_bbox_tnumber_range (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number and the the range overlap. More...
 
PGDLLEXPORT Datum overlaps_bbox_tbox_tnumber (PG_FUNCTION_ARGS)
 Returns true if the temporal box and the bounding box of the temporal number overlap. More...
 
PGDLLEXPORT Datum overlaps_bbox_tnumber_tbox (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number and the temporal box overlap. More...
 
PGDLLEXPORT Datum overlaps_bbox_tnumber_tnumber (PG_FUNCTION_ARGS)
 Returns true if the bounding boxes of the temporal numbers overlap. More...
 
PGDLLEXPORT Datum same_bbox_range_tnumber (PG_FUNCTION_ARGS)
 Returns true if the range and the bounding box of the temporal number are equal on the common dimensions. More...
 
PGDLLEXPORT Datum same_bbox_tnumber_range (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number and the the range are equal on the common dimensions. More...
 
PGDLLEXPORT Datum same_bbox_tbox_tnumber (PG_FUNCTION_ARGS)
 Returns true if the temporal box and the bounding box of the temporal number are equal in the common dimensions. More...
 
PGDLLEXPORT Datum same_bbox_tnumber_tbox (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number and the temporal box are equal in the common dimensions. More...
 
PGDLLEXPORT Datum same_bbox_tnumber_tnumber (PG_FUNCTION_ARGS)
 Returns true if the bounding boxes of the temporal numbers are equal in the common dimensions. More...
 
PGDLLEXPORT Datum adjacent_bbox_range_tnumber (PG_FUNCTION_ARGS)
 Returns true if the range and the bounding box of the temporal number are adjancent. More...
 
PGDLLEXPORT Datum adjacent_bbox_tnumber_range (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number and the the range are adjacent. More...
 
PGDLLEXPORT Datum adjacent_bbox_tbox_tnumber (PG_FUNCTION_ARGS)
 Returns true if the temporal box and the bounding box of the temporal number are adjacent. More...
 
PGDLLEXPORT Datum adjacent_bbox_tnumber_tbox (PG_FUNCTION_ARGS)
 Returns true if the bounding box of the temporal number and the temporal box are adjacent. More...
 
PGDLLEXPORT Datum adjacent_bbox_tnumber_tnumber (PG_FUNCTION_ARGS)
 Returns true if the bounding boxes of the temporal numbers are adjacent. More...
 

Detailed Description

Bounding box operators for temporal types.

The bounding box of temporal values are

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.