Returns the total spherical length of a trajectory object, in meters.
Syntax
float8 ST_length(trajectory traj, integer srid default 0);Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
traj | trajectory | — | The trajectory object. |
srid | integer | 0 (4326) | The spatial reference system identifier (SRID) of the trajectory object. When set to 0, the SRID defaults to 4326 (WGS 84). |
Description
ST_length computes the spherical length of a trajectory object in meters, based on the object's SRID. Pass the srid parameter to specify a coordinate reference system. If omitted, the SRID defaults to 4326.
Examples
SELECT st_length(traj) FROM traj WHERE id = 2;Output:
st_length
------------------
13494.6660605311
(1 row)该文章对您有帮助吗?