|
MobilityDB 1.3
|
Basic functions for temporal types of any subtype. More...
#include "temporal/temporal.h"#include <assert.h>#include <float.h>#include <geos_c.h>#include <limits.h>#include <utils/float.h>#include <meos.h>#include <meos_internal.h>#include <meos_internal_geo.h>#include "temporal/doxygen_meos.h"#include "temporal/lifting.h"#include "temporal/postgres_types.h"#include "temporal/temporal_boxops.h"#include "temporal/temporal_tile.h"#include "temporal/tinstant.h"#include "temporal/tsequence.h"#include "temporal/tsequenceset.h"#include "temporal/type_parser.h"#include "temporal/type_util.h"#include "geo/tgeo.h"#include "geo/tgeo_spatialfuncs.h"Macros | |
| #define | MEOS_INTERP_STR_MAXLEN 9 |
| #define | MOBDB_VERSION_STR_MAXLEN 256 |
Functions | |
| static Datum | datum_bool_to_int (Datum d) |
| Convert a Boolean into an integer. More... | |
| Datum | datum_ceil (Datum value) |
| Return a number rounded up to the nearest integer. More... | |
| Datum | datum_degrees (Datum value, Datum normalize) |
| Return a double converted from radians to degrees. More... | |
| Datum | datum_float_round (Datum value, Datum size) |
| Return a float number rounded to a given number of decimal places. More... | |
| static Datum | datum_float_to_int (Datum d) |
| Convert a float into an integer. More... | |
| Datum | datum_floor (Datum value) |
| Return a number rounded down to the nearest integer. More... | |
| static Datum | datum_int_to_float (Datum d) |
| Convert an integer into a float. More... | |
| Datum | datum_radians (Datum value) |
| Return a double converted from degrees to radians. More... | |
| bool | ensure_common_dimension (int16 flags1, int16 flags2) |
| Ensure that two temporal values have at least one common dimension. More... | |
| bool | ensure_continuous (const Temporal *temp) |
| Ensure that the subtype of temporal type is a sequence (set) More... | |
| bool | ensure_has_not_Z (MeosType type, int16 flags) |
| Ensure that a MEOS type has not Z dimension. More... | |
| bool | ensure_has_T (MeosType type, int16 flags) |
| Ensure that a MEOS type has Z dimension. More... | |
| bool | ensure_has_X (MeosType type, int16 flags) |
| Ensure that a MEOS type has X dimension. More... | |
| bool | ensure_has_Z (MeosType type, int16 flags) |
| Ensure that a MEOS type has Z dimension. More... | |
| bool | ensure_linear_interp (int16 flags) |
| Ensure that a temporal value has linear interpolation. More... | |
| bool | ensure_nonlinear_interp (int16 flags) |
| Ensure that a temporal value does not have linear interpolation. More... | |
| bool | ensure_not_month_duration (const Interval *duration) |
| Ensure that an interval does not have a month component. More... | |
| bool | ensure_not_negative (int i) |
| Ensure that a number is positive or zero. More... | |
| bool | ensure_not_negative_datum (Datum d, MeosType basetype) |
| Ensure that a number is not negative. More... | |
| bool | ensure_not_null (void *ptr) |
| Ensure that the pointer is not null. More... | |
| bool | ensure_one_not_null (void *ptr1, void *ptr2) |
| Ensure that at least one of the pointers is not null. More... | |
| bool | ensure_one_true (bool hasshift, bool haswidth) |
| Ensure that at least one of the values is true. More... | |
| bool | ensure_positive (int i) |
| Ensure that a number is positive. More... | |
| bool | ensure_positive_datum (Datum d, MeosType basetype) |
| Ensure that a number is strictly positive. More... | |
| bool | ensure_positive_duration (const Interval *duration) |
| Ensure that an interval is a positive duration. More... | |
| bool | ensure_same_continuous_interp (int16 flags1, int16 flags2) |
| Ensure that two temporal values have the same continuous interpolation. More... | |
| bool | ensure_same_interp (const Temporal *temp1, const Temporal *temp2) |
| Ensure that two temporal values have the same interpolation. More... | |
| bool | ensure_same_temporal_type (const Temporal *temp1, const Temporal *temp2) |
| Ensure that two temporal values have the same temporal type. More... | |
| bool | ensure_temporal_isof_basetype (const Temporal *temp, MeosType basetype) |
| Ensure that a temporal value has a given base type. More... | |
| bool | ensure_temporal_isof_subtype (const Temporal *temp, tempSubtype subtype) |
| Ensure that a temporal value is of a given subtype. More... | |
| bool | ensure_temporal_isof_type (const Temporal *temp, MeosType temptype) |
| Ensure that a temporal value is of a temporal type. More... | |
| bool | ensure_valid_day_duration (const Interval *duration) |
| Ensure that a day interval for binning is valid. More... | |
| bool | ensure_valid_interp (MeosType temptype, interpType interp) |
| Ensure that an interpolation is valid. More... | |
| bool | ensure_valid_temporal_set (const Temporal *temp, const Set *s) |
| Ensure that a temporal number and a set have the same span type. More... | |
| bool | ensure_valid_temporal_temporal (const Temporal *temp1, const Temporal *temp2) |
| Ensure that a temporal number and a temporal box have the same span type. More... | |
| bool | ensure_valid_tnumber_numspan (const Temporal *temp, const Span *s) |
| Ensure that a temporal number and a span have the same span type. More... | |
| bool | ensure_valid_tnumber_numspanset (const Temporal *temp, const SpanSet *ss) |
| Ensure that a temporal number and a span set have the same span type. More... | |
| bool | ensure_valid_tnumber_tbox (const Temporal *temp, const TBox *box) |
| Ensure that a temporal number and a temporal box have the same span type. More... | |
| bool | ensure_valid_tnumber_tnumber (const Temporal *temp1, const Temporal *temp2) |
| Ensure that two temporal numbers have the same span type. More... | |
| double | float_degrees (double value, bool normalize) |
| Return a float converted from radians to degrees. More... | |
| double | float_round (double d, int maxdd) |
| Return a float number rounded to a given number of decimal places. More... | |
| bool | intersection_temporal_temporal (const Temporal *temp1, const Temporal *temp2, SyncMode mode, Temporal **inter1, Temporal **inter2) |
| Return the temporal intersection of two temporal values. More... | |
| char * | mobilitydb_full_version (void) |
| Return the versions of the MobilityDB extension and its dependencies. More... | |
| char * | mobilitydb_version (void) |
| Return the version of the MobilityDB extension. More... | |
| static double | mrr_distance_scalar (const TSequence *seq, int start, int end) |
| Return the length of the minimum bounding interval of a sequence between the given start and end instants. More... | |
| bool | not_negative_datum (Datum d, MeosType basetype) |
| Return true if a number is not negative. More... | |
| bool | positive_datum (Datum d, MeosType basetype) |
| Return true if a number is strictly positive. More... | |
| bool | positive_duration (const Interval *duration) |
| Return true if an interval is a positive duration. More... | |
| datum_func2 | round_fn (MeosType basetype) |
| Return the function for rounding a base type. More... | |
| Temporal * | tbool_to_tint (const Temporal *temp) |
| Convert a temporal Boolean into a temporal integer. More... | |
| static TSequence * | tdiscseq_from_base_temp (Datum value, MeosType temptype, const TSequence *seq) |
| Return a temporal discrete sequence from a base value and time frame of another temporal discrete sequence. More... | |
| char ** | temparr_out (Temporal **temparr, int count, int maxdd) |
| Return the Well-Known Text (WKT) representation of an array of temporal values. More... | |
| Temporal ** | temparr_round (Temporal **temparr, int count, int maxdd) |
| Return an array of temporal floats with the precision of the coordinates set to a number of decimal places. More... | |
| void * | temporal_bbox_ptr (const Temporal *temp) |
| Return a pointer to the precomputed bounding box of a temporal value. More... | |
| int | temporal_cmp (const Temporal *temp1, const Temporal *temp2) |
| Return -1, 0, or 1 depending on whether the first temporal value is less than, equal to, or greater than the second one. More... | |
| Temporal * | temporal_compact (const Temporal *temp) |
| Return a copy of a temporal value without any extra storage space. More... | |
| Temporal * | temporal_copy (const Temporal *temp) |
| Return a copy of a temporal value. More... | |
| Temporal * | temporal_derivative (const Temporal *temp) |
| Return the derivative of a temporal value. More... | |
| Interval * | temporal_duration (const Temporal *temp, bool boundspan) |
| Return the duration of a temporal value. More... | |
| const TInstant * | temporal_end_inst (const Temporal *temp) |
| Return a pointer to the end instant of a temporal value. More... | |
| TInstant * | temporal_end_instant (const Temporal *temp) |
| Return a copy of the end instant of a temporal value. More... | |
| TSequence * | temporal_end_sequence (const Temporal *temp) |
| Return a copy of the end sequence of a temporal sequence (set) More... | |
| TimestampTz | temporal_end_timestamptz (const Temporal *temp) |
| Return the end timestamptz of a temporal value. More... | |
| Datum | temporal_end_value (const Temporal *temp) |
| Return a copy of the end base value of a temporal value. More... | |
| bool | temporal_eq (const Temporal *temp1, const Temporal *temp2) |
| Return true if two temporal values are equal. More... | |
| Temporal * | temporal_from_base_temp (Datum value, MeosType temptype, const Temporal *temp) |
| Return a temporal value from a base value and the time frame of another temporal value. More... | |
| bool | temporal_ge (const Temporal *temp1, const Temporal *temp2) |
| Return true if the first temporal value is greater than or equal to the second one. More... | |
| bool | temporal_gt (const Temporal *temp1, const Temporal *temp2) |
| Return true if the first temporal value is greater than the second one. More... | |
| uint32 | temporal_hash (const Temporal *temp) |
| Return the 32-bit hash value of a temporal value. More... | |
| Temporal * | temporal_in (const char *str, MeosType temptype) |
| Return a temporal value from its Well-Known Text (WKT) representation. More... | |
| const TInstant * | temporal_inst_n (const Temporal *temp, int n) |
| Return a pointer to the n-th instant of a temporal value. More... | |
| TInstant * | temporal_instant_n (const Temporal *temp, int n) |
| Return a copy of the n-th instant of a temporal value. More... | |
| TInstant ** | temporal_instants (const Temporal *temp, int *count) |
| Return a copy of the distinct instants of a temporal value. More... | |
| const TInstant ** | temporal_insts_p (const Temporal *temp, int *count) |
| Return an array of pointers to the distinct instants of a temporal value. More... | |
| const char * | temporal_interp (const Temporal *temp) |
| Return the string representation of the interpolation of a temporal value. More... | |
| bool | temporal_le (const Temporal *temp1, const Temporal *temp2) |
| Return true if the first temporal value is less than or equal to the second one. More... | |
| bool | temporal_lower_inc (const Temporal *temp) |
| Return true if the start instant of a temporal value is inclusive. More... | |
| bool | temporal_lt (const Temporal *temp1, const Temporal *temp2) |
| Return true if the first temporal value is less than the second one. More... | |
| const TInstant * | temporal_max_inst_p (const Temporal *temp) |
| Return a copy of the instant with maximum base value of a temporal value. More... | |
| TInstant * | temporal_max_instant (const Temporal *temp) |
| Return a copy of the instant with maximum base value of a temporal value. More... | |
| Datum | temporal_max_value (const Temporal *temp) |
| Return a copy of the maximum base value of a temporal value. More... | |
| size_t | temporal_mem_size (const Temporal *temp) |
| Return the size in bytes of a temporal value. More... | |
| const TInstant * | temporal_min_inst_p (const Temporal *temp) |
| Return a pointer to the instant with minimum base value of a temporal value. More... | |
| TInstant * | temporal_min_instant (const Temporal *temp) |
| Return a copy of the instant with minimum base value of a temporal value. More... | |
| Datum | temporal_min_value (const Temporal *temp) |
| Return a copy of the minimum base value of a temporal value. More... | |
| bool | temporal_ne (const Temporal *temp1, const Temporal *temp2) |
| Return true if two temporal values are different. More... | |
| int | temporal_num_instants (const Temporal *temp) |
| Return the number of distinct instants of a temporal value. More... | |
| int | temporal_num_sequences (const Temporal *temp) |
| Return the number of sequences of a temporal sequence (set) More... | |
| int | temporal_num_timestamps (const Temporal *temp) |
| Return the number of distinct timestamps of a temporal value. More... | |
| char * | temporal_out (const Temporal *temp, int maxdd) |
| Return the Well-Known Text (WKT) representation of a temporal value. More... | |
| void | temporal_restart (Temporal *temp, int count) |
| Return a temporal sequence (set) that keepsg only the last n instants or sequences. More... | |
| Temporal * | temporal_round (const Temporal *temp, int maxdd) |
| Return a temporal value rounded to a given number of decimal places. More... | |
| Temporal * | temporal_scale_time (const Temporal *temp, const Interval *duration) |
| Return a temporal value scaled by an interval. More... | |
| TSequenceSet * | temporal_segm_duration (const Temporal *temp, const Interval *duration, bool atleast, bool strict) |
| Return the segments that have at least/at most a given duration. More... | |
| TSequence ** | temporal_segments (const Temporal *temp, int *count) |
| Return the array of segments of a temporal value. More... | |
| TSequence * | temporal_sequence_n (const Temporal *temp, int n) |
| Return a copy of the n-th sequence of a temporal sequence (set) More... | |
| TSequence ** | temporal_sequences (const Temporal *temp, int *count) |
| Return an array of copies of the sequences of a temporal sequence (set) More... | |
| const TSequence ** | temporal_sequences_p (const Temporal *temp, int *count) |
| Return an array of pointers to the sequences of a temporal sequence (set) More... | |
| void | temporal_set_bbox (const Temporal *temp, void *box) |
| Return in the last argument the bounding box of a temporal value. More... | |
| Temporal * | temporal_set_interp (const Temporal *temp, interpType interp) |
| Return a temporal value transformed to an interpolation. More... | |
| void | temporal_set_tstzspan (const Temporal *temp, Span *s) |
| Return in the last argument the time span of a temporal value. More... | |
| Temporal * | temporal_shift_scale_time (const Temporal *temp, const Interval *shift, const Interval *duration) |
| Return a temporal value shifted and/or scaled by two intervals. More... | |
| Temporal * | temporal_shift_time (const Temporal *temp, const Interval *shift) |
| Return a temporal value shifted by an interval. More... | |
| const TInstant * | temporal_start_inst (const Temporal *temp) |
| Return a pointer to the start instant of a temporal value. More... | |
| TInstant * | temporal_start_instant (const Temporal *temp) |
| Return a copy of the start instant of a temporal value. More... | |
| TSequence * | temporal_start_sequence (const Temporal *temp) |
| Return a copy of the start sequence of a temporal sequence (set) More... | |
| TimestampTz | temporal_start_timestamptz (const Temporal *temp) |
| Return the start timestamptz of a temporal value. More... | |
| Datum | temporal_start_value (const Temporal *temp) |
| Return a copy of the start base value of a temporal value. More... | |
| TSequenceSet * | temporal_stops (const Temporal *temp, double maxdist, const Interval *minduration) |
| Return the subsequences where a temporal value stays within a given distance for at least a given duration. More... | |
| const char * | temporal_subtype (const Temporal *temp) |
| Return the string representation of the subtype of a temporal value. More... | |
| SpanSet * | temporal_time (const Temporal *temp) |
| Return the time frame of a temporal value as a span set. More... | |
| TimestampTz * | temporal_timestamps (const Temporal *temp, int *count) |
| Return the array of distinct timestamps of a temporal value. More... | |
| bool | temporal_timestamptz_n (const Temporal *temp, int n, TimestampTz *result) |
| Return in last argument the n-th distinct timestamptz of a temporal value. More... | |
| TInstant * | temporal_to_tinstant (const Temporal *temp) |
| Return a temporal value transformed to a temporal instant. More... | |
| TSequence * | temporal_to_tsequence (const Temporal *temp, interpType interp) |
| Return a temporal value transformed to a temporal sequence. More... | |
| TSequenceSet * | temporal_to_tsequenceset (const Temporal *temp, interpType interp) |
| Return a temporal value transformed to a temporal sequence set. More... | |
| Span * | temporal_to_tstzspan (const Temporal *temp) |
| Return the bounding period of a temporal value. More... | |
| TSequence * | temporal_tsequence (const Temporal *temp, interpType interp) |
| Return a temporal value transformed to a temporal sequence. More... | |
| TSequenceSet * | temporal_tsequenceset (const Temporal *temp, interpType interp) |
| Return a temporal value transformed to a temporal sequence set. More... | |
| bool | temporal_upper_inc (const Temporal *temp) |
| Return true if the end instant of a temporal value is inclusive. More... | |
| bool | temporal_value_n (const Temporal *temp, int n, Datum *result) |
| Return in the last argument a copy of the n-th value of a temporal value. More... | |
| Datum * | temporal_values (const Temporal *temp, int *count) |
| Return the array of copies of the distinct base values of a temporal value. More... | |
| Datum * | temporal_values_p (const Temporal *temp, int *count) |
| Return the array of pointers to the base values of a temporal value. More... | |
| Temporal * | tfloat_ceil (const Temporal *temp) |
| Return a temporal float rounded up to the nearest temporal integer. More... | |
| Temporal * | tfloat_degrees (const Temporal *temp, bool normalize) |
| Return a temporal float transformed from radians to degrees. More... | |
| Temporal * | tfloat_floor (const Temporal *temp) |
| Return a temporal float rounded down to the nearest temporal integer. More... | |
| Temporal * | tfloat_radians (const Temporal *temp) |
| Return a temporal float transformed from degrees to radians. More... | |
| Temporal * | tfloat_to_tint (const Temporal *temp) |
| Convert a temporal float into a temporal integer. More... | |
| static int | tfloatseq_stops_iter (const TSequence *seq, double maxdist, int64 mintunits, TSequence **result) |
| Return the subsequences where the temporal value stays within a given distance for at least a given duration (iterator function) More... | |
| Temporal * | tint_to_tfloat (const Temporal *temp) |
| Convert a temporal integer into a temporal float. More... | |
| double | tnumber_avg_value (const Temporal *temp) |
| Return the average value of a temporal number. More... | |
| double | tnumber_integral (const Temporal *temp) |
| Return the integral (area under the curve) of a temporal number. More... | |
| void | tnumber_set_span (const Temporal *temp, Span *s) |
| Return in the last argument the value span of a temporal number. More... | |
| Temporal * | tnumber_shift_scale_value (const Temporal *temp, Datum shift, Datum width, bool hasshift, bool haswidth) |
| Return a temporal number with the value dimension shifted and/or scaled by two values. More... | |
| Span * | tnumber_to_span (const Temporal *temp) |
| Return the value span of a temporal number. More... | |
| TBox * | tnumber_to_tbox (const Temporal *temp) |
| Convert a temporal number into a temporal box. More... | |
| double | tnumber_twavg (const Temporal *temp) |
| Return the time-weighted average of a temporal number. More... | |
| SpanSet * | tnumber_valuespans (const Temporal *temp) |
| Return the base values of a temporal number as a span set. More... | |
| TSequence * | tsequence_derivative (const TSequence *seq) |
| Return the derivative of a temporal sequence. More... | |
| TSequence * | tsequence_from_base_temp (Datum value, MeosType temptype, const TSequence *seq) |
| Return a temporal sequence from a base value and the time frame of another temporal sequence. More... | |
| TSequenceSet * | tsequence_segm_duration (const TSequence *seq, int64 tunits, CompOper oper) |
| Return the segments that have at least/at most a given duration. More... | |
| static int | tsequence_segm_duration_iter (const TSequence *seq, int64 tunits, CompOper oper, TSequence **result) |
| Return the segments that have at least/at most a given duration (iterator function) More... | |
| TSequenceSet * | tsequence_stops (const TSequence *seq, double maxdist, int64 mintunits) |
| Return the subsequences where the temporal value stays within a given distance for at least a given duration. More... | |
| TSequenceSet * | tsequenceset_derivative (const TSequenceSet *ss) |
| Return the derivative of a temporal sequence set. More... | |
| TSequenceSet * | tsequenceset_from_base_temp (Datum value, MeosType temptype, const TSequenceSet *ss) |
| Return a temporal sequence set from a base value and the time frame of another temporal sequence set. More... | |
| TSequenceSet * | tsequenceset_segm_duration (const TSequenceSet *ss, int64 tunits, CompOper oper) |
| Return the segments that have at least/at most a given duration. More... | |
| TSequenceSet * | tsequenceset_stops (const TSequenceSet *ss, double maxdist, int64 mintunits) |
| Return the subsequences where the temporal value stays within a given distance for at least a given duration. More... | |
Basic functions for temporal types of any subtype.