STS_IsStationary function

The STS_IsStationary function indicates whether the object is stationary.

Syntax

STS_IsStationary(
                        ts           TimeSeries,
                        begin_time   DATETIME YEAR TO FRACTION(5),
                        end_time     DATETIME YEAR TO FRACTION(5),
                        geometry     ST_Geometry)
returns Boolean

STS_IsStationary(
                        ts           TimeSeries,
                        begin_time   DATETIME YEAR TO FRACTION(5),
                        end_time     DATETIME YEAR TO FRACTION(5))
returns Boolean

STS_IsStationary(
                        ts           TimeSeries,
                        geometry     ST_Geometry)
returns Boolean
ts
The name of the time series.
begin_time (Optional)
The start of the time range. Can be NULL to indicate the first element in the time series.
end_time (Optional)
The end of the time range. Can be NULL to indicate the last element in the time series.
geometry (Optional)
The region of interest. Can be an ST_Point, ST_MultiPoint, ST_LineString, ST_MultiLineString, ST_Polygon, or ST_MultiPolygon. Must use the SRID 4326.

Usage

Run the STS_IsStationary function to find out whether an object was stationary during a time range or in the region of interest. If you specify the time range, the STS_IsStationary function returns t if the object was stationary during the entire time range. If you specify a location with the geometry parameter, the STS_IsStationary function returns t if the object was ever stationary in that location. If you include both a time range and a location, the STS_IsStationary function returns t if the object was stationary in that location for the entire time range.

Returns

t = The object was stationary.

f = The object was not stationary.

An exception = An error.

Example: Find whether vehicles were stationary during a time range

The following query returns whether the vehicles were stationary between 2015-06-14 12:34:25.00000 and 2015-06-14 12:43:23.00000:

SELECT modid, STS_IsStationary(ts_track, 
        '2015-06-14 12:34:25.00000','2015-06-14 12:43:23.00000') 
        FROM t_vehicle; 

modid                           (expression) 
1001                                      f
1002                                      t 

2 row(s) retrieved.

Vehicle 1002 was stationary.

Example: Find whether vehicles were stationary near a position

The following query returns whether any vehicles were ever stationary near the specified position:

SELECT modid, STS_IsStationary(ts_track, 
         ST_Point(-78.704498,43.919695, 4326)) 
         FROM t_vehicle; 

modid                           (expression) 
1001                                      f
1002                                      t 

2 row(s) retrieved.

Vehicle 1002 was stationary.