MobilityDB 1.1
Macros | Functions
stbox.c File Reference
#include "point/stbox.h"
#include <assert.h>
#include <meos.h>
#include <meos_internal.h>
#include "general/pg_types.h"
#include "general/set.h"
#include "general/temporal.h"
#include "general/tnumber_mathfuncs.h"
#include "general/type_util.h"
#include "point/pgis_call.h"
#include "point/tpoint.h"
#include "point/tpoint_parser.h"
#include "point/tpoint_spatialfuncs.h"
Include dependency graph for stbox.c:

Macros

#define MAXGBOXLEN   256
 Functions for spatiotemporal bounding boxes. More...
 
#define MAXSTBOXLEN   256
 

Functions

bool above_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly above of the second one. More...
 
bool adjacent_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the spatiotemporal boxes are adjacent. More...
 
bool after_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly after the second one. More...
 
bool back_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly back of the second one. More...
 
bool before_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly before the second one. More...
 
bool below_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly below of the second one. More...
 
bool contained_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is contained by the second one. More...
 
bool contains_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box contains the second one. More...
 
void ensure_has_T_stbox (const STBox *box)
 Ensure that the temporal value has T dimension. More...
 
void ensure_has_X_stbox (const STBox *box)
 Ensure that the temporal value has XY dimension. More...
 
bool front_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly in front of the second one. More...
 
STBoxgeo_period_to_stbox (const GSERIALIZED *gs, const Span *p)
 Return a spatiotemporal box from a geometry/geography and a period. More...
 
bool geo_set_stbox (const GSERIALIZED *gs, STBox *box)
 Set a spatiotemporal box from a geometry/geography. More...
 
STBoxgeo_timestamp_to_stbox (const GSERIALIZED *gs, TimestampTz t)
 Return a spatiotemporal box from a geometry/geography and a timestamp. More...
 
STBoxgeo_to_stbox (const GSERIALIZED *gs)
 Cast a geometry/geography to a spatiotemporal box. More...
 
void geoarr_set_stbox (const Datum *values, int count, STBox *box)
 Set the spatiotemporal box from an array of geometries/geographies. More...
 
bool inter_stbox_stbox (const STBox *box1, const STBox *box2, STBox *result)
 Set a spatiotemporal box with the result of the intersection of the first two boxes. More...
 
STBoxintersection_stbox_stbox (const STBox *box1, const STBox *box2)
 Return the intersection of the spatiotemporal boxes. More...
 
bool left_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly to the left of the second one. More...
 
void ll2cart (const POINT2D *g, POINT3D *p)
 
bool overabove_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box does not extend below of the second one. More...
 
bool overafter_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first temporal box does not extend before the second one. More...
 
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. More...
 
bool overbefore_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first temporal box does not extend after the second one. More...
 
bool overbelow_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box does not extend above of the second one. More...
 
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. More...
 
bool overlaps_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the spatiotemporal boxes overlap. More...
 
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. More...
 
bool overright_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatio temporal box does not extend to the left of the second one. More...
 
void period_set_stbox (const Span *p, STBox *box)
 Set a spatiotemporal box from a period. More...
 
STBoxperiod_to_stbox (const Span *p)
 Cast a period to a spatiotemporal box. More...
 
void periodset_set_stbox (const SpanSet *ps, STBox *box)
 Set a spatiotemporal box from a period set. More...
 
STBoxperiodset_to_stbox (const SpanSet *ps)
 Cast a period set to a spatiotemporal box. More...
 
static void pos_stbox_stbox_test (const STBox *box1, const STBox *box2)
 Verify the conditions for a position operator. More...
 
bool right_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is strictly to the right of the second one. More...
 
bool same_stbox_stbox (const STBox *box1, const STBox *box2)
 Return true if the spatiotemporal boxes are equal on the common dimensions. More...
 
int stbox_cmp (const STBox *box1, const STBox *box2)
 Return -1, 0, or 1 depending on whether the first spatiotemporal box is less than, equal, or greater than the second one. More...
 
STBoxstbox_copy (const STBox *box)
 Return a copy of a spatiotemporal box. More...
 
bool stbox_eq (const STBox *box1, const STBox *box2)
 Return true if the spatiotemporal boxes are equal. More...
 
void stbox_expand (const STBox *box1, STBox *box2)
 Expand the second spatiotemporal box with the first one. More...
 
STBoxstbox_expand_space (const STBox *box, double d)
 Return a spatiotemporal box expanded in the spatial dimension by a double. More...
 
