MobilityDB 1.1

◆ tcontseq_find_timestamp()

int tcontseq_find_timestamp ( const TSequence seq,
TimestampTz  t 
)

Basic functions for temporal sequences.

Basic functions for temporal sequences.

If the timestamp is contained in a temporal sequence, the index of the segment containing the timestamp is returned in the output parameter. Otherwise, return -1. For example, given a value composed of 3 sequences and a timestamp, the value returned in the output parameter is as follows:

0 1 2 3
|-----|-----|-----|
1) t^ => result = -1
2) t^ => result = 0 if the lower bound is inclusive, -1 otherwise
3) t^ => result = 1
4) t^ => result = 1
5) t^ => result = 3 if the upper bound is inclusive, -1 otherwise
6) t^ => result = -1
Parameters
[in]seqTemporal continuous sequence
[in]tTimestamp
Returns
Return -1 if the timestamp is not contained in a temporal sequence