Returns true if two trajectory objects share at least one point in space during the specified time range.
Syntax
boolean ST_intersects(trajectory traj1, trajectory traj2);
boolean ST_intersects(trajectory traj1, trajectory traj2, tsrange range);
boolean ST_intersects(trajectory traj1, trajectory traj2, timestamp t1, timestamp t2);Parameters
| Parameter | Type | Description |
|---|---|---|
traj1, traj2 | trajectory | The trajectory objects to compare. |
range | tsrange | The time range to check for intersection. |
t1 | timestamp | The start of the time range. |
t2 | timestamp | The end of the time range. |
Examples
Check whether two trajectories intersect between 13:00 and 14:00 on January 1, 2010:
SELECT ST_intersects(
(SELECT traj FROM traj_table WHERE id = 1),
(SELECT traj FROM traj_table WHERE id = 2),
'2010-01-01 13:00:00',
'2010-01-01 14:00:00'
);