STS_GetLocIntersect function

The STS_GetLocIntersect function returns the set of objects whose trajectories intersect the specified region during the specified time range.

Syntax

STS_GetLocIntersect(
                    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_GetLocIntersect function to find which objects intersected a region during a time range.

The following illustration shows a region that is intersected by three trajectories.

Figure 1: Trajectories that intersect a region

The image shows a region with three trajectories. One trajectory intersects the region in two places. One trajectory is completely within the region. One trajectory intersects the region in one place.

Returns

A set of primary key values = The objects that intersected the region.

NULL = Nothing found.

Example

The following statement returns which vehicles stayed in the region between the times of 2014-06-10 16:30:00 and 2014-06-10 17:00:00:

SELECT * FROM TABLE(STS_GetLocIntersect ('t_vehicle_subtrack', 
         '2014-06-10 16:30:00', '2014-06-10 17:00:00',
         ST_Buffer('4326 POINT(-78.752717 43.922478)'::ST_Point, 
                   64, 'meter'))::row(modid varchar(60))) 
         AS t(mid);

mid  ROW('1001')

1 row(s) retrieved.

Vehicle 1001 stayed in the region.