MobilityDB 1.1
Macros | Functions
tpoint_analytics.c File Reference
#include <assert.h>
#include <float.h>
#include <math.h>
#include <postgres.h>
#include <liblwgeom_internal.h>
#include <lwgeodetic_tree.h>
#include <meos.h>
#include <meos_internal.h>
#include "general/lifting.h"
#include "general/tsequence.h"
#include "point/geography_funcs.h"
#include "point/tpoint.h"
#include "point/tpoint_boxops.h"
#include "point/tpoint_spatialrels.h"
#include "point/tpoint_spatialfuncs.h"
Include dependency graph for tpoint_analytics.c:

Macros

#define DELTA_UNIX_POSTGRES_EPOCH   946684800
 Analytic functions for temporal points and temporal floats. More...
 

Functions

static double dist2d_pt_pt (POINT2D *p1, POINT2D *p2)
 Return the 2D distance between the points. More...
 
static double dist2d_pt_seg (POINT2D *p, POINT2D *A, POINT2D *B)
 Return the 2D distance between the point the segment. More...
 
static double dist3d_pt_pt (POINT3DZ *p1, POINT3DZ *p2)
 Return the 3D distance between the points. More...
 
static double dist3d_pt_seg (POINT3DZ *p, POINT3DZ *A, POINT3DZ *B)
 Return the 3D distance between the point the segment. More...
 
Temporalgeo_to_tpoint (const GSERIALIZED *geo)
 Converts the PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch into a temporal point. More...
 
static TSequencegeo_to_tpointdiscseq (const GSERIALIZED *geo)
 Convert the PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch into a temporal discrete sequence point. More...
 
static TInstantgeo_to_tpointinst (const GSERIALIZED *geo)
 Convert the PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch into a temporal instant point. More...
 
static TSequencegeo_to_tpointseq (const GSERIALIZED *geo)
 Convert the PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch into a temporal sequence point. More...
 
static TSequenceSetgeo_to_tpointseqset (const GSERIALIZED *geo)
 Convert the PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch into a temporal sequence set point. More...
 
static int int_cmp (const void *a, const void *b)
 Return a negative or a positive value depending on whether the first number is less than or greater than the second one. More...
 
static void point_grid (Datum value, bool hasz, const gridspec *grid, POINT4D *p)
 
static LWPOINTpoint_measure_to_lwpoint (Datum point, Datum measure)
 Convert the geometry/geography point and the measure into a PostGIS point with an M coordinate. More...
 
Temporaltemporal_simplify (const Temporal *temp, double eps_dist, bool synchronized)
 Simplify the temporal float/point using a spatio-temporal extension of the Douglas-Peucker line simplification algorithm. More...
 
static void tfloatseq_findsplit (const TSequence *seq, int i1, int i2, int *split, double *dist)
 Find a split when simplifying the temporal sequence point using a spatio-temporal extension of the Douglas-Peucker line simplification algorithm. More...
 
static Temporaltpoint_affine (const Temporal *temp, const AFFINE *a)
 Affine transform a temporal point. More...
 
bool tpoint_AsMVTGeom (const Temporal *temp, const STBox *bounds, int32_t extent, int32_t buffer, bool clip_geom, GSERIALIZED **geom, int64 **timesarr, int *count)
 Transform the temporal point to Mapbox Vector Tile format. More...
 
static GSERIALIZEDtpoint_decouple (const Temporal *temp, int64 **timesarr, int *count)
 Decouple the points and the timestamps of a temporal point. More...
 
static Temporaltpoint_grid (const Temporal *temp, const gridspec *grid, bool filter_pts)
 Stick a temporal point to the given grid specification. More...
 
static Temporaltpoint_mvt (const Temporal *tpoint, const STBox *box, uint32_t extent, uint32_t buffer, bool clip_geom)
 Transform a temporal point into vector tile coordinate space. More...
 
static Temporaltpoint_remove_repeated_points (const Temporal *temp, double tolerance, int min_points)
 Return a temporal point with consecutive equal points removed. More...
 
bool tpoint_to_geo_measure (const Temporal *tpoint, const Temporal *measure, bool segmentize, GSERIALIZED **result)
 Construct a geometry/geography with M measure from the temporal point and. More...
 
static GSERIALIZEDtpointdiscseq_to_geo_measure (const TSequence *seq, const TSequence *measure)
 Construct a geometry/geography with M measure from the temporal discrete sequence point and the temporal float. More...
 
static TInstanttpointinst_affine (const TInstant *inst, const AFFINE *a)
 Affine transform a temporal point. More...
 
static void tpointinst_affine1 (const TInstant *inst, const AFFINE *a, int srid, bool hasz, TInstant **result)
 Affine transform a temporal point (iterator function) More...
 
