ST_distanceWithin

更新时间:
复制 MD 格式

Returns true if the distance between two trajectory objects within the specified time range is within the reference distance.

Syntax

boolean ST_distanceWithin(trajectory traj1, trajectory traj2, tsrange range, float8 d);
boolean ST_distanceWithin(trajectory traj1, trajectory traj2, timestamp t1, timestamp t2, float8 d);

Parameters

ParameterDescription
traj1The first trajectory object.
traj2The second trajectory object.
rangeThe time range, specified as a tsrange value.
t1The start time of the time range.
t2The end time of the time range.
dThe reference distance. The function returns true if the distance between traj1 and traj2 is within this value during the specified time range.

Examples

Select ST_distanceWithin((Select traj from traj_table where id=1), (Select traj from traj_table where id=2), '2010-1-1 13:00:00', '2010-1-1 14:00:00', 100);