ST_euclideanDistance

更新时间:
复制 MD 格式

Returns the standardized Euclidean distance between two trajectory objects at the same time point.

Syntax

float ST_euclideanDistance(trajectory traj1, trajectory traj2);

Parameters

ParameterTypeDescription
traj1trajectoryThe first trajectory object.
traj2trajectoryThe second trajectory object.

Usage notes

The function computes the Euclidean distance between traj1 and traj2 at the same time point. The returned value is standardized (normalized), not a raw spatial distance.

Examples

The following example computes the standardized Euclidean distance between two trajectories stored in traj_table. The function returns a float value.

SELECT ST_euclideanDistance(
  (SELECT traj FROM traj_table WHERE id = 1),
  (SELECT traj FROM traj_table WHERE id = 2)
);