All Products
Search
Document Center

PolarDB:ST_leafCount

Last Updated:Mar 28, 2026

Returns the number of leaves (trajectory points) in a trajectory object.

Syntax

integer ST_leafCount(trajectory traj);

Parameters

ParameterDescription
trajThe trajectory object.

Examples

Query the number of trajectory points in the trajectory with ID 2:

SELECT st_leafcount(traj) FROM traj WHERE id = 2;

Output:

 st_leafcount
--------------
 16