static GSERIALIZEDtpointinst_decouple (const TInstant *inst, int64 **timesarr, int *count)
 Decouple the points and the timestamps of a temporal point. More...
 
static TInstanttpointinst_grid (const TInstant *inst, const gridspec *grid)
 Stick a temporal point to the given grid specification. More...
 
static GSERIALIZEDtpointinst_to_geo_measure (const TInstant *inst, const TInstant *measure)
 Construct a geometry/geography with M measure from the temporal instant point and the temporal float. More...
 
static LWPOINTtpointinst_to_lwpoint (const TInstant *inst)
 Convert the temporal instant point into a PostGIS trajectory point where the M coordinate encodes the timestamp in Unix epoch. More...
 
static TSequencetpointseq_affine (const TSequence *seq, const AFFINE *a)
 Affine transform a temporal point. More...
 
static GSERIALIZEDtpointseq_decouple (const TSequence *seq, int64 **timesarr, int *count)
 Decouple the points and the timestamps of a temporal point. More...
 
static LWGEOMtpointseq_decouple1 (const TSequence *seq, int64 *times)
 Decouple the points and the timestamps of a temporal point. More...
 
static void tpointseq_findsplit (const TSequence *seq, int i1, int i2, bool synchronized, int *split, double *dist)
 Find a split when simplifying the temporal sequence point using a spatio-temporal extension of the Douglas-Peucker line simplification algorithm. More...
 
static TSequencetpointseq_grid (const TSequence *seq, const gridspec *grid, bool filter_pts)
 Stick a temporal point to the given grid specification. More...
 
static TSequencetpointseq_remove_repeated_points (const TSequence *seq, double tolerance, int min_points)
 Return a temporal point with consecutive equal points removed. More...
 
static LWGEOMtpointseq_to_geo1 (const TSequence *seq)
 Converts the temporal sequence point into a PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch. More...
 
static GSERIALIZEDtpointseq_to_geo_measure (const TSequence *seq, const TSequence *measure)
 Construct a geometry/geography with M measure from the temporal sequence point and the temporal float. More...
 
static LWGEOMtpointseq_to_geo_measure1 (const TSequence *seq, const TSequence *measure)
 Construct a geometry/geography with M measure from the temporal sequence point and the temporal float. More...
 
static GSERIALIZEDtpointseq_to_geo_measure_segmentize (const TSequence *seq, const TSequence *measure)
 Construct a geometry/geography with M measure from the temporal sequence point and the temporal float. More...
 
static int tpointseq_to_geo_measure_segmentize1 (const TSequence *seq, const TSequence *measure, LWGEOM **result)
 Construct a geometry/geography with M measure from the temporal sequence point and the temporal float. More...
 
static int tpointseq_to_geo_segmentize1 (const TSequence *seq, LWGEOM **result)
 Converts the temporal sequence point into a PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch. More...
 
static TSequenceSettpointseqset_affine (const TSequenceSet *ss, const AFFINE *a)
 Affine transform a temporal point. More...
 
static GSERIALIZEDtpointseqset_decouple (const TSequenceSet *ss, int64 **timesarr, int *count)
 Decouple the points and the timestamps of a temporal point. More...
 
static TSequenceSettpointseqset_grid (const TSequenceSet *ss, const gridspec *grid, bool filter_pts)
 Stick a temporal point to the given grid specification. More...
 
static TSequenceSettpointseqset_remove_repeated_points (const TSequenceSet *ss, double tolerance, int min_points)
 Return a temporal point with consecutive equal points removed. More...
 
static GSERIALIZEDtpointseqset_to_geo_measure (const TSequenceSet *ss, const TSequenceSet *measure)
 Construct a geometry/geography with M measure from the temporal sequence point and the temporal float. More...
 
static GSERIALIZEDtpointseqset_to_geo_measure_segmentize (const TSequenceSet *ss, const TSequenceSet *measure)
 Construct a geometry/geography with M measure from the temporal sequence set point and the temporal float. More...
 
static TInstanttrajpoint_to_tpointinst (LWPOINT *lwpoint)
 Convert the PostGIS trajectory geometry/geography where the M coordinates encode the timestamps in Unix epoch into a temporal instant point. More...
 
static TSequencetsequence_simplify (const TSequence *seq, double eps_dist, bool synchronized, uint32_t minpts)
 
static TSequenceSettsequenceset_simplify (const TSequenceSet *ss, double eps_dist, bool synchronized, uint32_t minpts)
 Simplify the temporal sequence set float/point using a spatio-temporal extension of the Douglas-Peucker line simplification algorithm. More...