Returns true if a trajectory object and the specified geometry object share at least one point in space during the specified time range.
Syntax
boolean ST_intersects(trajectory traj, tsrange range, geometry g);
boolean ST_intersects(trajectory traj, timestamp t1, timestamp t2, geometry g);Parameters
| Parameter | Description |
|---|---|
traj | The trajectory object. |
range | The time range, specified as a tsrange value. |
t1 | The start time. |
t2 | The end time. |
g | The specified geometry object. |
Use cases
Use this function for:
Geofence detection: determine whether a vehicle or asset entered a restricted zone during a shift
Route coverage analysis: check whether a delivery route crossed a specific district
Example
The following query checks whether each trajectory in traj_table intersected the line LINESTRING(0 0, 5 5, 9 9) between 13:00 and 14:00 on January 1, 2010.
Select ST_intersects(traj, '2010-1-1 13:00:00', '2010-1-1 14:00:00', 'LINESTRING(0 0, 5 5, 9 9)'::geometry) from traj_table;该文章对您有帮助吗?