MobilityDB  1.0
Functions
tpoint_spatialfuncs.h File Reference

Spatial functions for temporal points. More...

#include <postgres.h>
#include <liblwgeom.h>
#include "general/temporal.h"
#include "tpoint.h"
Include dependency graph for tpoint_spatialfuncs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...
 
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...
 
void interpolate_point4d_sphere (const POINT3D *p1, const POINT3D *p2, const POINT4D *v1, const POINT4D *v2, double f, POINT4D *p)
 Find interpolation point p between geography points p1 and p2 so that the len(p1,p) == len(p1,p2) f and p falls on p1,p2 segment. 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_spatial_dimensionality_stbox_gs (const STBOX *box1, const GSERIALIZED *gs)
 Ensure that the spatiotemporal boxes have the same spatial 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_has_Z (int16 flags)
 Ensure that the temporal value has Z dimension. More...
 
void ensure_has_not_Z (int16 flags)
 
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...
 
const POINT2D * gs_get_point2d_p (GSERIALIZED *gs)
 Returns a 2D point from the serialized geometry. More...
 
const POINT3DZ * gs_get_point3dz_p (GSERIALIZED *gs)
 Returns a 3DZ point from the serialized geometry. More...
 
POINT2D datum_get_point2d (Datum value)
 Returns a 2D point from the datum. More...
 
const POINT2D * datum_get_point2d_p (Datum value)
 Returns a pointer to a 2D point from the datum. More...
 
POINT3DZ datum_get_point3dz (Datum value)
 Returns a 3DZ point from the datum. More...
 
const POINT3DZ * datum_get_point3dz_p (Datum value)
 Returns a pointer to a 3DZ point from the datum. More...
 
void datum_get_point4d (POINT4D *p, Datum value)
 Returns a 4D point from the datum. More...
 
Datum point_make (double x, double y, double z, bool hasz, bool geodetic, int32 srid)
 Create a point. 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...
 
Datum geoseg_interpolate_point (Datum value1, Datum value2, 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...
 
void spheroid_init (SPHEROID *s, double a, double b)
 
void geography_interpolate_point4d (const POINT3D *p1, const POINT3D *p2, const POINT4D *v1, const POINT4D *v2, double f, POINT4D *p)
 
Datum tpoint_srid (PG_FUNCTION_ARGS)
 Returns the SRID of a temporal point. More...
 
Datum tpoint_set_srid (PG_FUNCTION_ARGS)
 Set the SRID of a temporal point. More...
 
Temporaltpoint_set_srid_internal (Temporal *temp, int32 srid)
 Set the SRID of a temporal point (dispatch function) 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 *t)
 Returns the SRID of a temporal point (dispatch function) More...
 
TInstanttpointinst_transform (const TInstant *inst, Datum srid)
 Transform a temporal instant point into another spatial reference system. More...
 
Datum tgeompoint_to_tgeogpoint (PG_FUNCTION_ARGS)
 Converts a temporal geometry point to a temporal geography point. More...
 
Datum tgeogpoint_to_tgeompoint (PG_FUNCTION_ARGS)
 Converts a temporal geography point to a temporal geometry point. More...
 
TInstanttgeogpointinst_to_tgeompointinst (const TInstant *inst)
 
TSequencetgeogpointseq_to_tgeompointseq (const TSequence *seq)
 
TSequenceSettgeogpoints_to_tgeompoints (const TSequenceSet *ts)
 
Datum tpoint_trajectory (PG_FUNCTION_ARGS)
 Returns the trajectory of a temporal point. 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...
 
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...
 
Datum tpointseq_make_trajectory (const TInstant **instants, int count, bool linear)
 Compute the trajectory of an array of instants. More...
 
Datum geopoint_line (Datum value1, Datum value2)
 Compute the trajectory from two points. More...
 
LWLINE * geopoint_lwline (Datum value1, Datum value2)
 Compute the trajectory from two geometry points. 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 geo_set_precision (PG_FUNCTION_ARGS)
 Sets the precision of the coordinates of the geometry. More...
 
Datum tpoint_set_precision (PG_FUNCTION_ARGS)
 Set the precision of the coordinates of the temporal point to the number of decimal places. More...
 
Datum tpoint_get_x (PG_FUNCTION_ARGS)
 Get the X coordinates of the temporal point. More...
 
Datum tpoint_get_y (PG_FUNCTION_ARGS)
 Get the Y coordinates of the temporal point. More...
 
Datum tpoint_get_z (PG_FUNCTION_ARGS)
 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...
 
Datum tpoint_length (PG_FUNCTION_ARGS)
 Returns the length traversed by the temporal sequence (set) point. More...
 
Datum tpoint_cumulative_length (PG_FUNCTION_ARGS)
 Returns the cumulative length traversed by the temporal point. More...
 
Datum tpoint_speed (PG_FUNCTION_ARGS)
 Returns the speed of the temporal point. More...
 
Datum tgeompoint_twcentroid (PG_FUNCTION_ARGS)
 
Datum tpoint_azimuth (PG_FUNCTION_ARGS)
 Returns the temporal azimuth of the temporal geometry 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...
 
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...
 
bool tgeompointseq_min_bearing_at_timestamp (const TInstant *start1, const TInstant *end1, const TInstant *start2, const TInstant *end2, TimestampTz *t)
 
Datum tpoint_at_geometry (PG_FUNCTION_ARGS)
 Restricts the temporal point to the geometry. More...
 
Datum tpoint_at_stbox (PG_FUNCTION_ARGS)
 Restricts the temporal value to the spatiotemporal box. More...
 
Datum tpoint_minus_geometry (PG_FUNCTION_ARGS)
 Restrict the temporal point to the complement of the geometry. More...
 
Datum tpoint_minus_stbox (PG_FUNCTION_ARGS)
 Restricts the temporal value to the complement of the spatiotemporal box. More...
 
TSequence ** tpointseq_at_geometry (const TSequence *seq, Datum geo, int *count)
 Restricts the temporal sequence point to 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...
 
Temporaltpoint_at_stbox_internal (const Temporal *temp, const STBOX *box, bool exc_upper)
 Restrict the temporal point to the spatiotemporal box. More...
 
TInstantSet ** tpointinstset_make_simple1 (const TInstantSet *ti, 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...
 
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...
 

Detailed Description

Spatial functions for temporal points.