ST_nearestApproachPoint

更新时间:
复制 MD 格式

Returns the point on traj1 that is spatially closest to traj2 within the specified time range. The result is a geometry value.

Syntax

geometry ST_nearestApproachPoint(trajectory traj1, trajectory traj2);
geometry ST_nearestApproachPoint(trajectory traj1, trajectory traj2, tsrange range);
geometry ST_nearestApproachPoint(trajectory traj1, trajectory traj2, timestamp t1, timestamp t2);

Parameters

ParameterDescription
traj1The first trajectory object. The returned point lies on this trajectory.
traj2The second trajectory object.
rangeThe time range, specified as a tsrange value.
t1The start time of the time range.
t2The end time of the time range.

Example

The following query returns the point on trajectory 1 that is nearest to trajectory 2 between 13:00 and 14:00 on 2010-01-01.

SELECT ST_nearestApproachPoint(
    (SELECT traj FROM traj_table WHERE id = 1),
    (SELECT traj FROM traj_table WHERE id = 2),
    '2010-1-1 13:00:00',
    '2010-1-1 14:00:00'
);