ST_mdistance

更新时间:
复制 MD 格式

Returns the Euclidean distance between two trajectory objects at each shared time point, as an array of float values.

Syntax

float[] ST_mdistance(trajectory traj1, trajectory traj2);

Parameters

ParameterDescription
traj1The first trajectory object.
traj2The second trajectory object.

Return value

Returns a float[] array where each element is the Euclidean distance between the two trajectories at one shared time point.

The distances are not normalized. Each array element is a raw Euclidean distance at a single time point.

Example

The following example computes the per-time-point distances between two trajectories stored in traj_table.

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