Database Reference
In-Depth Information
semantic aspect is considered. In this example, the free speed 2 in the analyzed
area is a contextual information to be taken into account when defining a traffic
congestion. The steps to be performed are: (1) to compute the free speed in the
area of each flock using through a data manipulation step; (2) to select only the
flocks with a speed lower than 1/4 of the computed free speed applying a model
manipulation step . For the first task, we need to find all the trajectories passing
in the area where the flock is found and compute their velocity. This allows us
to compute the free speed that is compared later with the flock speed. Therefore,
we use the spatial transformation Intersection between the T-flock pattern
and a trajectory:
CREATE TRANSFORMATION SubTrajectories USING INTERSECTION
FROM (SELECT flockID, flock FROM Flocks),
(SELECT trajID, trajectory FROM Trajectories)
SET INTERSECTION.ONLY_SPATIAL = true
The resulting table SubTrajectories contains the parts of trajectories
that intersect only the spatial extent of the Flock (using the ONLY SPATIAL
parameter): in other words, we are considering the whole set of vehicles that
pass in that area in the period of analysis. From this set of subtrajectories we
extract the average speed as an estimation of the free speed:
CREATE TRANSFORMATION FreeSpeeds USING STATISTICS
FROM (SELECT flockID, trajID, trajectory
FROM SubTrajectories)
The STATISTICS constructor indicates a set of predefined trajectory statistics
including the average velocity, all stored in a table. The second task is the
computation of the speed of the Flocks to be compared with the free speed.
CREATE TRANSFORMATION FlockSpeeds USING STATISTICS
FROM (SELECT flockID, flock FROM Flocks)
To identify the Flocks that are traffic jams we use a model interpretation step
where we constrain the set of Flocks using the definition of a traffic jam shown
in Figure 7.3 :
CREATE TABLE TrafficJams AS
SELECT f.flockID, f.flock
FROM FlockSpeeds s, Flocks f, FreeSpeeds fs
WHERE s.flockID = f.flockID AND
s.flockID = fs.FLOCK ID AND
s.avg_speed <= fs.avg_speed*.25
2 The term free speed indicates the average speed of a vehicle in a road without obstacles such as
traffic lights, accidents, or traffic congestion.
Search WWH ::




Custom Search