MobilityDB  1.0
Functions
tpoint_tempspatialrels.c File Reference

Temporal spatial relationships for temporal points. More...

#include "point/tpoint_tempspatialrels.h"
#include <assert.h>
#include <utils/builtins.h>
#include <utils/timestamp.h>
#include "general/period.h"
#include "general/periodset.h"
#include "general/timeops.h"
#include "general/temporaltypes.h"
#include "general/temporal_util.h"
#include "general/tbool_boolops.h"
#include "point/tpoint.h"
#include "point/tpoint_spatialfuncs.h"
#include "point/tpoint_spatialrels.h"
Include dependency graph for tpoint_tempspatialrels.c:

Functions

static TInstanttinterrel_tpointinst_geom (const TInstant *inst, Datum geom, Datum(*func)(Datum, Datum))
 Evaluates tintersects/tdisjoint for a temporal point and a geometry. More...
 
static TInstantSettinterrel_tpointinstset_geom (const TInstantSet *ti, Datum geom, Datum(*func)(Datum, Datum))
 Evaluates tintersects/tdisjoint for a temporal point and a geometry. More...
 
static TSequence ** tinterrel_tpointseq_step_geom (const TSequence *seq, Datum geom, Datum(*func)(Datum, Datum), int *count)
 Evaluates tintersects/tdisjoint for a temporal sequence point with step interpolation and a geometry. More...
 
static TSequence ** tinterrel_tpointseq_simple_geom (const TSequence *seq, Datum geom, const STBOX *box, bool tinter, int *count)
 Evaluates tintersects/tdisjoint for a temporal sequence point and a geometry. More...
 
TSequence ** tinterrel_tpointseq_geom1 (const TSequence *seq, Datum geom, const STBOX *box, bool tinter, Datum(*func)(Datum, Datum), int *count)
 Evaluates tintersects/tdisjoint for a temporal sequence point and a geometry. More...
 
TSequenceSettinterrel_tpointseq_geom (const TSequence *seq, Datum geom, const STBOX *box, bool tinter, Datum(*func)(Datum, Datum))
 Evaluates tintersects/tdisjoint for a temporal sequence point and a geometry. More...
 
static TSequenceSettinterrel_tpointseqset_geom (const TSequenceSet *ts, Datum geom, const STBOX *box, bool tinter, Datum(*func)(Datum, Datum))
 Evaluates tintersects/tdisjoint for a temporal sequence set point and a geometry. More...
 
Temporaltinterrel_tpoint_geo (const Temporal *temp, GSERIALIZED *gs, bool tinter)
 Evaluates tintersects/tdisjoint for a temporal point and a geometry. More...
 
static TSequence ** tdwithin_tpointseq_geo1 (const TSequence *seq, Datum geo, Datum dist, int *count)
 Returns a temporal Boolean that states at each instant whether the temporal sequence set point and the geometry are within the given distance. More...
 
static TSequenceSettdwithin_tpointseq_geo (const TSequence *seq, Datum geo, Datum dist)
 Returns a temporal Boolean that states at each instant whether the temporal sequence point and the geometry are within the given distance. More...
 
static TSequenceSettdwithin_tpointseqset_geo (TSequenceSet *ts, Datum geo, Datum dist)
 Returns a temporal Boolean that states at each instant whether the temporal sequence set point and the geometry are within the given distance. More...
 
static int tdwithin_tpointseq_tpointseq1 (Datum sv1, Datum ev1, Datum sv2, Datum ev2, TimestampTz lower, TimestampTz upper, double dist, bool hasz, datum_func3 func, TimestampTz *t1, TimestampTz *t2)
 Returns the timestamps at which the segments of the two temporal points are within the given distance. More...
 
static int tdwithin_tpointseq_tpointseq2 (TSequence **result, const TSequence *seq1, const TSequence *seq2, Datum dist, datum_func3 func)
 Returns the timestamps at which the segments of two temporal points are within the given distance. More...
 
static TSequenceSettdwithin_tpointseq_tpointseq (const TSequence *seq1, const TSequence *seq2, Datum dist, datum_func3 func)
 Returns the timestamps at which the segments of two temporal points are within the given distance. More...
 
