Returns the nearest approach distance between a trajectory object and a geometry object within a specified time range.
Syntax
float8 ST_nearestApproachDistance(trajectory traj, tsrange range, geometry g);
float8 ST_nearestApproachDistance(trajectory traj, timestamp t1, timestamp t2, geometry g);Parameters
| Parameter | Type | Description |
|---|---|---|
traj | trajectory | The trajectory object. |
range | tsrange | The time range. |
t1 | timestamp | The start time. |
t2 | timestamp | The end time. |
g | geometry | The specified geometry object. |
Example
Query the nearest approach distance between trajectory records and a linestring geometry during a one-hour window.
SELECT ST_nearestApproachDistance(traj, '2010-1-1 13:00:00', '2010-1-1 14:00:00', 'LINESTRING(0 0, 5 5, 9 9)'::geometry) FROM traj_table;该文章对您有帮助吗?