MobilityDB 1.3
Loading...
Searching...
No Matches
Functions | Variables
tgeo_restrict.c File Reference

Spatial restriction functions for temporal points. More...

#include <assert.h>
#include <postgres.h>
#include <utils/float.h>
#include <utils/timestamp.h>
#include <liblwgeom.h>
#include <liblwgeom_internal.h>
#include <lwgeodetic.h>
#include <meos.h>
#include <meos_internal.h>
#include <meos_internal_geo.h>
#include "temporal/lifting.h"
#include "temporal/span.h"
#include "temporal/temporal_restrict.h"
#include "temporal/tsequence.h"
#include "temporal/type_util.h"
#include "geo/postgis_funcs.h"
#include "geo/tgeo.h"
#include "geo/tgeo_spatialfuncs.h"
#include "geo/tgeo_spatialrels.h"

Functions

bool clipt (double p, double q, double *t0, double *t1)
 Clip the paramaters t0 and t1 for the Liang-Barsky clipping algorithm. More...
 
static int computeMaxBorderCode (double x, double y, double z, bool hasz, const STBox *box)
 Compute max border code for a point(x, y, z) More...
 
static int computeRegionCode (double x, double y, double z, bool hasz, const STBox *box)
 Compute region code for a point(x, y, z) More...
 
static bool liangBarskyClip (const GSERIALIZED *point1, const GSERIALIZED *point2, const STBox *box, bool hasz, bool border_inc, GSERIALIZED **point3, GSERIALIZED **point4, bool *p3_inc, bool *p4_inc)
 Clip a line segment using the Liang-Barsky algorithm. More...
 
static Datum point_force2d (Datum point, Datum srid)
 Force a point to be in 2D. More...
 
Temporaltgeo_at_geom (const Temporal *temp, const GSERIALIZED *gs)
 Return a temporal geo restricted to a geometry. More...
 
Temporaltgeo_at_stbox (const Temporal *temp, const STBox *box, bool border_inc)
 Return a temporal geo restricted to a spatiotemporal box. More...
 
Temporaltgeo_at_value (const Temporal *temp, GSERIALIZED *gs)
 Return a temporal geo restricted to a geometry/geography. More...
 
Temporaltgeo_minus_geom (const Temporal *temp, const GSERIALIZED *gs)
 Return a temporal geo restricted to the complement of a geometry. More...
 
Temporaltgeo_minus_stbox (const Temporal *temp, const STBox *box, bool border_inc)
 Return a temporal geo restricted to the complement of a spatiotemporal box. More...
 
Temporaltgeo_minus_value (const Temporal *temp, GSERIALIZED *gs)
 Return a temporal geo restricted to the complement of a geo. More...
 
