ST_deviation
Updated at:
Copy as MD
Returns the deviation between a processed trajectory object and the original trajectory object. Use this function to measure how much a trajectory changes after operations such as compression.
The return value is a float8 scalar.
Syntax
float8 ST_deviation(trajectory traj, trajectory after_oper_traj);Parameters
| Parameter | Description |
|---|---|
traj | The original trajectory object. |
after_oper_traj | The processed trajectory object, such as a compressed trajectory. |
Example
The following example computes the deviation introduced by compressing a trajectory with a tolerance of 0.001:
SELECT st_deviation(traj, st_compress(traj, 0.001)) FROM traj_test;
st_deviation
---------------------
0.00919177345596219
(1 row)What's next
ST_compress: Compress a trajectory object with a specified tolerance.
Is this page helpful?