ST_timeAtPoint

更新时间:
复制 MD 格式

Returns all timestamps at which a trajectory passes through a given spatial point.

Syntax

timestamp[] ST_timeAtPoint(trajectory traj, geometry g);

Parameters

ParameterTypeDescription
trajtrajectoryThe trajectory object.
ggeometryThe spatial point.

Return value

An array of timestamp values. Each element is a point in time when the trajectory passed through the specified spatial point.

Example

Query all timestamps at which the trajectory in traj_table passes through the point at longitude 115, latitude 36:

SELECT ST_timeAtPoint(traj, ST_GeomFromText('POINT(115 36)'))
FROM traj_table;

Output:

      st_timeatpoint
-------------------------
 {"2010-01-01 15:00:00"}

The result is a timestamp[] array. In this example, the trajectory passes through POINT(115 36) once, at 2010-01-01 15:00:00.