STBoxstbox_expand_time (const STBox *box, const Interval *interval)
 Return a spatiotemporal box expanded in the temporal dimension by an interval. More...
 
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. More...
 
bool stbox_gt (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is greater than the second one. More...
 
bool stbox_hast (const STBox *box)
 Return true if a spatiotemporal box has time dimension. More...
 
bool stbox_hasx (const STBox *box)
 Return true if a spatiotemporal box has value dimension. More...
 
bool stbox_hasz (const STBox *box)
 Return true if a spatiotemporal box has Z dimension. More...
 
STBoxstbox_in (const char *str)
 Return a spatiotemporal box from its Well-Known Text (WKT) representation. More...
 
bool stbox_isgeodetic (const STBox *box)
 Return true if a spatiotemporal box is geodetic. More...
 
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. More...
 
bool stbox_lt (const STBox *box1, const STBox *box2)
 Return true if the first spatiotemporal box is less than the second one. More...
 
STBoxstbox_make (bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *p)
 Construct a spatiotemporal box from the arguments. More...
 
bool stbox_ne (const STBox *box1, const STBox *box2)
 Return true if the spatiotemporal boxes are different. More...
 
char * stbox_out (const STBox *box, int maxdd)
 Return the Well-Known Text (WKT) representation of a spatiotemporal box. More...
 
void stbox_set (bool hasx, bool hasz, bool geodetic, int32 srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const Span *p, STBox *box)
 Set a spatiotemporal box from the arguments. More...
 
void stbox_set_box3d (const STBox *box, BOX3D *box3d)
 Set a PostGIS BOX3D from a spatiotemporal box. More...
 
void stbox_set_gbox (const STBox *box, GBOX *gbox)
 Set a PostGIS GBOX from a spatiotemporal box. More...
 
STBoxstbox_set_srid (const STBox *box, int32 srid)
 Set the SRID of a spatiotemporal box. More...
 
void stbox_shift_tscale (STBox *box, const Interval *shift, const Interval *duration)
 Shift and/or scale a spatiotemporal box by the intervals. More...
 
int32 stbox_srid (const STBox *box)
 Return the SRID of a spatiotemporal box. More...
 
static void stbox_stbox_flags (const STBox *box1, const STBox *box2, bool *hasx, bool *hasz, bool *hast, bool *geodetic)
 Set the ouput variables with the values of the flags of the boxes. More...
 
bool stbox_tmax (const STBox *box, TimestampTz *result)
 Return true if the spatiotemporal box has time dimension. More...
 
bool stbox_tmin (const STBox *box, TimestampTz *result)
 Return true if the spatiotemporal box has time dimension. More...
 
GSERIALIZEDstbox_to_geo (const STBox *box)
 Cast a spatiotemporal box as a PostGIS geometry. More...
 
Spanstbox_to_period (const STBox *box)
 Cast a temporal box as a period. More...
 
bool stbox_xmax (const STBox *box, double *result)
 Return true if the spatiotemporal box has value dimension. More...
 
bool stbox_xmin (const STBox *box, double *result)
 Return true if the spatiotemporal box has value dimension. More...
 
bool stbox_ymax (const STBox *box, double *result)
 Return true if the spatiotemporal box has value dimension. More...
 
bool stbox_ymin (const STBox *box, double *result)
 Return true if the spatiotemporal box has value dimension. More...
 
bool stbox_zmax (const STBox *box, double *result)
 Return true if the spatiotemporal box has Z dimension. More...
 
bool stbox_zmin (const STBox *box, double *result)
 Return true if the spatiotemporal box has Z dimension. More...
 
void timestamp_set_stbox (TimestampTz t, STBox *box)
 Set a spatiotemporal box from a timestamp. More...
 
STBoxtimestamp_to_stbox (TimestampTz t)
 Cast a timestamp to a spatiotemporal box. More...
 
static void topo_stbox_stbox_init (const STBox *box1, const STBox *box2, bool *hasx, bool *hasz, bool *hast, bool *geodetic)
 Verify the conditions and set the ouput variables with the values of the flags of the boxes. More...
 
void tstzset_set_stbox (const Set *ts, STBox *box)
 Set a spatiotemporal box from a timestamp set. More...
 
STBoxtstzset_to_stbox (const Set *ts)
 Cast a timestamp set to a spatiotemporal box. More...
 
STBoxunion_stbox_stbox (const STBox *box1, const STBox *box2, bool strict)
 Return the union of the spatiotemporal boxes. More...