Returns the duration of a trajectory object as a PostgreSQL interval value.
Syntax
interval ST_duration(trajectory traj);Parameters
| Parameter | Description |
|---|---|
traj | The trajectory object. |
Return value
Returns an interval value representing the elapsed time from the start to the end of the trajectory.
Examples
The following example queries the duration of the trajectory with ID 2.
SELECT st_duration(traj) FROM traj WHERE id = 2;Output:
st_duration
-------------
00:42:10
(1 row)The result 00:42:10 indicates that the trajectory spans 42 minutes and 10 seconds.
该文章对您有帮助吗?