This function returns the total length of a trajectory object, in meters.

Syntax

float8 ST_length(trajectory traj, integer srid default 0);

Parameters

Parameter Description
traj The trajectory object.
srid The spatial reference system identifier (SRID) for the coordinates of trajectory points in the trajectory object. Default value: 0.

Examples

select st_length(traj) from traj where id = 2;
    st_length     
------------------
 13494.6660605311
(1 row)