MobilityDB  1.0

◆ tsequenceset_find_timestamp()

bool tsequenceset_find_timestamp ( const TSequenceSet ts,
TimestampTz  t,
int *  loc 
)

Returns the location of the timestamp in the temporal sequence set value using binary search.

If the timestamp is contained in the temporal value, the index of the sequence is returned in the output parameter. Otherwise, returns a number encoding whether the timestamp is before, between two sequences, or after the temporal value. 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
|-----| |-----| |-----|
1) t^ => loc = 0
2) t^ => loc = 1
3) t^ => loc = 1
4) t^ => loc = 2
5) t^ => loc = 3
Parameters
[in]tsTemporal sequence set value
[in]tTimestamp
[out]locLocation
Returns
Returns true if the timestamp is contained in the temporal value