Trajectory SQL models moving objects — such as vehicles, vessels, or IoT devices — as structured spatiotemporal data. This document introduces the two core data types you work with when querying trajectory data: Trajectory Object and BoxNDF.
Trajectory objects
A Trajectory Object represents the complete history of a moving object. It combines three layers of information:
Where — the spatial geometry of the path (Trajectory Spatial)
When — an ordered time sequence (Trajectory Timeline)
What happened — attributes at each point in time and discrete events along the way
The atomic unit is the Trajectory Point: a single observation that records the spatial location (in 2D or 3D coordinates) and one or more attribute values at a specific timestamp. A Trajectory Object combines many Trajectory Points with any events that occurred during the journey.
The following figure shows the trajectory of a moving object.

The table below defines each component of a Trajectory Object.
| Component | Description |
|---|---|
| Trajectory Point | A single spatiotemporal observation of a moving object. Records the spatial location (2D or 3D coordinates) and attribute values at a specific timestamp. |
| Trajectory Object | The complete high-dimensional representation of a moving object, comprising Trajectory Points and Trajectory Events. Encompasses time, space, attributes, and events. |
| Trajectory Timeline | The ordered time sequence of a trajectory. Timestamps must be consecutive. |
| Trajectory Spatial | The spatial geometry of a trajectory path, typically represented using the LineString data type. |
| Trajectory Leaf | The spatial location of a moving object at a specific point in time. The spatial location is a trajectory point. |
| Trajectory Attributes | Descriptive properties of a moving object recorded at each Trajectory Point, such as velocity and direction. |
| Trajectory Attribute Field | A named field that stores one attribute across all Trajectory Points. The number of values in a field equals the number of Trajectory Points in the trajectory. |
| Trajectory Field Value | The value of a Trajectory Attribute Field at a specific timestamp. |
| Trajectory Events | Discrete occurrences along a trajectory, such as refueling, breakdown, or car lock events for a vehicle. Each event stores an event type ID and an event time. |
Trajectory Spatial and Trajectory Leaf are easy to confuse. Trajectory Spatial is the full path geometry of the entire journey. Trajectory Leaf is the location at a single point in time.
BoxNDF objects
Trajectory Objects and other geometries can be complex. Therefore, cubes that are easier to calculate than these trajectory-related objects may be used to describe queries or simplify computing operations. BoxNDF is the data type used to describe these cubes.
A BoxNDF object is a multi-dimensional spatio-temporal cube defined by the minimum and maximum values on four coordinate axes: x, y, z, and t. The z axis indicates space, and the t axis indicates time.
Not all BoxNDF objects use all four axes. A 2D spatial query uses only x and y; a full spatiotemporal query uses x, y, z, and t.
When you run a query, you can use a cube to specify the query scope. In addition, you can use a bounding box of the trajectory or geometry type to make the query easier.
The following figure shows the trajectory and bounding box of an object moving on the x, y, and t axes.
