Spatial Database Querying with Logic Languages Jean-Pierre Cheiney & Vincent Oria Ecole Nationale SupCrieure des T&communications 75013 Paris - France (cheiney, oria}@inf.enst.fr Abstract Several d&rent data structures, generally grouped in Raster and Vectors representation models, are used to store images and all hinds of spatial data. One solution, for a spatial data manipulation language to be independent of the storage model, is to base the language on the spatial relations of objects (i.e. the positions of objects relative to each other). This paper proposes a logic intermediate lan- guage allowing a declarative querying. We show that this language can be easily computed by a procedural execution using a small set of operators. This language enables ex- pression of direction and topological spatial relations and ensures a physical data independence and the processing can benefit from spatial access methods. The language is composed of two complementary sub-languages. The first one uses an object approximate and results in the selection of a set of candidate objects, which are investigated more in detail using the second one. 1 Introduction Most database query languages for spatial data are based on specific data structures used for image stor- age. These structures correspond to two representa- tion models: raster [22, 111 in which the image is con- sidered as a set of points, and vector [17] in which the objects are stored as a set of vectors. The choice of a specific data structure depends on the forecasted manipulations. Such languages are linked with a par- ticular application domain and various uses demand different representation of the images [16]. In this pa- per we focus only on the querying of spatial data with a minimum model (a spatial object is a set of points). An interesting approach that takes into account both of the representation models, is to build the data manipulation language using spatial relations existing between objects (elements of the images). In spatial relations, we assume relative positions of objects with Proceedings of the Fourth International Conference on Database Systems for Advanced Applications (DASFAA’QL) Ed. Tok Wang Ling and Yoshifumi Masunaga Singapore, April 10-13, 1995 @ World Scientific Publishing Co. Pte Ltd respect to each other. The spatial relations allow the description of constraints on the objects, for searching or updating particular objects. There are two kinds of spatial relations: direction relations and topologi- cal relations. Direction relations are relations such as left, right, above, below [7, 51 or east, west, north and south in geographic applications [20, 8, 121. Topologi- cal relations [lo, 9] involve the boundary, interior and exterior of objects such as disjoint, meet, equal, covers, covered by, inside, contains and overlap. Most of pre- vious works on spatial relations studied either direc- tion relations or topological relations between objects. Otherwise, the operators are built for a specific image representation and use specific data structures. Works on direction relations have focused on how to combine knowledge about directions. The 8 spatial topologi- cal relations between the objects are represented by Egenhofer using a 3x3 matrix called I-intersections [lo]. For two regions (objects with surface) A and B, Egenhofer compares the closure (6A, 6B), the in- terior (Ao, Bo) and the exterior (A-, B-). The 9 possible combinations constitute the elements of the g-intersection matrix. This approach is interesting but is linked to the storage data structures of the objects (e.g. a raster storage implies 8 other relations) [9] and cannot express direction relations. Another approach is to project the objects on the axes and to study their distribution on the diRerent axes. Basic relations in a one-dimensional (1D) space (each of the axes) are defined and their combination leads to define complex direction relations in a nD space. This approach was used in [l3] to support topological and direction spatial relations, but stays limited to the objects having rect- angular shapes. We have followed the same approach [6, 181, considering the relations between object pro- jections as filter relations and proposing another solu- tion for the refinement which overcome the limits of Guesgen’s approach. We consider two classes of spatial queries: overlap queries and disjunction queries. The first class groups queries involving proximity, neighbourhood and other topological spatial relations except the disjoint relation 342