MobilityDB  1.0
Macros | Enumerations | Functions | Variables
tpoint_spatialfuncs.c File Reference

Spatial functions for temporal points. More...

#include "point/tpoint_spatialfuncs.h"
#include <assert.h>
#include "general/period.h"
#include "general/periodset.h"
#include "general/timeops.h"
#include "general/rangetypes_ext.h"
#include "general/temporaltypes.h"
#include "general/tempcache.h"
#include "general/tnumber_mathfuncs.h"
#include "point/postgis.h"
#include "point/stbox.h"
#include "point/tpoint.h"
#include "point/tpoint_boxops.h"
#include "point/tpoint_distance.h"
#include "point/tpoint_spatialrels.h"
Include dependency graph for tpoint_spatialfuncs.c:

Macros

#define M_PI   3.14159265358979323846
 
#define RADIANS_PER_DEGREE   0.0174532925199432957692
 
#define GS_POINT_PTR(gs)   ((uint8_t *) gs->data + 8)
 
#define GEOG_FROM_GEOM   true
 Symbolic constants for transforming tgeompoint <-> tgeogpoint. More...
 
#define GEOM_FROM_GEOG   false
 

Enumerations

enum  { MOBDB_SEG_NO_INTERSECTION, MOBDB_SEG_OVERLAP, MOBDB_SEG_CROSS, MOBDB_SEG_TOUCH }
 

Functions

FunctionCallInfo fetch_fcinfo ()
 Fetch from the cache the fcinfo of the external function. More...
 
void store_fcinfo (FunctionCallInfo fcinfo)
 Store in the cache the fcinfo of the external function. More...
 
POINT2D datum_get_point2d (Datum geom)
 Returns a 2D point from the datum. More...
 
const POINT2D * datum_get_point2d_p (Datum geom)
 Returns a pointer to a 2D point from the datum. More...
 
const POINT2D * gs_get_point2d_p (GSERIALIZED *gs)
 Returns a 2D point from the serialized geometry. More...
 
POINT3DZ datum_get_point3dz (Datum geom)
 Returns a 3DZ point from the datum. More...
 
const POINT3DZ * datum_get_point3dz_p (Datum geom)
 Returns a pointer to a 3DZ point from the datum. More...
 
const POINT3DZ * gs_get_point3dz_p (GSERIALIZED *gs)
 Returns a 3DZ point from the serialized geometry. More...
 
void datum_get_point4d (POINT4D *p, Datum geom)
 Returns a 4D point from the datum. More...
 
bool datum_point_eq (Datum geopoint1, Datum geopoint2)
 Returns true if the two points are equal. More...
 
GSERIALIZED * geo_serialize (LWGEOM *geom)
 Serialize a geometry/geography. More...
 
Datum datum_transform (Datum value, Datum srid)
 Call the PostGIS transform function. More...
 
datum_func2 get_distance_fn (int16 flags)
 Select the appropriate distance function. More...
 
datum_func2 get_pt_distance_fn (int16 flags)
 Select the appropriate distance function. More...
 
Datum geom_distance2d (Datum geom1, Datum geom2)
 Returns the 2D distance between the two geometries. More...
 
Datum geom_distance3d (Datum geom1, Datum geom2)
 Returns the 3D distance between the two geometries. More...
 
Datum geog_distance (Datum geog1, Datum geog2)
 Returns the distance between the two geographies. More...
 
Datum pt_distance2d (Datum geom1, Datum geom2)
 Returns the 2D distance between the two geometric points. More...
 
Datum pt_distance3d (Datum geom1, Datum geom2)
 Returns the 3D distance between the two geometric points. More...
 
void ensure_spatial_validity (const Temporal *temp1, const Temporal *temp2)
 Ensure that the spatial constraints required for operating on two temporal geometries are satisfied. More...
 
void ensure_not_geodetic_gs (const GSERIALIZED *gs)
 Ensure that the spatial argument has planar coordinates. More...
 
void ensure_not_geodetic (int16 flags)
 Ensure that the spatiotemporal argument has planar coordinates. More...
 
void ensure_same_geodetic (int16 flags1, int16 flags2)
 Ensure that the spatiotemporal argument have the same type of coordinates, either planar or geodetic. More...
 
