ST_subTrajectory

更新时间:
复制 MD 格式

Returns a sub-trajectory from 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

ParameterTypeDescription
trajtrajectoryThe source trajectory object.
starttimetimestampThe start time.
endtimetimestampThe end time.
rangetsrangeThe time range.
Return valuetrajectoryThe sub-trajectory covering the specified time range.

Examples

Extract a sub-trajectory using two explicit timestamps:

SELECT ST_subTrajectory(traj, '2010-1-11 02:45:30', '2010-1-11 03:00:00') FROM traj_table;
-- Returns a trajectory object covering 02:45:30 to 03:00:00 on 2010-01-11