  We address aggregate queries over GIS data and moving object data, where
non-spatial data are stored in a data warehouse. We propose a formal data model
and query language to express complex aggregate queries. Next, we study the
compression of trajectory data, produced by moving objects, using the notions
of stops and moves. We show that stops and moves are expressible in our query
language and we consider a fragment of this language, consisting of regular
expressions to talk about temporally ordered sequences of stops and moves. This
fragment can be used to efficiently express data mining and pattern matching
tasks over trajectory data.
