ST_subTrajectorySpatial

更新时间:
复制 MD 格式

Returns the spatial geometry object of a trajectory object within the specified time range.

Syntax

geometry ST_subTrajectorySpatial(trajectory traj, timestamp starttime, timestamp endtime);
geometry ST_subTrajectorySpatial(trajectory traj, tsrange range);

Parameters

ParameterTypeDescription
trajtrajectoryThe trajectory object.
starttimetimestampThe start of the time range.
endtimetimestampThe end of the time range.
rangetsrangeThe time range, specified as a tsrange value.

Examples

Example 1: Clip using start and end timestamps

SELECT ST_subTrajectorySpatial(traj, '2010-1-11 02:45:30', '2010-1-11 03:00:00')
FROM traj_table;

Example 2: Clip using a tsrange value

SELECT ST_subTrajectorySpatial(traj, '[2010-1-11 02:45:30, 2010-1-11 03:00:00]'::tsrange)
FROM traj_table;