Returns the sub-trajectory of a trajectory object within a specified time range.
Syntax
trajectory ST_subTrajectory(trajectory traj, timestamp starttime, timestamp endtime);
trajectory ST_subTrajectory(trajectory traj, tsrange range);Parameters
| Parameter | Type | Description |
|---|---|---|
traj | trajectory | The source trajectory object. |
starttime | timestamp | The start of the time range. |
endtime | timestamp | The end of the time range. |
range | tsrange | The time range, expressed as a PostgreSQL tsrange value. |
Examples
Extract the sub-trajectory recorded between 02:45:30 and 03:00:00 on January 11, 2010:
Select ST_subTrajectory(traj, '2010-1-11 02:45:30', '2010-1-11 03:00:00') FROM traj_table;