GPS and other location sensors continuously generate time-stamped coordinates — vehicle routes, delivery paths, equipment inspection tracks. Storing these as raw point records makes spatial analysis slow and storage-intensive. ApsaraDB RDS for PostgreSQL provides native trajectory support through the GanosBase spatio-temporal engine, which lets you:
Compress trajectory points to reduce storage costs
Calculate intersections between trajectories
Extract sub-trajectories from a longer path
Determine the similarity between trajectories
How it works
A trajectory is built from individual trajectory points. Each point records a timestamp and spatial coordinates. For example, an object at longitude 114.35, latitude 39.28 at 17:42:30 on April 11, 2020 produces the following record:
| Time | x | y |
|---|---|---|
| 2020-04-11 17:42:30 | 114.35 | 39.28 |
Sampling points often include additional attributes such as speed and direction. Adding a speed attribute to the example gives:
| Time | x | y | Speed |
|---|---|---|---|
| 2020-04-11 17:42:30 | 114.35 | 39.28 | 4.3 |
As the object moves, more trajectory points are collected. Three consecutive points form a sequence like this:
| Time | x | y | Speed |
|---|---|---|---|
| 2020-04-11 17:42:30 | 114.35 | 39.28 | 4.3 |
| 2020-04-11 17:43:30 | 114.36 | 39.28 | 4.8 |
| 2020-04-11 17:44:30 | 114.35 | 39.29 | 3.5 |
Aggregating these points produces a spatio-temporal trajectory, as shown in the following figure.

Use cases
Vehicle tracking: Record GPS coordinates and speed for a fleet of vehicles. Query routes or detect overlapping paths.
Logistics and delivery: Store courier paths and extract sub-trajectories to audit on-time performance for specific route segments.
Equipment inspection: Capture inspection device tracks across a facility and calculate trajectory similarity to verify that inspection routes match required coverage patterns.