STS_GetTimesPassedByRegion function
The STS_GetTimesPassedByRegion function is an iterative function and returns all the times within a time range when an object is near the specified position.
Syntax
STS_GetTimesPassedByPoint(
ts TimeSeries,
begin_time DATETIME YEAR TO FRACTION(5),
end_time DATETIME YEAR TO FRACTION(5),
geometry ST_Geometry)
returns DATETIME YEAR TO FRACTION(5)
- ts
- The name of the time series.
- 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_GetTimesPassedByRegion function to return all the times within a time range when an object is near the specified position.
Returns
Returns the times that the vehicle passed within the specified region in as rows instead of a set.Example
SELECT * from table(STS_GetTimesPassedByRegion((select ts_track from t_vehicle where modid =’1’),
'2017-02-02 13:00:00', '2017-02-02 13:03:30',
St_buffer(ST_Point(116.401, 39.911, 4326), 100, ‘meter’)));
2017-02-02 13:00:20.00000
2017-02-02 13:00:43.00000
2017-02-02 13:01:16.00000