void ensure_same_geodetic_gs (const GSERIALIZED *gs1, const GSERIALIZED *gs2)
 Ensure that the spatiotemporal argument have the same type of coordinates, either planar or geodetic. More...
 
void ensure_same_srid (int32_t srid1, int32_t srid2)
 Ensure that the two spatial "objects" have the same SRID. More...
 
void ensure_same_srid_stbox (const STBOX *box1, const STBOX *box2)
 Ensure that the spatiotemporal boxes have the same SRID. More...
 
void ensure_same_srid_tpoint_stbox (const Temporal *temp, const STBOX *box)
 Ensure that the temporal point and the spatiotemporal boxes have the same SRID. More...
 
void ensure_same_srid_stbox_gs (const STBOX *box, const GSERIALIZED *gs)
 Ensure that the temporal point and the geometry/geography have the same SRID. More...
 
void ensure_same_dimensionality (int16 flags1, int16 flags2)
 Ensure that the temporal values have the same dimensionality. More...
 
void ensure_same_spatial_dimensionality (int16 flags1, int16 flags2)
 Ensure that the temporal values have the same spatial dimensionality. More...
 
void ensure_same_dimensionality_gs (const GSERIALIZED *gs1, const GSERIALIZED *gs2)
 Ensure that the geometries/geographies have the same dimensionality. More...
 
void ensure_same_dimensionality_tpoint_gs (const Temporal *temp, const GSERIALIZED *gs)
 Ensure that the temporal point and the geometry/geography have the same dimensionality. More...
 
void ensure_same_spatial_dimensionality_stbox_gs (const STBOX *box, const GSERIALIZED *gs)
 Ensure that the spatiotemporal boxes have the same spatial dimensionality. More...
 
void ensure_has_Z (int16 flags)
 Ensure that the temporal value has Z dimension. More...
 
void ensure_has_Z_tpoint (const Temporal *temp)
 Ensure that the temporal point has Z dimension. More...
 
void ensure_has_Z_gs (const GSERIALIZED *gs)
 Ensure that the geometry/geography has not Z dimension. More...
 
void ensure_has_not_Z_gs (const GSERIALIZED *gs)
 Ensure that the geometry/geography has not Z dimension. More...
 
void ensure_has_M_gs (const GSERIALIZED *gs)
 Ensure that the geometry/geography has M dimension. More...
 
void ensure_has_not_M_gs (const GSERIALIZED *gs)
 Ensure that the geometry/geography has not M dimension. More...
 
void ensure_point_type (const GSERIALIZED *gs)
 Ensure that the geometry/geography is a point. More...
 
void ensure_non_empty (const GSERIALIZED *gs)
 Ensure that the geometry/geography is not empty. More...
 
static bool lw_seg_interact (const POINT2D p1, const POINT2D p2, const POINT2D q1, const POINT2D q2)
 Function derived from PostGIS file lwalgorithm.c since it is declared static. More...
 
long double closest_point2d_on_segment_ratio (const POINT2D *p, const POINT2D *A, const POINT2D *B, POINT2D *closest)
 Returns a long double between 0 and 1 representing the location of the closest point on the segment to the given point, as a fraction of total segment length (2D version). More...
 
long double closest_point3dz_on_segment_ratio (const POINT3DZ *p, const POINT3DZ *A, const POINT3DZ *B, POINT3DZ *closest)
 Returns a float between 0 and 1 representing the location of the closest point on the segment to the given point, as a fraction of total segment length (3D version). More...
 
long double closest_point_on_segment_sphere (const POINT4D *p, const POINT4D *A, const POINT4D *B, POINT4D *closest, double *dist)
 Returns a float between 0 and 1 representing the location of the closest point on the geography segment to the given point, as a fraction of total segment length. More...
 
Datum point_make (double x, double y, double z, bool hasz, bool geodetic, int32 srid)
 Create a point. More...
 
Datum geoseg_interpolate_point (Datum start, Datum end, long double ratio)
 Returns a point interpolated from the geometry/geography segment with respect to the fraction of its total length. More...
 
long double geoseg_locate_point (Datum start, Datum end, Datum point, double *dist)
 Returns a float between 0 and 1 representing the location of the closest point on the geometry segment to the given point, as a fraction of total segment length. More...
 
