ST_distanceWithin
更新时间:
复制 MD 格式
Returns true if the distance between two trajectory objects is within the reference distance during the specified time range.
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
| Parameter | Description |
|---|---|
traj1, traj2 | The trajectory objects to compare. |
range | The time range, as a tsrange value. |
t1 | The start of the time range, as a timestamp. |
t2 | The end of the time range, as a timestamp. |
d | The reference distance, as a float8. |
Examples
The following example checks whether two moving objects in traj_table came within 100 units of each other between 13:00 and 14:00 on January 1, 2010.
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);该文章对您有帮助吗?