The Architecture of a Flexible Querier for Spatio- Temporal Databases Karine Reis Ferreira Lúbia...
-
Upload
madison-gilbert -
Category
Documents
-
view
213 -
download
0
Transcript of The Architecture of a Flexible Querier for Spatio- Temporal Databases Karine Reis Ferreira Lúbia...
The Architecture of a Flexible Querier for Spatio-Temporal Databases
Karine Reis Ferreira Lúbia Vinhas
Gilberto Ribeiro de Queiroz Ricardo Cartaxo Modesto de Souza
Gilberto Câmara
GeoInformation GroupImage Processing Division – DPI
Introduction
Challenge to GISystems: use spatially enabled DBMS to build innovative applications which deal with spatio-temporal data
How to address it: ST Types and their associated Algebra (Gutting, 2005) Conceptual models, E-R models for ST-Data (Pelekis et al,
2004) ST Query Languages (ISO, 2001) ST Predicates (Egenhofer and Franzosa, 1991; Allen,1983)
Which is the canonical set of ST Predicates? Application specialized subset Building blocks that can be combined (Erwig and Schneider, 2002)
Introduction
How to design a flexible query processor for spatio-
temporal data using object-relational DBMS?
Some aspect to be considered: Applications are different: in terms of queries and responses
An unified and flexible architecture is desired
Layers
A geographical database is composed by layers
Layers contain Spatio-Temporal Objects (ST-Objects)
Static Layers: ST-Objects do not change along the time, neither in their
descriptive or geometrical attributes
Temporal Layers ST-Objects change along the time, either in their descriptive or
geometrical attributes
ST-Instance represent version in a given time of a ST-Object
Database Model
Ex: a layer of districts of a city
DistrictsG
geomId: int
objId: string
spatialD: spatial
1 D1 bbbbbbbbbbbbb
2 D2 bbbbbbbbbbbbb
3 D3 bbbbbbbbbbbbb
DistrictsA
CODDIS:string
NOME:string
POP:int
D1 Agua Rasa 85896
D2 Cangaiba 137442
D3 Capão Redondo 240793
layerslayerId:
intlayerName:
string
1 Distritos
representations
layerId: int
geomRelatio: string
1 DistrictsG
attributesRel
layerId: int
attrRelation: string
1 DistrictsA
Data Metdata
Database ModelDistrictsG
geomId: int
objId: string
spatialD: spatial
1 D1 bbbbbbbbbbbbb
2 D2 bbbbbbbbbbbbb
3 D3 bbbbbbbbbbbbbDistrictsStatus
attrInststring
geomInst:string
timeI:time
timeF:time
1 1 01/01/2003
2 2 01/01/2003
3 3 01/01/2003
Initial State
DistrictsA
CODDIS:string
NOME:string
POP:int
attrInststring
D1 Agua Rasa 85896 1
D2 Cangaiba 137442 2
D3 Capão Redondo 240793 3
Database ModelDistrictsG
geomId: int
objId: string
spatialD: spatial
1 D1 bbbbbbbbbbbbb
2 D2 bbbbbbbbbbbbb
3 D3 bbbbbbbbbbbbb
4 D1 bbbbbbbb
DistrictsStatus
attrInststring
geomInst:string
timeI:time
timeF:time
1 1 01/01/2003 31/12/2003
2 2 01/01/2003
3 3 01/01/2003
1 4 31/12/2003
DistrictsA
CODDIS:string
NOME:string
POP:int
attrInststring
D1 Agua Rasa 85896 1
D2 Cangaiba 137442 2
D3 Capão Redondo 240793 3
Change in Geometry
Database ModelDistrictsG
geomId: int
objId: string
spatialD: spatial
1 D1 bbbbbbbbbbbbb
2 D2 bbbbbbbbbbbbb
3 D3 bbbbbbbbbbbbb
4 D1 bbbbbbbb
DistrictsStatus
attrInststring
geomInst:string
timeI:time
timeF:time
1 1 01/01/2003 31/12/2003
2 2 01/01/2003 01/06/2004
3 3 01/01/2003
1 4 31/12/2003
4 2 01/06/2004
DistrictsA
CODDIS:string
NOME:string
POP:int
attrInststring
D1 Agua Rasa 85896 1
D2 Cangaiba 137442 2
D3 Capão Redondo 240793 3
D2 Cangaiba 150000 4
Change in Attributes
Database ModelDistrictsG
geomId: int
objId: string
spatialD: spatial
1 D1 bbbbbbbbbbbbb
2 D2 bbbbbbbbbbbbb
3 D3 bbbbbbbbbbbbb
4 D1 bbbbbbbb
5 D3 bbbb
DistrictsStatus
attrInststring
geomInst:string
timeI:time
timeF:time
1 1 01/01/2003 31/12/2003
2 2 01/01/2003 01/06/2004
3 3 01/01/2003 21/09/2004
1 4 31/12/2003
4 2 01/06/2004
5 5 21/09/2004
DistrictsA
CODDIS:string
NOME:string
POP:int
attrInststring
D1 Agua Rasa 85896 1
D2 Cangaiba 137442 2
D3 Capão Redondo 240793 3
D2 Cangaiba 150000 4
D3 Capão Redondo 250000 4
Change in Attributes and Geometry
ST Data - Examples
Crime events: crime
occurrences in a city,
specifying its time and
location
Which crimes happened
on Friday in the Humaitá
district of Porto Alegre
city?
ST Data - Examples
Epidemiological data: the
weekly counting of mosquito
eggs in a set of traps arbitrarily
deployed over a city
http://saudavel.dpi.inpe.br/
How many eggs were counted by trap in each month?
ST Data - Examples
Land parcels
For each month, which changes occurred in the parcels?
The Querier Processor ArchitectureApplication Program Interface
Parameters
SQLST Data
ST Instances
ProcessingQuerier
Application
Spatio-temporal Database
PostGIS MySQL Oracle…
Querier Parameters
Layer: the source of the ST-Instances
Chronon: defines how the time extension of the layer
should be divided into a set of time frames second, minute, hour, day, month, year, day of week,
day of month, day of year, month of year, week of year, hour of day, minute of hour or second of minute
Querier Parameters
Aggregate functions: how to group a set of ST-Instances
of a time frame in a representative one average, sum, counting, variance maximum or minimum,
Which time frames will be retrieved: controls if the Querier should returns either every time frame
existent in the total interval of the data or only the time frames
where some change occurred
Querier Parameters
Temporal predicate: defines a relation between the data and the time frames (as specified by the Chronon) temporal interval predicates: equals, before, after, meets,
during, overlaps, ends or starts [Allen,1983]
Spatial predicate: defines a relation between the data and a geometry disjoint, touches, crosses, within, overlaps, contains,
intersects, equals, covers and covered by [Egenhofer and Franzosa, 1991]
Querier Examples
Return all crime events, their location and properties
CrimeLayer = database->getLayer (“Crimes”);
Source of the ST Data
Querier Examples
Return all crime events, their location and properties
CrimeLayer = database->getLayer (“Crimes”);
Querier->setParams(loadGeometries, loadAllAttributes);Querier->setParams(CrimeLayer);
Set parameters
Querier Examples
Return all crime events, their location and properties
CrimeLayer = database->getLayer (“Crimes”);
Querier->setParams(loadGeometries, loadAllAttributes);Querier->setParams(CrimeLayer);
Querier->loadInstances();
Run the query processor
Querier Examples
Return all crime events, their location and properties
CrimeLayer = database->getLayer (“Crimes”);
Querier->setParams(loadGeometries, loadAllAttributes);Querier->setParams(CrimeLayer);
Querier->loadInstances();
while (Querier->fetchInstance(sti)) { Geometry = sti.getGeometry(); Properties = sti.getProperties(); Time = sti.getTime(); }
Consume the instances
Querier Examples
Which crimes happened in 2003 in the district “Cabanga” of Recife city?
DistrictLayer = database->getLayer (“Districts”);DistrictGeometry = DistrictLayer->getGeometry(“Cabanga”);
Querier Examples
Which crimes happened in 2003 in the district “Cabanga” of Recife city?
DistrictLayer = database->getLayer (“Districts”);DistrictGeometry = DistrictLayer->getGeometry(“Cabanga”);
Querier->setParams(loadGeometries, loadAllAttributes);Querier->setParams(CrimeLayer, year, ChangedTimeFrames);Querier->setSpatialRestriction(DistrictGeometry,within);
Querier Examples
Which crimes happened in 2003 in the district “Cabanga” of Recife city?
DistrictLayer = database->getLayer (“Districts”);DistrictGeometry = DistrictLayer->getGeometry(“Cabanga”);
Querier->setParams(loadGeometries, loadAllAttributes);Querier->setParams(CrimeLayer, year, ChangedTimeFrames);Querier->setSpatialRestriction(DistrictGeometry,within);
TimeFrame = Querier->getTimeFrame(‘2003’);Querier->loadInstances(TimeFrame);while (Querier->fetchInstance(sti)) {
...}
Querier Examples
How many eggs were counted in each trap in each month?
TrapLayer = database->getLayer (“Traps”);
Querier Examples
How many eggs were counted in each trap in each month?
TrapLayer = database->getLayer (“Traps”);
GroupingAttributes->insert(“num_eggs”, SUM);Querier->setParams(loadGeometries, GroupingAttributes);Querier->setParams(TrapLayer, month, ChangedTimeFrames);
Querier Examples
How many eggs were counted in each trap in each month?
TrapLayer = database->getLayer (“Traps”);
GroupingAttributes->insert (“num_eggs”, SUM);Querier->setParams(loadGeometries, GroupingAttributes);Querier->setParams(TrapLayer, month, ChangedTimeFrames);
numTimeFrames = Querier->getNumTimeFrames();for (frame=0 to numTimeFrames)
Querier->loadInstances(frame);while (Querier->fetchInstance(sti))
...
Querier Examples
Which changes occurred in the land parcels in each month?
ParcelLayer = database->getLayer (“Parcels”);
Querier Examples
Which changes occurred in the land parcels in each month?
ParcelLayer = database->getLayer (“Parcels”);
Querier->setParams(loadGeometries, loadAllAttributes);Querier->setParams(ParcelLayer, month,ChangedTimeFrames,
Starts | Ends);
Querier Examples
Which changes occurred in the land parcels in each month?
ParcelLayer = database->getLayer (“Parcels”);
Querier->setParams(loadGeometries, loadAllAttributes);Querier->setParams( ParcelLayer, month,ChangedTimeFrames,
Starts | Ends);
numTimeFrames = Querier->getNumTimeFrames();for (frame=0 to numTimeFrames)
Querier->loadInstances(frame);while (Querier->fetchInstance(sti)) ...
The Database Change Observer
The Querier mechanism is being implemented in the TerraLib environment TerraLib spatial and temporal structures TerraLib Generic Database Application Interface
Support to: MySQL, Oracle Spatial, PostGIS, PostgreSQL…
www.terralib.org
The application shows the status of a spatio-temporal database
ST Database Observer
Observing the crime events
Observing the crime events
Observing the egg traps
Observing the egg traps
Observing the egg traps
Observing the egg traps
Observing the land parcels
Observing the land parcels
Observing the land parcels
Observing the land parcels
Observing the land parcels
Final Remarks
The proposed architecture of a geographical database fulfills the demands of our spatio-temporal applications The spatio-temporal database model is simple and can be
implemented in different DBMS
A Querier Mechanism based on the combination of spatial and temporal parameters is a flexible alternative to deal with the different applications
Future Improvements
The Querier mechanism has to deal with two layers: Ex: fire spots and deforestation: two different data set that is
highly related in space and in time
Build a catalog of some well-known operations such as “trajectory” using the Querier mechanism
Study the possibility of using the Querier mechanism as a processor for a ST-Language
The Architecture of a Flexible Querier for Spatio-Temporal Databases
{karine, lubia, gribeiro, cartaxo, gilberto}@dpi.inpe.br
www.dpi.inpe.br
GeoInformation GroupImage Processing Division