bool tpointseq_intersection_value (const TInstant *inst1, const TInstant *inst2, Datum value, TimestampTz *t)
 Returns true if the segment of the temporal point value intersects the base value at the timestamp. More...
 
bool tgeompointseq_intersection (const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
 Returns true if the two segments of the temporal geometric point values intersect at the timestamp. More...
 
bool tgeogpointseq_intersection (const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
 Returns true if the two segments of the temporal geographic point values intersect at the timestamp. More...
 
bool geopoint_collinear (Datum value1, Datum value2, Datum value3, double ratio, bool hasz, bool geodetic)
 Returns true if the three values are collinear. More...
 
LWGEOM * lwpointarr_make_trajectory (LWGEOM **lwpoints, int count, bool linear)
 Compute a trajectory from a set of points. More...
 
Datum tpointinstset_trajectory (const TInstantSet *ti)
 Compute the trajectory of a temporal instant set point. More...
 
LWLINE * geopoint_lwline (Datum value1, Datum value2)
 Compute the trajectory from two geometry points. More...
 
Datum geopoint_line (Datum value1, Datum value2)
 Compute the trajectory from two points. More...
 
Datum tpointseq_make_trajectory (const TInstant **instants, int count, bool linear)
 Compute the trajectory of an array of instants. More...
 
Datum tpointseq_trajectory (const TSequence *seq)
 Returns the precomputed trajectory of a temporal sequence point. More...
 
Datum tpointseq_trajectory_copy (const TSequence *seq)
 Copy the precomputed trajectory of a temporal sequence point. More...
 
Datum tpointseqset_trajectory (const TSequenceSet *ts)
 Returns the trajectory of a temporal point with sequence set type from the precomputed trajectories of its composing segments. More...
 
Datum tpoint_trajectory_internal (const Temporal *temp)
 Returns the trajectory of a temporal point (dispatch function) More...
 
void tpoint_trajectory_free (const Temporal *temp, Datum traj)
 Free the trajectory after a call to tpoint_trajectory_internal. More...
 
Datum tpoint_trajectory_external (const Temporal *temp)
 Returns the trajectory of a temporal point (dispatch function) More...
 
PGDLLEXPORT Datum tpoint_trajectory (PG_FUNCTION_ARGS)
 Returns the trajectory of a temporal point. More...
 
PGDLLEXPORT Datum stbox_srid (PG_FUNCTION_ARGS)
 Returns the SRID of the spatiotemporal box. More...
 
PGDLLEXPORT Datum stbox_set_srid (PG_FUNCTION_ARGS)
 Sets the SRID of the spatiotemporal box. More...
 
int tpointinst_srid (const TInstant *inst)
 Returns the SRID of a temporal instant point. More...
 
int tpointinstset_srid (const TInstantSet *ti)
 Returns the SRID of a temporal instant set point. More...
 
int tpointseq_srid (const TSequence *seq)
 Returns the SRID of a temporal sequence point. More...
 
int tpointseqset_srid (const TSequenceSet *ts)
 Returns the SRID of a temporal sequence set point. More...
 
int tpoint_srid_internal (const Temporal *temp)
 Returns the SRID of a temporal point (dispatch function) More...
 
PGDLLEXPORT Datum tpoint_srid (PG_FUNCTION_ARGS)
 Returns the SRID of a temporal point. More...
 
static TInstanttpointinst_set_srid (TInstant *inst, int32 srid)
 Set the SRID of a temporal instant point. More...
 
static TInstantSettpointinstset_set_srid (TInstantSet *ti, int32 srid)
 Set the SRID of a temporal instant set point. More...
 
static TSequencetpointseq_set_srid (TSequence *seq, int32 srid)
 Set the SRID of a temporal sequence point. More...
 
static TSequenceSettpointseqset_set_srid (TSequenceSet *ts, int32 srid)
 Set the SRID of a temporal sequence set point. More...
 
Temporaltpoint_set_srid_internal (Temporal *temp, int32 srid)
 Set the SRID of a temporal point (dispatch function) More...
 
PGDLLEXPORT Datum tpoint_set_srid (PG_FUNCTION_ARGS)
 Set the SRID of a temporal point. More...
 
PGDLLEXPORT Datum stbox_transform (PG_FUNCTION_ARGS)
 Transform a spatiotemporal box into another spatial reference system. More...
 
TInstanttpointinst_transform (const TInstant *inst, Datum srid)
 Transform a temporal instant point into another spatial reference system. More...
 
static TInstantSettpointinstset_transform (const TInstantSet *ti, Datum srid)
 Transform a temporal instant set point into another spatial reference system. More...
 
static TSequencetpointseq_transform (const TSequence *seq, Datum srid)
 Transform a temporal sequence point into another spatial reference system. More...
 
static TSequenceSettpointseqset_transform (const TSequenceSet *ts, Datum srid)
 Transform a temporal sequence set point into another spatial reference system. More...
 
PGDLLEXPORT Datum tpoint_transform (PG_FUNCTION_ARGS)
 Transform a temporal point into another spatial reference system. More...
 
static TInstanttpointinst_convert_tgeom_tgeog (const TInstant *inst, bool oper)
 Converts the temporal point to a geometry/geography point. More...
 
static TInstantSettpointinstset_convert_tgeom_tgeog (const TInstantSet *ti, bool oper)
 Converts the temporal point to a geometry/geography point. More...
 
static TSequencetpointseq_convert_tgeom_tgeog (const TSequence *seq, bool oper)
 Converts the temporal point to a geometry/geography point. More...
 
static TSequenceSettpointseqset_convert_tgeom_tgeog (const TSequenceSet *ts, bool oper)
 Converts the temporal point to a geometry/geography point. More...
 
Temporaltpoint_convert_tgeom_tgeog (const Temporal *temp, bool oper)
 Converts the temporal point to a geometry/geography point (dispatch function) More...
 
PGDLLEXPORT Datum tgeompoint_to_tgeogpoint (PG_FUNCTION_ARGS)
 Converts a temporal geometry point to a temporal geography point. More...
 
PGDLLEXPORT Datum tgeogpoint_to_tgeompoint (PG_FUNCTION_ARGS)
 Converts a temporal geography point to a temporal geometry point. More...
 
static void set_precision_point (POINTARRAY *points, uint32_t i, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_point (Datum value, Datum prec)
 
static void set_precision_linestring (LWLINE *lwline, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_linestring (Datum value, Datum prec)
 
static void set_precision_triangle (LWTRIANGLE *lwtriangle, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_triangle (Datum value, Datum prec)
 
static void set_precision_circularstring (LWCIRCSTRING *lwcircstring, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_circularstring (Datum value, Datum prec)
 
static void set_precision_polygon (LWPOLY *lwpoly, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_polygon (Datum value, Datum prec)
 
static void set_precision_multipoint (LWMPOINT *lwmpoint, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_multipoint (Datum value, Datum prec)
 
static void set_precision_multilinestring (LWMLINE *lwmline, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_multilinestring (Datum value, Datum prec)
 
static void set_precision_multipolygon (LWMPOLY *lwmpoly, Datum prec, bool hasz, bool hasm)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision_multipolygon (Datum value, Datum prec)
 
static Datum datum_set_precision_geometrycollection (Datum value, Datum prec)
 Set the precision of the coordinates to the number of decimal places. More...
 
static Datum datum_set_precision (Datum value, Datum prec)
 Set the precision of the coordinates to the number of decimal places. More...
 
PGDLLEXPORT Datum geo_set_precision (PG_FUNCTION_ARGS)
 Sets the precision of the coordinates of the geometry. More...
 
PGDLLEXPORT Datum tpoint_set_precision (PG_FUNCTION_ARGS)
 Set the precision of the coordinates of the temporal point to the number of decimal places. More...
 
static Datum point_get_x (Datum point)
 Get the X coordinates of the temporal point. More...
 
static Datum point_get_y (Datum point)
 Get the Y coordinates of the temporal point. More...
 
static Datum point_get_z (Datum point)
 Get the Z coordinates of the temporal point. More...
 
Temporaltpoint_get_coord_internal (const Temporal *temp, char c)
 Get the X coordinates of the temporal point (internal function) More...
 
PGDLLEXPORT Datum tpoint_get_x (PG_FUNCTION_ARGS)
 Get the X coordinates of the temporal point. More...
 
PGDLLEXPORT Datum tpoint_get_y (PG_FUNCTION_ARGS)
 Get the Y coordinates of the temporal point. More...
 
PGDLLEXPORT Datum tpoint_get_z (PG_FUNCTION_ARGS)
 Get the Z coordinates of the temporal point. More...
 
static double tpointseq_length (const TSequence *seq)
 Returns the length traversed by the temporal sequence point. More...
 
static double tpointseqset_length (const TSequenceSet *ts)
 Returns the length traversed by the temporal sequence set point. More...
 
PGDLLEXPORT Datum tpoint_length (PG_FUNCTION_ARGS)
 Returns the length traversed by the temporal sequence (set) point. More...
 
static TInstanttpointinst_cumulative_length (const TInstant *inst)
 Returns the cumulative length traversed by the temporal instant point. More...
 
static TInstantSettpointinstset_cumulative_length (const TInstantSet *ti)
 Returns the cumulative length traversed by the temporal instant set point. More...
 
static TSequencetpointseq_cumulative_length (const TSequence *seq, double prevlength)
 Returns the cumulative length traversed by the temporal sequence point. More...
 
static TSequenceSettpointseqset_cumulative_length (const TSequenceSet *ts)
 Returns the cumulative length traversed by the temporal sequence set point. More...
 
PGDLLEXPORT Datum tpoint_cumulative_length (PG_FUNCTION_ARGS)
 Returns the cumulative length traversed by the temporal point. More...
 
static TSequencetpointseq_speed (const TSequence *seq)
 Returns the speed of the temporal point. More...
 
static TSequenceSettpointseqset_speed (const TSequenceSet *ts)
 Returns the speed of the temporal point. More...
 
PGDLLEXPORT Datum tpoint_speed (PG_FUNCTION_ARGS)
 Returns the speed of the temporal point. More...
 
Datum tpointinstset_twcentroid (const TInstantSet *ti)
 Returns the time-weighed centroid of the temporal geometry point of instant set type. More...
 
Datum tpointseq_twcentroid (const TSequence *seq)
 Returns the time-weighed centroid of the temporal geometry point of sequence type. More...
 
Datum tpointseqset_twcentroid (const TSequenceSet *ts)
 Returns the time-weighed centroid of the temporal geometry point of sequence set type. More...
 
Datum tpoint_twcentroid_internal (Temporal *temp)
 Returns the time-weighed centroid of the temporal geometry point (dispatch function) More...
 
PGDLLEXPORT Datum tpoint_twcentroid (PG_FUNCTION_ARGS)
 Returns the time-weighed centroid of the temporal geometry point. More...
 
static Datum geom_azimuth (Datum geom1, Datum geom2)
 Returns the azimuth of the two geometry points. More...
 
static Datum geog_azimuth (Datum geom1, Datum geom2)
 Returns the azimuth the two geography points. More...
 
static int tpointseq_azimuth1 (TSequence **result, const TSequence *seq)
 Returns the temporal azimuth of the temporal geometry point of sequence type. More...
 
TSequenceSettpointseq_azimuth (const TSequence *seq)
 Returns the temporal azimuth of the temporal geometry point of sequence type. More...
 
TSequenceSettpointseqset_azimuth (TSequenceSet *ts)
 Returns the temporal azimuth of the temporal geometry point of sequence set type. More...
 
PGDLLEXPORT Datum tpoint_azimuth (PG_FUNCTION_ARGS)
 Returns the temporal azimuth of the temporal geometry point. More...
 
Datum dsin (PG_FUNCTION_ARGS)
 
Datum dcos (PG_FUNCTION_ARGS)
 
Datum datan (PG_FUNCTION_ARGS)
 
Datum datan2 (PG_FUNCTION_ARGS)
 
static double alpha (const POINT2D *p1, const POINT2D *p2)
 Normalize the bearing from -180° to + 180° (in radians) to 0° to 360° (in radians) More...
 
Datum geom_bearing (Datum point1, Datum point2)
 Computes the bearing between two geometric points. More...
 
Datum geog_bearing (Datum point1, Datum point2)
 Computes the bearing between two geographic points. More...
 
datum_func2 get_bearing_fn (int16 flags)
 Select the appropriate bearing function. More...
 
bool tpoint_geo_min_bearing_at_timestamp (const TInstant *start, const TInstant *end, Datum point, Oid basetypid, Datum *value, TimestampTz *t)
 Returns the value and timestamp at which the a temporal point segment and a point are at the minimum bearing. More...
 
bool tpoint_min_bearing_at_timestamp (const TInstant *start1, const TInstant *end1, bool linear1, const TInstant *start2, const TInstant *end2, bool linear2, Datum *value, TimestampTz *t)
 Returns the value and timestamp at which the two temporal point segments are at the minimum bearing. More...
 
PGDLLEXPORT Datum bearing_geo_geo (PG_FUNCTION_ARGS)
 Returns the temporal bearing between the geometry/geography points. More...
 
Temporalbearing_tpoint_geo_internal (const Temporal *temp, Datum geo, bool invert)
 Returns the temporal bearing between the temporal point and the geometry/geography point (distpatch function) More...
 
PGDLLEXPORT Datum bearing_geo_tpoint (PG_FUNCTION_ARGS)
 Returns the temporal bearing between the geometry/geography point and the temporal point. More...
 
PGDLLEXPORT Datum bearing_tpoint_geo (PG_FUNCTION_ARGS)
 Returns the temporal bearing between the temporal point and the geometry/geography point. More...
 
Temporalbearing_tpoint_tpoint_internal (const Temporal *temp1, const Temporal *temp2)
 Returns the temporal bearing between the two temporal points (dispatch function) More...
 
PGDLLEXPORT Datum bearing_tpoint_tpoint (PG_FUNCTION_ARGS)
 Returns the temporal bearing between the two temporal points. More...
 
static int parseg2d_intersection (const POINT2D a, const POINT2D b, const POINT2D c, const POINT2D d, POINT2D *p)
 Finds the UNIQUE point of intersection p between two closed collinear segments ab and cd. More...
 
static int seg2d_intersection (const POINT2D a, const POINT2D b, const POINT2D c, const POINT2D d, POINT2D *p)
 Finds the UNIQUE point of intersection p between two closed segments ab and cd. More...
 
static bool * tpoint_instarr_find_splits (const Temporal *temp, int *count)
 Split a temporal point of subtype instant set or sequence with stepwise interpolation into an array of non self-intersecting pieces. More...
 
static bool * tpointseq_linear_find_splits (const TSequence *seq, int *count)
 Split a temporal point sequence with linear interpolation into an array of non self-intersecting pieces. More...
 
static bool tpoint_instarr_is_simple (const Temporal *temp, int count)
 Determine whether a temporal point is self-intersecting. More...
 
static bool tpointinstset_is_simple (const TInstantSet *ti)
 Determine whether a temporal point is self-intersecting. More...
 
static bool tpointseq_is_simple (const TSequence *seq)
 Determine whether a temporal point is self-intersecting. More...
 
static bool tpointseqset_is_simple (const TSequenceSet *ts)
 Determine whether a temporal point is self-intersecting. More...
 
PGDLLEXPORT Datum tpoint_is_simple (PG_FUNCTION_ARGS)
 Determine whether a temporal point is self-intersecting. More...
 
static TInstantSet ** tpointinstset_split (const TInstantSet *ti, bool *splits, int count)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
TInstantSet ** tpointinstset_make_simple1 (const TInstantSet *ti, int *count)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
static ArrayType * tpointinstset_make_simple (const TInstantSet *ti)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
static TSequence ** tpointseq_split (const TSequence *seq, bool *splits, int count)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
TSequence ** tpointseq_make_simple1 (const TSequence *seq, int *count)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
static ArrayType * tpointseq_make_simple (const TSequence *seq)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
static ArrayType * tpointseqset_make_simple (const TSequenceSet *ts)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
PGDLLEXPORT Datum tpoint_make_simple (PG_FUNCTION_ARGS)
 Split a temporal point into an array of non self-intersecting pieces. More...
 
static TInstanttpointinst_restrict_geometry (const TInstant *inst, Datum geom, bool atfunc)
 Restricts the temporal instant point to the (complement of the) geometry. More...
 
static TInstantSettpointinstset_restrict_geometry (const TInstantSet *ti, Datum geom, bool atfunc)
 Restricts the temporal instant set point to the (complement of the) geometry. More...
 
static int gsinter_get_points (Datum *result, GSERIALIZED *gsinter)
 Get the intersection points. More...
 
static TSequence ** tpointseq_step_at_geometry (const TSequence *seq, Datum geom, int *count)
 Restricts the temporal sequence point with step interpolation to the geometry. More...
 
static bool tpointseq_timestamp_at_value1 (const TInstant *inst1, const TInstant *inst2, Datum value, TimestampTz *t)
 Returns the timestamp at which the segment of the temporal value takes the base value. More...
 
bool tpointseq_timestamp_at_value (const TSequence *seq, Datum value, TimestampTz *t)
 Returns the timestamp at which the temporal value takes the base value. More...
 
Period ** tpointseq_interperiods (const TSequence *seq, GSERIALIZED *gsinter, int *count)
 Get the periods at which the temporal sequence point with linear interpolation intersects the geometry. More...
 
static TSequence ** tpointseq_linear_at_geometry (const TSequence *seq, Datum geom, int *count)
 Restricts the temporal sequence point with linear interpolation to the geometry. More...
 
TSequence ** tpointseq_at_geometry (const TSequence *seq, Datum geom, int *count)
 Restricts the temporal sequence point to the geometry. More...
 
static TSequence ** tpointseq_minus_geometry1 (const TSequence *seq, Datum geom, int *count)
 Restrict the temporal sequence point to the complement of the geometry. More...
 
static TSequenceSettpointseq_restrict_geometry (const TSequence *seq, Datum geom, bool atfunc)
 Restricts the temporal sequence point to the (complement of the) geometry. More...
 
static TSequenceSettpointseqset_restrict_geometry (const TSequenceSet *ts, Datum geom, const STBOX *box, bool atfunc)
 Restricts the temporal sequence set point to the (complement of the) geometry. More...
 
Temporaltpoint_restrict_geometry_internal (const Temporal *temp, Datum geom, bool atfunc)
 Restricts the temporal point to the (complement of the) geometry (dispatch function) More...
 
static Datum tpoint_restrict_geometry (FunctionCallInfo fcinfo, bool atfunc)
 Restricts the temporal point to the (complement of the) geometry. More...
 
PGDLLEXPORT Datum tpoint_at_geometry (PG_FUNCTION_ARGS)
 Restricts the temporal point to the geometry. More...
 
PGDLLEXPORT Datum tpoint_minus_geometry (PG_FUNCTION_ARGS)
 Restrict the temporal point to the complement of the geometry. More...
 
Datum point2D_assemble (Datum x, Datum y, Datum srid, Datum geodetic)
 Assemble a 2D point for its x and y coordinates, srid, and geodetic flag. More...
 
Temporaltpoint_assemble_coords_xy (Temporal *temp_x, Temporal *temp_y, int srid, bool geodetic)
 Assemble a 2D temporal point for two temporal floats, srid, and geodetic flag. More...
 
Datum point2D_add_z (Datum point, Datum z, Datum srid)
 Add a z value to a 2D point. More...
 
Temporaltpoint_add_z (Temporal *temp, Temporal *temp_z, int srid)
 Assemble a 2D temporal point for two temporal floats. More...
 
Temporaltpoint_at_stbox_internal (const Temporal *temp, const STBOX *box, bool upper_inc)
 Restrict the temporal point to the spatiotemporal box. More...
 
static Temporaltpoint_minus_stbox_internal (const Temporal *temp, const STBOX *box)
 Restrict the temporal point to the complement of the spatiotemporal box. More...
 
static Datum tpoint_restrict_stbox (FunctionCallInfo fcinfo, bool atfunc)
 Restrict the temporal point to (the complement of) the spatiotemporal box. More...
 
PGDLLEXPORT Datum tpoint_at_stbox (PG_FUNCTION_ARGS)
 Restricts the temporal value to the spatiotemporal box. More...
 
PGDLLEXPORT Datum tpoint_minus_stbox (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the spatiotemporal box. More...
 

Variables

FunctionCallInfo _FCINFO
 Global variable to save the fcinfo when PostGIS functions need to access the proj cache such as transform, geography_distance, or geography_azimuth. More...
 
enum { ... }  MOBDB_SEG_INTER_TYPE
 

Detailed Description

Spatial functions for temporal points.