U de C - logo

SPATIAL DATABASES

diicc - logo

Logical Data Models and Languages > Object-Oriented Model > Query language

Spatial selection: returning those objects satisfying a spatial predicate with the query object

“All cities in Valencia”
SELECT cname FROM c in Cities WHERE c.center->inside(Valencia.area)

“All rivers intersecting a query window”
SELECT r.name FROM r in rivers WHERE r.route->intersect(Window)

“All big cities no more than 100 Kms from Valencia”
SELECT cname FROM c in cities
WHERE c.center->dist(Valencia.center) < 100

Spatial join: A join which compares any two joined objects based on a predicate on their spatial attribute values.

“For each river that passes through Valencia, find all cities within less than 50 Kms.”
SELECT r.rname, c.cname
FROM r in rivers, c in cities
WHERE r.route->intersect(Castilla.area) and r.route->dist(c.area) < 50


Valid HTML 4.0! Valid CSS!