STS_GetLocStationaryWithin function
The STS_GetLocStationaryWithin function returns the set of objects that are stationary within the specified region during the specified time range.
Syntax
STS_GetLocStationaryWithin(
subtrack_name VARCHAR(128),
begin_time DATETIME YEAR TO FRACTION(5),
end_time DATETIME YEAR TO FRACTION(5),
geometry ST_Geometry)
returns ROW
- subtrack_name
- The name of the subtrack table.
- begin_time
- The start of the time range. Can be NULL to indicate the first element in the time series.
- end_time
- The end of the time range. Can be NULL to indicate the last element in the time series.
- geometry
- 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_GetLocStationaryWithin function to find which objects were stopped in a region at a specific time.
Returns
A set of primary key values = The objects that were stationary in the region.
NULL = Nothing found.
Example
The following statement returns which vehicle was stationary in the specified region between the times of 2015-06-14 12:30:00 and 2015-06-14 12:45:00:
SELECT * FROM TABLE(sts_getlocstationarywithin('t_vehicle_subtrack',
'2015-06-14 12:30:00', '2015-06-14 12:45:00',
ST_Buffer('4326 POINT(-78.704500 43.919700)'::ST_Point,
31,'foot'))::row(modid varchar(60)))
AS t(mid);
mid ROW('1002')
1 row(s) retrieved.
Vehicle 1002 was stationary in the region.