MobilityDB  1.0

◆ periodset_find_timestamp()

bool periodset_find_timestamp ( const PeriodSet ps,
TimestampTz  t,
int *  loc 
)

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

If the timestamp is found, the index of the period is returned in the output parameter. Otherwise, return a number encoding whether the timestamp is before, between two periods, or after the period set value. For example, given a value composed of 3 periods and a timestamp, the result of the function is as follows:

0 1 2
|-----| |-----| |-----|
1) t^ => loc = 0
2) t^ => loc = 0
3) t^ => loc = 1
4) t^ => loc = 2
5) t^ => loc = 3
Parameters
[in]psPeriod set value
[in]tTimestamp
[out]locLocation
Returns
Returns true if the timestamp is contained in the period set value