STS_GetTrajectory function

The STS_GetTrajectory function returns the exact trajectory of a specified object for the specified time range.

Syntax

STS_GetTrajectory(
                  ts           TimeSeries,
                  begin_time   DATETIME YEAR TO FRACTION(5),
                  end_time     DATETIME YEAR TO FRACTION(5))
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_GetTrajectory function to find where an object went during a time range, which is based on the data in the time series table. The location for each time point in the range is extracted from the time series table and converted into one or more linestrings.

The following graphic illustrates a trajectory.

Figure 1: Trajectory of an object for a time range

The graphic shows a trajectory with multiple timepoints.

Returns

An ST_Linestrings or an ST_Multilinesting. = The trajectory of the object.

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_GetTrajectory(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.