static TSequenceSettdwithin_tpointseqset_tpointseqset (const TSequenceSet *ts1, const TSequenceSet *ts2, Datum dist, datum_func3 func)
 Returns the timestamps at which the segments of two temporal points are within the given distance. More...
 
Temporaltcontains_geo_tpoint_internal (GSERIALIZED *gs, Temporal *temp)
 Returns the temporal contains relationship between the geometry and the temporal point (internal function) More...
 
PGDLLEXPORT Datum tcontains_geo_tpoint (PG_FUNCTION_ARGS)
 Returns the temporal contains relationship between the geometry and the temporal point. More...
 
PGDLLEXPORT Datum tdisjoint_geo_tpoint (PG_FUNCTION_ARGS)
 Returns the temporal intersects relationship between the temporal point and the geometry. More...
 
PGDLLEXPORT Datum tdisjoint_tpoint_geo (PG_FUNCTION_ARGS)
 Returns the temporal intersects relationship between the temporal point and the geometry. More...
 
PGDLLEXPORT Datum tintersects_geo_tpoint (PG_FUNCTION_ARGS)
 Returns the temporal intersects relationship between the temporal point and the geometry. More...
 
PGDLLEXPORT Datum tintersects_tpoint_geo (PG_FUNCTION_ARGS)
 Returns the temporal intersects relationship between the temporal point and the geometry. More...
 
Temporalttouches_tpoint_geo_internal (Temporal *temp, GSERIALIZED *gs)
 Returns the temporal touches relationship between the geometry and the temporal point (internal version) More...
 
PGDLLEXPORT Datum ttouches_geo_tpoint (PG_FUNCTION_ARGS)
 Returns the temporal touches relationship between the geometry and the temporal point. More...
 
PGDLLEXPORT Datum ttouches_tpoint_geo (PG_FUNCTION_ARGS)
 Returns the temporal touches relationship between the temporal point and the geometry. More...
 
Temporaltdwithin_tpoint_geo_internal (const Temporal *temp, GSERIALIZED *gs, Datum dist)
 Returns a temporal Boolean that states whether the temporal point and the geometry are within the given distance (dispatch function) More...
 
PGDLLEXPORT Datum tdwithin_geo_tpoint (PG_FUNCTION_ARGS)
 Returns a temporal Boolean that states whether the geometry and the temporal point are within the given distance. More...
 
PGDLLEXPORT Datum tdwithin_tpoint_geo (PG_FUNCTION_ARGS)
 Returns a temporal Boolean that states whether the temporal point and the geometry are within the given distance. More...
 
Temporaltdwithin_tpoint_tpoint_internal (const Temporal *temp1, const Temporal *temp2, Datum dist)
 Returns a temporal Boolean that states whether the temporal points are within the given distance (internal function) More...
 
PGDLLEXPORT Datum tdwithin_tpoint_tpoint (PG_FUNCTION_ARGS)
 Returns a temporal Boolean that states whether the temporal points are within the given distance. More...
 

Detailed Description

Temporal spatial relationships for temporal points.

These relationships are applied at each instant and result in a temporal Boolean.

The following relationships are supported for a temporal geometry point and a geometry: tcontains, tdisjoint, tintersects, ttouches, and tdwithin.

The following relationships are supported for two temporal geometry points: tdwithin.

The following relationships are supported for two temporal geography points: tdisjoint, tintersects, tdwithin.

tintersects and tdisjoint for a temporal point and a geometry allow a fast implementation by (1) using bounding box tests, and (2) splitting temporal sequence points into an array of simple (that is, not self-intersecting) fragments and the answer is computed for each fragment without any additional call to PostGIS.

The implementation of tcontains and ttouches involving a temporal point and a geometry is derived from the above by computing the boundary of the geometry and (1) tcontains(geo, tpoint) = tintersects(geo, tpoint) & ~ tintersects(st_boundary(geo), tpoint) where & and ~ are the temporal boolean operators and and not (2) ttouches(geo, tpoint) = tintersects(st_boundary(geo), tpoint)

Notice also that twithin has a custom implementation as follows