

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


ECS 266 Spatial Databases Spring 2008 Dr. Michael Gertz April 9
Due: Friday, April 18, 3:50PM, 3029 Kemper Hall or in class or electronically via email to [email protected]
Assume that you are left with nothing more than a relational database management system (RDBMS) somebody has used to model some geospatial data. The relational database schema you have to work with manages information about countries and their boundaries. There are the following three relations:
Country
name capital population id-boundary France Paris 60.7 b Spain Madrid 40.3 b
............
Boundary
id-boundary start-point end-point segment-num b1 p2 p3 2 b1 p1 p2 1 b1 p3 p4 3 b......... b2 p1 p6 1 b2 p6 p8 2 b.........
Point point-id x y p1 100 200 p2 342 256 p3 567 421
.........
The boundary of a country is described by a sequence of line seqments. A line segment is described by a start point, an end point, and the number the line has in describing the boundary of the country. We assume that the coordinates of points are given in quadrant I of the 2D Cartesian coordinate system.
We also assume that somebody has specified an integrity constraint (e.g., as trigger) that ensures that the region specified for a country is a simple polygon. However, there is no assurance that the regions associated with two countries do not intersect (neighboring countries are allowed to “share” points in describing line segments of their boundaries).
Give a single SQL query that determines pairs of countries (names) whose boundaries intersect. You can assume the SQL standard, in particular nested sub-queries. If no such SQL query is possible, then give an elaborate explanation why the query cannot be formulated. If you are able to come up with a query, briefly explain how the query is structured and what conditions you check.
Assume you have to implement a spatial ADT to represent an octahedron in the 3-dimensional space. Roughly speaking, an octahedron consists of two square pyramids glued together at their bottom. In total, an octahedron has 12 edges, 6 vertices, and 8 faces (which are triangles), see also the figure below.
Figure 1: Octahedron
It is your task to describe the basic components of an abstract data type to represent octahedron objects in 3-dimensional space.