Database Reference
In-Depth Information
We can see that the operations are applied to temporal fields in the same
way as they are applied to other temporal data types. The following query
computes for each land plot a nontemporal raster reporting the average
temperature during March 2012 at each point in the land plot:
SELECT L.Id, AVG S(AtPeriod(L.Temp, PERIOD(
'
2012-03-01
'
,
'
2012-04-01
'
)),
FROM LandPlot L
Here, the temperature field is restricted to March 2012 with function
AtPeriod
. Then, the
AVG S
is applied to the resulting temporal raster, which
obtains at each point in space the average temperature over the month.
Finally, the following query selects land plots with an average temperature
greater than 10
◦
C in March 2012:
SELECT L.Id
FROM LandPlot L
WHERE FAvg(Avg S(AtPeriod(T.Temp, PERIOD(
'
2012-03-01
'
,
'
2012-04-01
'
))))
>
10
In the above query, the temperature field, restricted to March 2012 with the
AtPeriod
operation, is aggregated with the
Avg S
operation resulting in a
nontemporal field reporting the average temperature over the month at each
point. Then, the field aggregation operation
FAvg
is applied to obtain the
average as a real value, which is then compared to 10.
12.4 The Northwind Trajectory Data Warehouse
We are now ready to study how a conventional data warehouse (or a spatial
data warehouse) can be extended with temporal types in order to support
the analysis of trajectory data. We will use the Northwind case study in order
to introduce the main concepts. Let us state the problem.
The Northwind company wants to build a trajectory data warehouse
that keeps track of the deliveries of goods to their customers in order to
optimize the shipping costs. Spatial data in the warehouse include the road
network, the delivery locations, and the geographical information related
to these locations (city, state, country, and area). Nonspatial data include
the characteristics of the trucks performing the trajectories. In addition, we
have the trajectories followed by the trucks, that means, moving object data.
Figure
12.6
shows the conceptual schema depicting the above scenario using
the MultiDim model, which we introduced in Chap.
4
and extended to support
spatial data in Chap.
11
(although any other conceptual model could be used
instead). In order to support spatiotemporal data, we extended the MultiDim
model with spatial types and temporal types.
We would like to analyze the deliveries by trucks, days, roads, and delivery
locations. Therefore, we need to split the trajectories into
segments
such
that each segment is related to a single truck, day, road, start location, and
Search WWH ::
Custom Search