MobilityDB  1.0
Functions
tpoint_spatialrels.c File Reference

Spatial relationships for temporal points. More...

#include "point/tpoint_spatialrels.h"
#include <assert.h>
#include "general/temporaltypes.h"
#include "general/tempcache.h"
#include "general/temporal_util.h"
#include "point/tpoint.h"
#include "point/tpoint_spatialfuncs.h"
#include "point/tpoint_distance.h"
Include dependency graph for tpoint_spatialrels.c:

Functions

Datum geom_contains (Datum geom1, Datum geom2)
 Calls the PostGIS function ST_Contains with the 2 arguments. More...
 
Datum geom_disjoint (Datum geom1, Datum geom2)
 Calls the PostGIS function ST_Disjoint with the 2 arguments. More...
 
Datum geom_intersects2d (Datum geom1, Datum geom2)
 Calls the PostGIS function ST_Intersects with the 2 arguments. More...
 
Datum geom_intersects3d (Datum geom1, Datum geom2)
 Calls the PostGIS function ST_3DIntersects with the 2 arguments. More...
 
Datum geom_touches (Datum geom1, Datum geom2)
 Calls the PostGIS function ST_Touches with the 2 arguments. More...
 
datum_func3 get_dwithin_fn (int16 flags1, int16 flags2)
 Select the appropriate dwithin function. More...
 
Datum geom_dwithin2d (Datum geom1, Datum geom2, Datum dist)
 Calls the PostGIS function ST_DWithin with the 3 arguments. More...
 
Datum geom_dwithin3d (Datum geom1, Datum geom2, Datum dist)
 Calls the PostGIS function ST_3DDWithin with the 4 arguments. More...
 
Datum geog_intersects (Datum geog1, Datum geog2)
 Calls the PostGIS function ST_Intersects for geographies with the 2 arguments. More...
 
Datum geog_dwithin (Datum geog1, Datum geog2, Datum dist)
 Calls the PostGIS function ST_DWithin for geographies with the 2 arguments. More...
 
static bool dwithin_tpointseq_tpointseq1 (const TInstant *start1, const TInstant *end1, bool linear1, const TInstant *start2, const TInstant *end2, bool linear2, Datum dist, datum_func3 func)
 Returns true if the two segments of the temporal sequence points satisfy the ST_Dwithin relationship. More...
 
static bool dwithin_tpointseq_tpointseq (const TSequence *seq1, const TSequence *seq2, Datum dist, datum_func3 func)
 Returns true if the two temporal sequence points satisfy the ST_Dwithin relationship. More...
 
static bool dwithin_tpointseqset_tpointseqset (TSequenceSet *ts1, TSequenceSet *ts2, Datum dist, datum_func3 func)
 Returns true if the two temporal sequence set points satisfy the ST_Dwithin relationship. More...
 
Datum spatialrel_tpoint_geo1 (Temporal *temp, Datum geo, Datum param, Datum(*func)(Datum,...), int numparam, bool invert)
 Generic spatial relationships for a temporal point and a geometry. More...
 
static Datum spatialrel_geo_tpoint (FunctionCallInfo fcinfo, Datum(*func)(Datum,...), int numparam)
 Generic spatial relationships for a geometry and a temporal point. More...
 
Datum spatialrel_tpoint_geo (FunctionCallInfo fcinfo, Datum(*func)(Datum,...), int numparam)
 Generic spatial relationships for a temporal point and a geometry. More...
 
PGDLLEXPORT Datum contains_geo_tpoint (PG_FUNCTION_ARGS)
 Returns true if the geometry contains the trajectory of the temporal point. More...
 
PGDLLEXPORT Datum disjoint_geo_tpoint (PG_FUNCTION_ARGS)
 Returns true if the geometry and the trajectory of the temporal point are disjoint. More...
 
PGDLLEXPORT Datum disjoint_tpoint_geo (PG_FUNCTION_ARGS)
 Returns true if the trajectory of the temporal point and the geometry are disjoint. More...
 
PGDLLEXPORT Datum intersects_geo_tpoint (PG_FUNCTION_ARGS)
 Returns true if the geometry and the trajectory of the temporal point intersect. More...
 
PGDLLEXPORT Datum intersects_tpoint_geo (PG_FUNCTION_ARGS)
 Returns true if the trajectory of the temporal point and the geometry intersect. More...
 
PGDLLEXPORT Datum touches_geo_tpoint (PG_FUNCTION_ARGS)
 Returns true if the geometry touches the trajectory of the temporal point. More...
 
PGDLLEXPORT Datum touches_tpoint_geo (PG_FUNCTION_ARGS)
 Returns true if the trajectory of the temporal point touches the geometry. More...
 
PGDLLEXPORT Datum dwithin_geo_tpoint (PG_FUNCTION_ARGS)
 Returns true if the geometry and the trajectory of the temporal point are within the given distance. More...
 
PGDLLEXPORT Datum dwithin_tpoint_geo (PG_FUNCTION_ARGS)
 Returns true if the trajectory of the temporal point and the geometry are within the given distance. More...
 
PGDLLEXPORT Datum dwithin_tpoint_tpoint (PG_FUNCTION_ARGS)
 Returns true if the trajectories of the temporal points are within the given distance. More...
 

Detailed Description

Spatial relationships for temporal points.

These relationships project the time dimension and return a Boolean. They are thus defined with the "at any instant" semantics, that is, the traditional spatial function is applied to the union of all values taken by the trajectory of the temporal point. These functions are typically used for filtering purposes, before applying the corresponding temporal spatial relationship.

The following relationships are supported for geometries: contains, disjoint, intersects, touches, and dwithin.

The following relationships are supported for geographies: intersects, dwithin.

Only dwithin and intersects are supported for 3D geometries.