Temporaltgeo_restrict_geom (const Temporal *temp, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal geo restricted to (the complement of) a geometry and possibly a Z span. More...
 
Temporaltgeo_restrict_stbox (const Temporal *temp, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal geo restricted to (the complement of) a spatiotemporal box. More...
 
bool tgeo_value_at_timestamptz (const Temporal *temp, TimestampTz t, bool strict, GSERIALIZED **value)
 Return the value of a temporal geo at a timestamptz. More...
 
TInstanttgeoinst_restrict_geom (const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal geo instant restricted to (the complement of) a geometry and possibly a Z span and a timestamptz span. More...
 
TInstanttgeoinst_restrict_geom_iter (const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal geo instant restricted to (the complement of) a geometry (iterator function) More...
 
TInstanttgeoinst_restrict_stbox (const TInstant *inst, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal geo instant restricted to (the complement of) a spatiotemporal box. More...
 
static TInstanttgeoinst_restrict_stbox_iter (const TInstant *inst, const STBox *box, bool border_inc UNUSED, bool atfunc)
 Return a temporal geo instant restricted to (the complement of) a spatiotemporal box (iterator function) More...
 
TSequencetgeoseq_disc_restrict_geom (const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal geo discrete sequence restricted to (the complement of) a geometry and possibly a Z span and a timestamptz span. More...
 
TSequencetgeoseq_disc_restrict_stbox (const TSequence *seq, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal point discrete sequence restricted to (the complement of) a spatiotemporal box. More...
 
Temporaltgeoseq_restrict_geom (const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal geo sequence restricted to (the complement of) a geometry and possibly a Z span and a timestamptz span. More...
 
Temporaltgeoseq_restrict_stbox (const TSequence *seq, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal geo sequence restricted to (the complement of) a spatiotemporal box. More...
 
TSequenceSettgeoseq_step_restrict_geom (const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal geo sequence with step interpolation restricted to a geometry and possibly a Z span and a timestamptz span. More...
 
TSequenceSettgeoseq_step_restrict_stbox (const TSequence *seq, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal point sequence with step interpolation restricted to a spatiotemporal box. More...
 
TSequenceSettgeoseqset_restrict_geom (const TSequenceSet *ss, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal geo sequence set restricted to (the complement of) a geometry and possibly a Z span and a timestamptz span. More...
 
TSequenceSettgeoseqset_restrict_stbox (const TSequenceSet *ss, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal geo sequence set restricted to (the complement of) a spatiotemporal box. More...
 
Temporaltpoint_at_geom (const Temporal *temp, const GSERIALIZED *gs, const Span *zspan)
 Return a temporal point restricted to a geometry. More...
 
static Temporaltpoint_at_stbox_segm (const Temporal *temp, const STBox *box, bool border_inc)
 Return a temporal point with the segments that intersect a spatiotemporal box in ONLY the spatial dimension. More...
 
Temporaltpoint_at_value (const Temporal *temp, GSERIALIZED *gs)
 Return a temporal point restricted to a point. More...
 
static Temporaltpoint_force2d (const Temporal *temp)
 Force a temporal point to be in 2D. More...
 
Temporaltpoint_minus_geom (const Temporal *temp, const GSERIALIZED *gs, const Span *zspan)
 Return a temporal point restricted to the complement of a geometry. More...
 
Temporaltpoint_minus_value (const Temporal *temp, GSERIALIZED *gs)
 Return a temporal point restricted to the complement of a point. More...
 
TInstanttpointinst_restrict_geom_iter (const TInstant *inst, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal point instant restricted to (the complement of) a spatiotemporal box (iterator function) More...
 
static TInstanttpointinst_restrict_stbox_iter (const TInstant *inst, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal point instant restricted to (the complement of) a spatiotemporal box (iterator function) More...
 
static bool tpointsegm_timestamp_at_value1_iter (const TInstant *inst1, const TInstant *inst2, Datum value, TimestampTz *t)
 Return the timestamp at which a segment of a temporal point takes a base value (iterator function) More...
 
static TSequenceSettpointseq_at_stbox_segm (const TSequence *seq, const STBox *box, bool border_inc)
 Return a temporal point sequence with the segments that intersect a spatiotemporal box in ONLY the spatial dimension. More...
 
Spantpointseq_interperiods (const TSequence *seq, const GSERIALIZED *gsinter, int *count)
 Get the periods at which a temporal point sequence with linear interpolation intersects a geometry. More...
 
static TSequenceSettpointseq_linear_at_geom (const TSequence *seq, const GSERIALIZED *gs)
 Return a temporal point sequence with linear interpolation restricted to a geometry. More...
 
TSequenceSettpointseq_linear_at_stbox_xyz (const TSequence *seq, const STBox *box, bool border_inc)
 Restrict the temporal point to the spatial dimensions of a spatiotemporal box. More...
 
TSequenceSettpointseq_linear_restrict_geom (const TSequence *seq, const GSERIALIZED *gs, const Span *zspan, bool atfunc)
 Return a temporal point sequence with linear interpolation restricted to (the complement of) a geometry and possibly a Z span and a timestamptz span. More...
 
TSequenceSettpointseq_linear_restrict_stbox (const TSequence *seq, const STBox *box, bool border_inc, bool atfunc)
 Return a temporal point sequence restricted to (the complement of) a spatiotemporal box. More...
 
static bool tpointseq_timestamp_at_value (const TSequence *seq, Datum value, TimestampTz *t)
 Return the timestamp at which a temporal point sequence is equal to a point. More...
 
static TSequenceSettpointseqset_at_stbox_segm (const TSequenceSet *ss, const STBox *box, bool border_inc)
 Return a temporal point sequence set with the segments that intersect a spatiotemporal box in BOTH the spatial and the temporal dimension (if any) More...
 

Variables

const int BACK = 32
 
const int BOTTOM = 4
 
const int FRONT = 16
 
const int INSIDE = 0
 
const int LEFT = 1
 
const int RIGHT = 2
 
const int TOP = 8
 
const int XMAX = 1
 
const int YMAX = 2
 
const int ZMAX = 4
 

Detailed Description

Spatial restriction functions for temporal points.