All Products
Search
Document Center

PolarDB:ST_trajectorySpatial

Last Updated:Mar 28, 2026

Returns the spatial geometry of a trajectory object.

Syntax

geometry ST_trajectorySpatial(trajectory traj);
geometry ST_trajSpatial(trajectory traj);

ST_trajSpatial is an alias for ST_trajectorySpatial.

Parameters

ParameterTypeDescription
trajtrajectoryThe trajectory object to extract spatial geometry from.

Example

The following example extracts the spatial geometry from the traj column in traj_table and returns it as a WKT string.

Select ST_AsText(ST_trajectorySpatial(traj)) FROM traj_table;
            st_astext
----------------------------------
 LINESTRING(114 35,115 36,116 37)