STS_GetCompactTrajectory function

The STS_GetCompactTrajectory function returns the compressed trajectory of a specified object for the specified time range.

Syntax

STS_GetCompactTrajectory(
                      ts             TimeSeries,
                      begin_time     DATETIME YEAR TO FRACTION(5) DEFAULT NULL,
                      end_time       DATETIME YEAR TO FRACTION(5) DEFAULT NULL)
returns ST_Geometry
ts
The time series value.
begin_time
The start of the time range. Can be NULL to indicate the first element in the time series.
end_time
The end of the time range. Can be NULL to indicate the last element in the time series.

Usage

Run the STS_GetCompactTrajectory function to find where an object went during a time range, based on the compressed spatiotemporal search data. The trajectory information is retrieved from the subtack table and returned as one or more linestrings.

Returns

An ST_MultiLinestring = The trajectory for the time range.

NULL = Nothing found.

Example

The following query returns the trajectory of the vehicle 1001 between 2014-06-07 20:50:00 and 2014-06-07 20:55:00:

SELECT STS_GetCompactTrajectory(ts_track, 
        '2014-06-07 20:50:00', '2014-06-07 20:55:00')
        FROM t_vehicle 
        WHERE modid = 1001; 

(expression)  
        4326 LINESTRING (-79.099042 43.81251, -79.098993 43.812542) 
1 row(s) retrieved.