STS_GetNumberOfTimesPassedByRegion function

The STS_GetNumberOfTimesPassedByRegion function returns the number of times within a time range when an object is within the specified region.

Syntax

STS_GetNumberOfTimesPassedByRegion(
                        ts           TimeSeries,
                        begin_time   DATETIME YEAR TO FRACTION(5),
                        end_time     DATETIME YEAR TO FRACTION(5),
                        geometry     ST_Geometry)
returns INTEGER
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_GetNumberOfTimesPassedByRegion function to find out the number of times within a time range when an object is within the specified region.

Returns

Returns a set of datetime values that a vehicle passed within the specified region.

Example

SELECT STS_GetNumberOfTimesPassedByRegion(ts_track, '2017-02-02 13:00:00', '2017-02-02 13:03:30',
St_buffer(ST_Point(116.401, 39.911, 4326), 100, ‘meter’))
FROM t_vehicle 
WHERE modid='1';

Copyright© 2019 HCL Technologies Limited