Database Reference
In-Depth Information
AND nbTrajs = COUNT( SELECT e.trajectory
FROM Episode e, Time t
WHERE e.road=r.id AND e.time=t.id
AND t.date >= 1/10/2010 AND t.date <= 31/12/2010 )
The outer query selects the roads that intersect the Lambrate district using
the intersects predicate, which determines if a pair of geometries intersect.
Then, the inner query (an OLAP query as defined above) joins the fact table
Episode with the dimension level Time , selects the episodes that occurred in
the last quarter of 2010 and in the road of the outer query, counts the number of
trajectories, and stores this number in the variable nbTrajs .
Q agg augmented with spatial types yields the class of Spatial OLAP ( SOLAP )
queries . As a consequence, we denote spatial data warehouse as a data ware-
house that supports SOLAP queries.
4.4.3 Spatio-Temporal OLAP
As explained in Chapter 3 ,
time-dependent
types are obtained by apply-
ing the type constructor moving (
)toa base or spatial type. For example,
a value of type moving ( point ) is a continuous function with signature
f : instant point . Time-dependent types are partial functions, that is,
they may be undefined for certain periods of time. Time-dependent types are
equipped with a set of operations, also defined in Chapter 3 . For example, the
projection of a time-dependent point into the plane consists of the points and
lines returned by the operations locations and trajectory , respectively.
Further, all operations over a nontemporal type are lifted to allow any of the argu-
ment types to be a time-dependent type and returns a time-dependent type. As
an example, the distance function, with signature point × point real ,
has lifted versions where one or both of its arguments can be time-dependent
points and the result is a time-dependent real. Intuitively, the semantics of such
lifted operations is that the result is computed at each time instant using the
nonlifted operation.
Analogously, aggregation operators can also be lifted. For example, a lifted
avg operator combines a set of time-dependent reals describing velocity for
several cars, and results in a new time-dependent real where the average is
computed at each instant. In addition, time-dependent aggregation operators
compute a scalar value from all the values taken by a time-dependent type.
For example, operator mavg can be used to obtain the average value from a
time-dependent real describing velocity.
Spatio-temporal OLAP (ST-OLAP) accounts for the case when the spatial
objects evolve over time. Thus, to express the following query, we need to extend
Q agg with both spatial types and the time-dependent types introduced above.
·
Search WWH ::




Custom Search