Database Reference
In-Depth Information
The operations that we introduce need a name as well as definition of argument
and result types. More formally, this is called a
signature
. For the three operations
mentioned above, the signatures would be:
trajectory:
mpoint
→
line
deftime:
mpoint
→
periods
at:
mpoint
×
region
→
mpoint
Of course, the data types to represent the arguments and results must be
available in the system as well. Types
line
and
region
may be available in
DBMSs with spatial support. Type
periods
represents a set of disjoint time
intervals and must be added.
What are the advantages of using such a model? Chapter 1 introduced
move-
ment tracks
as the set of captured data over time for a moving object and
explained that it typically can be represented as a sequence of pairs (
instant
,
position
), hence as a sequence
where
t
i
is of type
instant
and
p
i
of type
point
. Given a DBMS that has such data types, we can then simply
represent a set of captured moving tracks in a table with schema:
(
t
1
,p
1
)
,...,
(
t
n
,p
n
)
Observations(Id: int, Time: instant, Position: point)
Is it not sufficient to use such a representation in a DBMS? It is sufficient
as long as one tries to formulate only very simple queries. Basically, simple
queries (for a MOD) become difficult to formulate and advanced queries become
practically impossible. Consider two simple queries.
1. Where have the vehicles been at 6:30 P.M.?
The problem is that positions generally have not been recorded at 6:30 P.M.
In the SQL query, for each vehicle we have to find the last recorded position
before 6:30 P.M. and the first after 6:30 P.M. Then, in the
select
clause we
need to perform interpolation between the two time instants and positions
with the time argument 6:30 P.M.
In a MOD, one would instead have a table
Vehicles(Id: int, Trip: mpoint)
and the query is written as
select Id, val(Trip atinstant six30) as Pos630 from Vehicles
The query operations used are explained in Section
3.2
.
2. At what times and positions did vehicles pass the river Rhine?
Here it is not so easy to determine positions before and after crossing the
river Rhine and then do the interpolation as above. Perhaps the best strategy
is to perform a self-join on the
Observations
table to put together pairs
of adjacent observations and then to construct a line segment connecting