This function returns true if the distance between trajectory objects 1 and 2 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
Parameter | Description |
---|---|
traj | The trajectory object. |
t1 | The start time. |
t2 | The end time. |
range | The time range. |
d | The reference distance. |
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);