Returns true if a trajectory object and the specified geometry object are spatially equal within the specified time range.
Syntax
boolean ST_equals(trajectory traj, tsrange range, geometry g);
boolean ST_equals(trajectory traj, timestamp t1, timestamp t2, geometry g);Use the tsrange overload to pass the time range as a single PostgreSQL range value. Use the t1/t2 overload to pass start and end timestamps separately.
Parameters
| Parameter | Type | Description |
|---|---|---|
traj | trajectory | The trajectory object. |
range | tsrange | The time range. |
t1 | timestamp | The start time. |
t2 | timestamp | The end time. |
g | geometry | The geometry object to compare against. |
Example
Check whether a trajectory between 13:00 and 14:00 on January 1, 2010 is spatially equal to a line:
SELECT ST_equals(traj, '2010-1-1 13:00:00', '2010-1-1 14:00:00', 'LINESTRING(0 0, 5 5, 9 9)'::geometry)
FROM traj_table;该文章对您有帮助吗?