ST_deviation

更新时间:
复制 MD 格式

Returns a float8 value representing the spatial deviation between a processed trajectory object and the original trajectory object. Use this function to measure the accuracy loss introduced by operations such as compression, then decide whether the result meets your precision requirements.

Syntax

float8 ST_deviation(trajectory traj, trajectory after_oper_traj);

Parameters

ParameterDescription
trajThe original trajectory object.
after_oper_trajThe processed trajectory object, such as the output of st_compress.

Examples

Measure the deviation after compressing a trajectory

The following example compresses each trajectory in the traj_test table with a tolerance of 0.001, then returns the spatial deviation between the compressed trajectory and the original.

SELECT st_deviation(traj, st_compress(traj, 0.001)) FROM traj_test;

Result:

    st_deviation
---------------------
 0.00919177345596219
(1 row)