MOVING BALLOON ALGEBRA: DESIGN, IMPLEMENTATION, AND DATABASE INTEGRATION OF A SPATIOTEMPORAL DATA MODEL FOR HISTORICAL AND PREDICTIVE MOVING OBJECTS

Size: px
Start display at page:

Download "MOVING BALLOON ALGEBRA: DESIGN, IMPLEMENTATION, AND DATABASE INTEGRATION OF A SPATIOTEMPORAL DATA MODEL FOR HISTORICAL AND PREDICTIVE MOVING OBJECTS"

Transcription

1 MOVING BALLOON ALGEBRA: DESIGN, IMPLEMENTATION, AND DATABASE INTEGRATION OF A SPATIOTEMPORAL DATA MODEL FOR HISTORICAL AND PREDICTIVE MOVING OBJECTS By REASEY PRAING A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY UNIVERSITY OF FLORIDA

2 c 2008 Reasey Praing 2

3 To my dear family who provides me with love, encouragement, and support, making this milestone possible 3

4 ACKNOWLEDGMENTS I thank the chair and members of my supervisory committee for their mentoring, my colleagues for their intellectual support, and the Computer Science department as well as the National Science Foundation for their financial support. I thank my parents, my sisters and brother for their loving encouragement, which motivated me to complete my study. 4

5 TABLE OF CONTENTS page ACKNOWLEDGMENTS LIST OF TABLES LIST OF FIGURES ABSTRACT CHAPTER 1 INTRODUCTION Motivation Problem Statement Goals and Solutions RELATED WORK Spatial Data Modeling Spatial Objects Topological Relationships Spatiotemporal Data Modeling Historical Movements of Moving Objects Predictive Movements of Moving Objects Implementation Aspects of Spatial and Spatiotemporal Data Models Database Integration ABSTRACT MODEL OF THE MOVING BALLOON ALGEBRA Modeling Historical and Predicted Movements Continuity of Movement Modeling Historical Movements of Moving Objects Modeling Future Predictions of Moving Objects Handling the uncertainty of the future positions and extent of moving objects Data types for future predictions of moving objects Modeling Moving Balloon Objects Balloon Data types Spatiotemporal Balloon Data Types Operations of the Moving Balloon Algebra Operations on Historical Movements Operations on Future Predictions Operations on Balloon Objects Operations on Moving Balloon Objects Spatiotemporal Predicates

6 3.4.1 Modeling Balloon Predicates General mechanism for balloon predicates Specification based on traditional spatiotemporal predicates Canonical collection of balloon predicates Reasoning About Actual Future Interactions Querying Using the Moving Balloon Algebra Interoperating with Prediction Models Spatiotemporal Queries DISCRETE MODEL OF THE MOVING BALLOON ALGEBRA Non-Temporal Data Types Base Data Types and Time Data Types Spatial Data Types Basic Spatiotemporal Data Types Temporal Units for Base Types Temporal Units for Spatial Data Types Unit point Unit line Unit region Balloon Data Types and Spatiotemporal Balloon Data Types Balloon Data Types Spatiotemporal Balloon Data Types IMPLEMENTATION MODEL OF THE MOVING BALLOON ALGEBRA Data Structures General Requirements of Database-Compatible Data Structures Data Structures for Spatial Data Types Data Structures for Spatiotemporal Data Types Data structures for basic spatiotemporal data types Data structures for balloon and spatiotemporal balloon data types Algorithms for Topological Predicates on Complex Spatial Objects Basic Algorithmic Concepts Parallel object traversal Overlap numbers Plane sweep The Exploration Phase for Collecting Topological Information The exploration algorithm for the point2d/point2d case The exploration algorithm for the point2d/line2d case The exploration algorithm for the point2d/region2d case The exploration algorithm for the line2d/line2d case The exploration algorithm for the line2d/region2d case The exploration algorithm for the region2d/region2d case The Evaluation Phase for Matching Topological Predicates

7 Direct predicate characterization: a simple evaluation method The 9-intersection matrix characterization method Type combination dependent 9-intersection matrix characterization The 9-intersection matrix characterization for region/region case Optimized Evaluation Methods Matrix thinning for predicate verification Minimum cost decision tree for predicate determination Interface Methods for Topological Predicates Algorithms for Spatiotemporal Predicates The Algorithmic Scheme Time-Synchronized Interval Refinement Function-Valued Interval Refinement and Development Determination Pattern Matching with Query Predicate Algorithms for Balloon Predicates Database Integration Case Study: Application to Hurricane Research MODEL AND IMPLEMENTATION ASSESSMENT Topological Predicates: Assessment, Testing, and Performance Study Qualitative Assessment Testing Performance Study and Analysis Spatiotemporal Model Assessment CONCLUSIONS REFERENCES BIOGRAPHICAL SKETCH

8 Table LIST OF TABLES page 3-1 Operations on historical movements and future predictions of moving objects Value of the operation pointset conf (ϕ(α),β,instant) for each combination of ϕ(α) and β whether it is always 0, denoted by a value 0, or a meaningful value, denoted by a value M Operations on balloon objects and moving balloon objects Assigning naming prefixes to pairwise combinations of interactions Number of balloon predicates between balloon pp, balloon pr, and balloon rr objects Inferring the types of interaction between actual objects from the types of interaction between their predictions Static and dynamic halfsegment sequences of the regions R 1 and R 2 in Figure Possible segment class constellations between two consecutive segments in the sweep line status Summary of complete and thinned out 9IMs for the topological predicates of all type combinations MCDT pre-order representations for all type combinations on the basis of equal probability of occurrence of all topological predicates Summary of the MCDTs for all type combinations on the basis of equal probability of occurrence of all topological predicates Interval endpoint ordering

9 Figure LIST OF FIGURES page 2-1 Examples of spatial objects. A) A simple point object. B) A simple line object. C) A simple region object. D) A complex point object. E) A complex line object. F) A complex region object The 9-intersection model and topological predicates. A) The 9-intersection matrix. B) The numbers of topological predicates between two simple/complex spatial objects Examples of moving objects. A) A single-component moving point object. B) A singlecomponent moving region object. C) A multi-component moving point object. D) A multi-component moving region object Examples of spatiotemporal functions for moving points. A) Partially disappear. B) Instantly appear. C) Have instantaneous jumps. D) Have spatial outliers. Examples of spatiotemporal functions for moving regions. E) Partially disappear. F) Instantly appear. G) Have instantaneous jumps. H) An example of a spatiotemporal predicate Examples of φ-continuous temporal functions. A) simultaneous movement. B) A merging situation. C) A splitting situation. D) A combined merging and splitting situation Examples of φ-discontinuous temporal functions. A) An instantaneous jump in an mreal object. B), C) Two constellations with time instants at which the function is event-φ-discontinuous Moving point object given by a temporal function with a local minimum and a local maximum Modeling potential future positions of spatiotemporal objects. A) For a hurricane s eye at now+12 hours. B) Within the 12-hour period. C) For a vehicle at now+15 minutes. D) Within the 15-minute period. E) For a vehicle with a constant speed at now+15 minutes. F) Within the 15-minute period Representing the future prediction of a hurricane s eye using a moving region with a moving confidence distribution. The gradient indicates varied degree of confidence Examples of valid future predictions. A) A continuous fpoint object. B) A continuous fregion object. C) A discontinuous fregion object. An example of invalid future predictions. D) A dimensionally collapsed object with multiple types Example of a historical temporal domain time h that starts from and ends at t c inclusively Example of a future temporal domain time f that starts exclusively from t c and extends indefinitely towards Example of a moving balloon object of type mballoon pr

10 3-10 Examples of predictions at a time instant. A) A point-based prediction with a discrete probability distribution. B) A line-based prediction with a one-dimensional continuous distribution. C) A region-based prediction with a two-dimensional continuous distribution Relations between traditional moving object data model and balloon data model Possible relationships between parts of balloon objects A and B. A) When A s current instant is earlier. B) At the same time. C) Later than that of B s Future crossing situation between a balloon pp object P and a balloon pr object R Movement of the eye of hurricane Katrina Representations of a line object. A) In the abstract model. B) In the discrete model Representations of a region object. A) In the abstract model. B) In the discrete model A discrete representation of a moving point object. A) A temporal unit. B) A sliced representation Representing a moving line object. A) A uline value. B) A discrete representation of a moving line object Example of a uregion value Examples of the order relation on halfsegments: h 1 < h A line2d object L and a region2d object R Example of the segment classification of two region2d objects Changing overlap numbers after an intersection Splitting of segments. A) two intersecting segments. B) two partially coinciding segments (without symmetric counterparts). C) A segment whose interior is touched by another segment. Digits indicate part numbers of segments after splitting Sweep line status. A) Before the splitting (s 4 to be inserted). B) After the splitting. The vertical dashed line indicates the current position of the sweep line Algorithm for computing the topological feature vectors for two point2d objects Boundary point intersections. A) Boundary points (in black) and connector points (in grey) of a line2d object. B) A scenario where a boundary point of a line2d object exists that is unequal to all points of a point2d object. C) A scenario where this is not the case Algorithm for computing the topological feature vectors for a point2d object and a line2d object

11 5-10 Algorithm for computing the topological feature vectors for a point2d object and a region2d object Algorithm for computing the topological feature vectors for two line2d objects Algorithm for computing the topological feature vectors for a line2d object and a region2d object Special case of the plane sweep Algorithm for computing the topological feature vectors for two region2d objects The 9-intersection matrices. A) Matrix number 8 for the predicate meet between two line objects. B) Matrix number 7 for the predicate inside between two region objects Algorithm for computing the thinned out versions of the n α,β intersection matrices associated with the topological predicates between two spatial data types α and β Complete and thinned out matrices for the 5 topological predicates of the point/point case Complete and thinned out matrices for the 14 topological predicates of the point/line case Complete and thinned out matrices for the 7 topological predicates of the point/region case Complete and thinned out matrices for the 33 topological predicates of the region/region case Minimum cost decision tree algorithm Minimum cost decision trees. A) For the 5 topological predicates of the point/point case. B) For the 7 topological predicates of the point/region case. C) For the 14 topological predicates of the point/line case under the assumption that all topological predicates occur with equal probability Spatiotemporal predicate evaluator algorithm Time-synchronized refinement of two unit interval sequences: two sets of time intervals on the left side, and their refinement partition for development evaluation on the right side Time-synchronized interval refinement algorithm Next Algorithm Intersecting unit segments of two moving points representing the development Disjoint meet Disjoint and thus requiring a further interval refinement Function-valued interval refinement algorithm

12 5-29 Unit intersection algorithm Pattern matching algorithm Balloon predicate evaluator algorithm Registration of a data type and an operation in Oracle The integration of algebra in extensible DBMSs Creating a table using a user-defined type Using a user-defined function in SQL query Visualization of hurricane Katrina using the Moving Balloon Algebra Visualizing hurricane Katrina. A) Katrina s prediction #7 in object-based perspectives. B) Temporal analysis perspective on August 27, 2005 at 12:00 GMT Hurricane analysis. A) Hurricane prediction analysis between 2003 and B) Hurricane Kate (#1312). C) Hurricane Lisa (#1329) Predicate verification without and with matrix thinning Predicate determination without and with MCDT

13 Abstract of Dissertation Presented to the Graduate School of the University of Florida in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy MOVING BALLOON ALGEBRA: DESIGN, IMPLEMENTATION, AND DATABASE INTEGRATION OF A SPATIOTEMPORAL DATA MODEL FOR HISTORICAL AND PREDICTIVE MOVING OBJECTS Chair: Markus Schneider Major: Computer Engineering By Reasey Praing August 2008 Spatiotemporal databases deal with geometries changing over time. Recently, moving objects like moving points and moving regions have been the focus of research. They represent time-dependent geometries that continuously change their location and/or extent and are interesting for many disciplines including the geosciences, geographical information science, moving objects databases, location-based services, robotics, and mobile computing. So far, a few moving object data models and query languages have been proposed. Each of them supports either exclusively historical movements relating to the past or exclusively predicted movements relating to the future. Thus, the query support for each model is limited by the type of supported movements. This presents a problem in modeling the dynamic nature of a moving object when both its known historical movement and its predicted future movement are desired to be simultaneously managed and made available for spatiotemporal operations and queries. Furthermore, current definitions of moving objects are too general and rather vague. It is unclear how a moving object is allowed to move or evolve through space and time. That is, the properties of movement (like its continuity) have not been precisely specified. It is also unclear how, in a database context, future predictions of a moving object can be modeled taking into account the inherent uncertainty of future evolution. Moreover, implementations of spatiotemporal data types and operations are rare and their integration into extensible database management systems 13

14 has been so far nonexistent. In this research, we present a new type system and query language called Moving Balloon Algebra consisting of a moving object model that is able to represent the dynamic nature of moving objects while providing integrated and seamless support for both historical and predicted movements of moving objects. The goal is to go beyond existing moving object models by collectively integrating existing functionalities as well as introducing new ones. From a conceptual standpoint, this algebra provides a formal definition of novel spatiotemporal data types, operations, and predicates as well as introduces new types of spatiotemporal queries. Beside these conceptual contributions, an implementation of the algebra is provided in the form of a database-independent type system library, and its integration into a relational database management system is demonstrated. 14

15 CHAPTER 1 INTRODUCTION 1.1 Motivation Within the past decades, we have seen significant changes in computing technology. One of the most apparent changes is the propagation of computing from the stationary desktop environment to the mobile outdoors. This revolutionary development has enabled many important types of emerging applications including global positioning services, location-based services, tracking systems, fleet management, and air traffic control. The property that these applications have in common is that they all deal with objects that change their positions and/or extent over time; they are commonly known as moving objects. The importance of moving objects in these emerging applications has generated a lot of research interest across many disciplines including the geosciences, geographical information science (GIS), artificial intelligence, robotics, and mobile computing. Much of the research has also focused on modeling and managing moving objects in database systems; these systems are termed moving objects database systems (MODS) and are special instances of spatiotemporal database systems (STDBS). 1.2 Problem Statement Although some important results have already been achieved with respect to the modeling and management of moving objects in databases, the current state of the art still reveals a number of shortcomings both at the conceptual and the implementation levels. At the conceptual level, we have identified three main problems. The first problem concerns an appropriate modeling of movement itself. Most approaches model moving objects as functions from time to some non-temporal data type. For example, temperature curves are modeled as functions from time to the real numbers. This concept is very useful since it can be used to define a type constructor to construct temporally dependent data types from non-temporal data types. For example, spatiotemporal data types such as moving point, moving line and moving region can be constructed from the spatial data types point, line, and region respectively. However, these temporal functions should not be arbitrary but appropriately restricted so that they accurately 15

16 and realistically represent the behavior of moving objects in the real world. For example, the continuity property of movements must be specified such that an unrealistic behavior like instantaneous, positional jumps are not allowed in the model. Unfortunately, restrictions like this have been so far neglected in existing moving objects models. The second problem relates to the modeling of predictive movements of moving objects. A few specialized models have been proposed to support queries regarding future predictions of moving objects. However, these models are restricted to moving points only and are tailored to specific application domains and fixed prediction methods. All models anticipate future object movements through certain assumptions on the objects inertia, trajectories, and environmental or contextual constraints. Their prediction methods are almost always entirely based on the past and current movements of the objects, thus neglecting external factors or domain-specific parameters which may significantly affect the future movements of moving objects. For instance, information such as atmospheric pressures, temperature zones, wind and ocean currents plays a major role in predicting the future evolution of a hurricane. This requires highly specialized and sophisticated prediction models and algorithms beyond those in which only the past and current object movements are considered as system parameters. In fact, the development effort for such prediction models is a discipline by itself and a task of domain experts. In addition, different application domains may require different prediction models. For example, to predict the future spread of a forest fire, one may consider a different set of parameters such as the volume of fire fuel (for example, dry brush), surface slope, and the capability of responsive actions from firefighters in addition to atmospheric conditions such as wind and humidity. Thus, it is impossible to define a one-size-fits-all prediction model for all applications. However, we can assume that the nature of the outputs of different prediction models is the same, or at least very similar. Such an output consists of a description of a predicted movement as well as a measure of confidence (for example, probability, fuzziness, roughness) expressing the reliability of the prediction. We can represent the predicted movement through spatiotemporal data types. We do not see it as the capability and the task of a database system to predict the future movement of 16

17 a moving object. Hence, it is reasonable to emphasize the needed separation between moving object models in databases and domain specific prediction models. Existing models inseparably interlace both aspects with each other, are only able to deal with a specific problem area or object motion, and lack the ability of a general treatment of predicted movement. The third problem is the lack of an integrated, seamless, and unified model that can simultaneously represent the historical and the future movements of a moving object in databases. At a time instant t, a moving object does not only have a history of its movement up to its state at t but it can also have a future prediction starting at t. So far, existing models support either historical movements or future movements only but not both together. But modeling the past and future movements of an object requires both concepts. This means that special attention is needed to accommodate both concepts in a single model so that they can be applied to the same object without conflicting each other and so that spatiotemporal operations and predicates on moving objects can be applied to the entire temporal domain. At the implementation level, implementations of spatiotemporal data types are rare and are generally done as part of research prototype database systems. A general problem is that many useful concepts and their implementations in such research prototypes, which are tailor-made for a certain problem area and utilize a specialized infrastructure, cannot be easily transferred to commonly used commercial database management systems (CDBMS). Therefore, these implementations and the prototypes offering them do not find an adequate appreciation due to their incompatibility with commonly used CDBMS. This effectively limits the accessibility and usability of such implementations. To address this problem, an implementation of spatiotemporal data types and operations must be database-independent and at the same time can be integrated into any extensible DBMS through its extensibility mechanism. 1.3 Goals and Solutions The goal of this research is to solve these currently existing problems by introducing a new concept called Moving Balloon Algebra (MBA) to support both historical and future movements of moving objects in a homogeneous and integrated model. This algebra or type 17

18 system incorporates a complete framework of abstract data types for historical and predictive moving objects and provides a precise and conceptually clean foundation for their representation and querying. In such a framework, the definitions of the structure of entities (for example, the values of spatial data types) and of the semantics of operations can be given at different levels of abstraction. For example, the trajectory of a moving point can be described either as a smooth curve or as a polyline (a set of singly connected line segments) in the two-dimensional space. In the first case, a curve is defined as a (special) infinite set of points in the plane without fixing any finite representation. In the second case, a polyline determines a specific finite representation, which finitely approximates the infinite point set making up the trajectory of the moving point. We distinguish these two kinds of design and call them abstract and discrete modeling respectively (for a more detailed discussion, see [19]). Basically, the advantage of the abstract level is that it focuses on the essence of the problem, is conceptually clean and simple, and is not impeded by computer-specific constraints resulting from the finiteness of computer systems. The advantage of the discrete level is that its finite representations are defined by taking into account the limitation of computer systems while maintaining the conceptual constraints set forth by the abstract model. In general, several finite representations are possible for the same abstract concept. For example, curves could also be represented as splines at the discrete level. Another design level also exists called implementation level. In this level of modeling, specific data structures and algorithms can be defined based on the finite representation set forth by the discrete model. For example, data structures such as arrays or lists of line segments may be used to implement the polyline representation of curves, and algorithms such as the plane sweep algorithm or other segment intersection algorithms can be used to implement operations between polylines. The design of the Moving Balloon Algebra described in this research is presented at each of these three abstraction levels. The Moving Balloon Algebra is based on the metaphor of a balloon to model our knowledge of a moving object at a specific time instant: the string and the body of a balloon object represent the known past movement and the predicted future movement of a moving object respectively. 18

19 For example, the movement of the eye of a hurricane is usually illustrated using a shape that resembles a balloon. The past movement of the eye (a moving point) can be seen over time as a movement along a line or a curve which resembles the string of a balloon. The position of the eye at a time instant in the future can be anywhere within an area of uncertainty. Thus, the future prediction of the eye can be seen as a moving region of uncertainty that resembles the body of a balloon. Finally, the connection point between the string and the body of a balloon object at a time t represents the state of the moving object at t. Hence, a balloon object is static in the sense that it represents the knowledge about the past and the predicted movements of a moving object at a time t. As the object moves, a new present state is recorded as part of the string, and the body of the balloon object is updated with a new prediction. This dynamic is represented by a moving balloon object. The corresponding abstract data types may be used as attribute types in relational, object-relational, or object-oriented DBMS. With this model, we solve the first two conceptual problems by providing a precise and formal definition of moving (balloon) objects along with appropriate specifications of the properties of their movements. We solve the third conceptual problem by seamlessly modeling the dynamic of both the past (as facts) and the future (as predictions) through balloon objects. Beside already available concepts that we intend to preserve and refine (like the approaches in [22, 32]), we introduce new functionality such as the ability to analyze the accuracy of predictions over time. We also offer an interface for cooperating with specific (for example, probabilistic, fuzzy) prediction models for moving objects. Finally, we address the implementation problem by designing an implementation model of the Moving Balloon Algebra that can be used to implement the algebra as a type system library which can be integrated into an extensible DBMS. In this research, we are mainly interested in the fundamental models, semantics, and their implementations in databases. Other optimization and filtering concepts such as spatiotemporal indexing techniques are beyond the scope of this research. 19

20 CHAPTER 2 RELATED WORK Besides the concept of time, spatial objects form the conceptual foundation of moving objects. We summarize the state of the art of spatial data modeling and sketch the relevant concepts of spatial data types and topological predicates in Section 2.1. Then, in Section 2.2, we delineate the state of the art of spatiotemporal data modeling and present the important concepts of spatiotemporal data types and spatiotemporal predicates. In Section 2.3, we discuss current implementation aspects of spatial and spatiotemporal data types. Finally, in Section 2.4, we explore the current integration of such implementation in database systems. 2.1 Spatial Data Modeling Research on spatial data modeling has received a lot of interest in the past fifteen years due to the fact that it is the foundation for many research directions in spatial and spatiotemporal databases as well as GIS. We address the different types of spatial objects and the topological relationships between these objects Spatial Objects The development of data models for spatial data can be subdivided into two generations of models. The first generation offers simple object structures like single points, continuous lines, and simple regions (Figure 2-1A-C) [12, 29, 48]. Since these simple geometric structures are unable to represent the variety and complexity of geographic phenomena, the second generation of data models provides more expressive representations of spatial objects that allow support for multi-component objects as well as objects with holes [5, 44, 59, 62]. They are represented by complex spatial data types for complex points, complex lines, and complex regions (Figure 2-1D- F). Their formal definition can, for example, be found in [59]. Informally, a complex point object is a finite set of single points. A complex line is defined as an infinite point set that structurally consists of a finite set of blocks. Each block contains a finite number of simple lines. A complex region is defined as an infinite point set that structurally consists of a finite set of faces. Each face has an outer simple region and contains a finite set of disjoint simple regions called holes. 20

21 A B C D E F Figure 2-1. Examples of spatial objects. A) A simple point object. B) A simple line object. C) A simple region object. D) A complex point object. E) A complex line object. F) A complex region object. The object definition of each spatial data type distinguishes three components: the interior, boundary, and exterior. For example, the boundary of a line object consists of its endpoints. Its interior consists of the line part that connects the endpoints. The exterior of a line object consists of all points of the plane that are not part of the interior or boundary. The boundary of a region object is the line object defining its border. The interior of a region object consists of all points enclosed by the border. The exterior contains all points that are neither part of the boundary nor the interior. These concepts, which are formally defined in [59], are leveraged for the modeling of topological relationships discussed in the next subsection as well as the interactions of predicted moving objects described in Section We use this complex spatial data model as the basis for our Moving Balloon Algebra due to its expressiveness of representation and its closure property under spatial operations Topological Relationships Topological relationships like overlap, disjoint, or inside refer to qualitative descriptions of the relative positions of two spatial objects and are preserved under affine transformations such as translation, rotation, and scaling. Quantitative measures such as distance or size measurements are excluded in favor of modeling qualitative notions such as connectivity, adjacency, disjointedness, inclusion, and exclusion. Some of the well known topological relationships models are the RCC model [56] based on spatial logic and the 9-intersection model [13, 15] based on point set topology. The 9-intersection model defines topological relationships based on the nine possible intersections of the boundary ( A), the interior (A ), and the exterior (A ) of a spatial object A with the corresponding components of another object B. Each intersection is tested with regard to 21

22 the topologically invariant criteria of non-emptiness. The topological relationship between two spatial objects A and B can be expressed by evaluating the 3 3-matrix in Figure 2-2A. Topological relationships have been first investigated for simple spatial objects (Figure 2-2B), that is, for two simple regions (disjoint, meet, overlap, equal, inside, contains, covers, coveredby) [9, 14], for two simple lines [7, 15], and for a simple line and a simple region [16]. Topological predicates involving simple points are trivial. The two works in [8] and [17] are the first but restricted attempts to a definition of topological relationships on complex spatial objects. In [8], the TRCR (Topological Relationships for Composite Regions) model only allows sets of disjoint, simple regions without holes. Topological relationships between these composite regions are defined in an ad hoc manner and are not systematically derived from the underlying model. The work in [17] only considers topological relationships of simple regions with holes; multi-part regions are not permitted. A main problem of this approach is its dependence on the number of holes of the operand objects. The work in [59], with two precursors in [2] and [58], gives a thorough, systematic, and complete specification of topological relationships for all combinations of complex spatial data types. Details about the determination process and prototypical drawings of spatial scenarios visualizing all topological relationships can be found in these publications. This approach, which is also based on the 9-intersection model, is the basis of our topological predicate implementation in Section 5.2. Figure 2-2B shows the increase of topological predicates for complex objects A B A B A B A B A B A B A B A B A B A point line region point 2/5 3/14 3/7 line 3/14 33/82 19/43 region 3/7 19/43 8/33 B Figure 2-2. The 9-intersection model and topological predicates. A) The 9-intersection matrix. B) The numbers of topological predicates between two simple/complex spatial objects. 22

23 compared to simple objects and underpins the need for sophisticated and efficient predicate execution techniques. 2.2 Spatiotemporal Data Modeling Within the past decade, a number of spatiotemporal data models have been proposed [49]. Among them, a few moving object models have been recently designed that are of significant interest for many new emerging applications [34]. Moving object models can be distinguished with respect to the type of movement they support. In Section 2.2.1, we first discuss an existing moving object model and a corresponding spatiotemporal predicate (STP) model that support the past evolution of moving objects. Then, in Section 2.2.2, we take a look at a number of data models as well as STP models that support specific types of near future developments of moving objects Historical Movements of Moving Objects An approach to represent the past movement of moving objects is proposed in [32, 61]. The past development is a historical fact that is modeled as a function from time to space [18, 25]. For an arbitrary non-temporal data type α, its corresponding temporal data type is provided by a type constructor τ(α) which is a function type that maps from the temporal domain time to α, that is, τ(α) = time α. By applying the type constructor τ to the spatial data types point, line, and region, we obtain the corresponding spatiotemporal data types named mpoint for moving points, mline for moving lines, and mregion for moving regions [19]: mpoint = τ(point) = time point mline = τ(line) = time line mregion = τ(region) = time region A moving object, in general, yields a complex (that is, possibly multi-component) spatial object (Section 2.1.1) at each time instant at which it is defined; a single-component spatial object as a function value at a time instant is thus a special case. Figures 2-3A and 2-3B show single-component moving point and moving region objects respectively while Figures 2-3C and 23

24 time time time time y y y y x x A B C D x x Figure 2-3. Examples of moving objects. A) A single-component moving point object. B) A single-component moving region object. C) A multi-component moving point object. D) A multi-component moving region object. 2-3D illustrate corresponding multi-component objects. An application example for Figure 2-3D is a brush fire that originates at different locations at different times. The type constructor τ is defined in a very general way and allows any kind of temporal function. For instance, we could define a function that maps each time instant represented by a rational number to the point (1,1) and each time instant represented by an irrational number to the point (2,2). However, this does not describe movement, and hence the question is which spatiotemporal functions represent valid movements. For example, the unrestricted definition of τ also allows a moving point to move continuously (Figures 2-3A, 2-3B), disappear for periods of time (Figure 2-4A, 2-4E), appear instantly (Figures 2-4B, 2-4F), have spatial outliers (Figure 2-4D), or have instantaneous jumps (Figures 2-4C, 2-4G). A definition is missing that precisely states which spatiotemporal functions represent allowed movements and which functions do not conform to our intuitive understanding of movement. Furthermore, this approach does not support future predictions of moving objects. In our model, we employ a similar approach of using a type constructor to construct spatiotemporal types for representing historical movements of moving objects. However, we take the extra step of precisely specifying the properties of object movements as well as describing how an object moves and evolves in the past and how its future predicted movement and extension can be represented. Based on the moving objects model just described, the STP model presented in [22] provides spatiotemporal predicates for past movements and is able to characterize the temporal 24

25 development and change of the topological relationship between spatial objects evolving over time. A spatiotemporal predicate stp(a,b) between two moving objects a of type τ(α) and b of type τ(β) is defined as an alternating sequence of topological predicates that only hold for a period of time (period predicates) and that can hold for an instant of time (instant predicates). For example, consider a predicate Cross that checks whether a moving point (for example, an airplane) crosses a moving region (for example, a hurricane). Such a predicate can be defined as Cross := Disjoint meet Inside meet Disjoint where Disjoint and Inside are period predicates, meet is an instant predicate, and the symbol is a temporal composition operator and signifies a development or a temporal change of relationship. Figure 2-4H depicts the spatiotemporal predicate Cross. In other words, a spatiotemporal predicate between two moving objects is a temporal composition of period and instant predicates between the two objects. The STP model is only able to capture the temporal development of topological relationships between historical moving objects. But it is unable to represent the uncertainty of the topological relationships between predicted moving objects as well as the combination of past and future developments of topological relationships Predictive Movements of Moving Objects With regard to the future movement of moving objects, current models are restricted to specific types of motion. The MOST model [60], which is based on the concept of motion vector, is able to represent near future developments of moving objects through the assumption on the objects inertia that the current motion direction does not change in the near future. Although this model is able to represent the near future movement of a moving object, the predicted movement is limited to a single motion concept that cannot be modified. The aspect of uncertainty such as the probability of occurrence is not part of the model. Other models are able to capture the uncertainty aspect of future movements through the use of a trajectory or motion plan with a constant [26] or variable uncertainty threshold [43]. The approach in [38] makes use of a concept called space-time prism to model the uncertainty of movement between known states of an object s trajectory with certain assumptions on the object s velocity. Another approach presented 25

26 time time time time y y y y time x x A B C D time time x time x Disjoint meet y y y Inside meet Disjoint y x x E F G H x x Figure 2-4. Examples of spatiotemporal functions for moving points. A) Partially disappear. B) Instantly appear. C) Have instantaneous jumps. D) Have spatial outliers. Examples of spatiotemporal functions for moving regions. E) Partially disappear. F) Instantly appear. G) Have instantaneous jumps. H) An example of a spatiotemporal predicate. in [36] models and predicts future movements of moving objects in a constrained network environment. It is important to note that an aspect which all of these models have in common is that either they try to predict the future movement by assuming a specific prediction technique or they are designed to handle a specific type of motion only. As emphasized in the Introduction, the goal of our effort here is not about how to predict a specific type of movement but about how to provide general purpose data model support for movements (including future predictions) in databases. With regard to the modeling of spatiotemporal predicates for future predictions, the model presented in [26] captures the uncertainty aspect of the future topological relationship between a moving point and a static region. The future movement of a moving point is defined by a future motion plan or trajectory and a threshold value signifying an acceptable deviation of the actual movement from the trajectory. The application of a threshold around a future trajectory creates a trajectory volume which represents the set of all possible future motion curves. A spatiotemporal predicate (for example, sometimes inside) is then defined based on the topological relationship 26

27 (for example, inside) between the spatial projection of such a trajectory volume and a static region. Depending on this relationship, the uncertainty of a future spatiotemporal predicate can be captured and represented by using any combination of the prefixes sometimes, always, possibly, and definitely. While this model is able to model future spatiotemporal predicates to a certain extent, it is limited to only those relationships between a moving point and a static region. In contrast, our spatiotemporal predicate model is a general model which supports both the past and future relationships between any combination of spatiotemporal data types. 2.3 Implementation Aspects of Spatial and Spatiotemporal Data Models As far as spatial data model is concerned, so far only a few models have been developed for complex spatial objects. The works by [6, 30, 31, 59, 62] are the only formal approaches; they all share the same, main structural features. The OpenGIS Consortium (OGC) has proposed similar geometric structures called simple features in its OGC Abstract Specification [45] and in its Geography Markup Language (GML) [46], which is an XML encoding for the transport and storage of geographic information. These geometric structures are described informally and are called MultiPoint, MultiLineString, and MultiPolygon. Another similar but also informally described spatial data type specification is provided by ESRI s Spatial Database Engine (ArcSDE) [24]. Further, database vendors have added spatial extension packages that include spatial data types through extensibility mechanisms to their database systems. Examples are the Informix Geodetic DataBlade [35], the Oracle Spatial Cartridge [47], and DB2 s Spatial Extender [11]. These implementations offer limited sets of named topological predicates for simple and complex spatial objects. But their definitions are unclear and their underlying algorithms unpublished. The open source JTS Topology Suite [37] conforms to the simple features specification [45] of the Open GIS Consortium and implements the aforementioned eight topological predicates for complex spatial objects through topology graphs. A topology graph stores topology explicitly and contains labeled nodes and edges corresponding to the endpoints and segments of a spatial object s geometry. For each node and edge of a spatial object, one determines whether it is located in the interior, in the exterior, or on the boundary of another 27

28 spatial object. Computing the topology graphs and deriving the 9-intersection matrix from them require quadratic time and quadratic space in terms of the nodes and edges of the two operand objects. This is rather inefficient and thus is not suitable for supporting the implementation of high-level predicates such as spatiotemporal predicates. In Section 5.2, we prodive our solution for an efficient implementation of topological predicates on complex spatial objects which requires linearithmic (loglinear) time and linear space. Unlike those of spatial data models, implementations of spatiotemporal data models are very rare and, in most cases, only exist in the form of research prototypes. An example of such an implementation can be found as part of the SECONDO prototype system [4]. The spatiotemporal module of SECONDO is developed based on the approach in [32, 61, 18, 25] which only supports the past movement of moving objects. However, our main interest here is on the modeling and implementation of a moving object algebra which can support both the past and predicted movements of moving objects. 2.4 Database Integration Beside the conceptual modeling and implementation of spatial and spatiotemporal algebra, an important yet often neglected aspect of algebra development is the ability to integrate such algebra into a variety of (extensible) DBMSs. Most of the existing implementations of spatial and spatiotemporal data models are either database-incompatible (for example, JTS Topology Suite) or database-specific (for example, Informix Geodetic DataBlade, Oracle Spatial Cartridge, DB2 s Spatial Extender, SECONDO spatiotemporal module). These database-specific implementations are inflexible in the sense that users data must be stored in the corresponding DBMS. This is generally a proprietary issue on the part of database vendors or, in the case of SECONDO, a design decision. It does not necessarily suggest any required storage dependency on the part of the algebra. In fact, an implementation of an algebra can and should be storage-independent. An attempt to address this problem and to make more flexible use of a spatial algebra can be seen in the case of the ESRI s Spatial Database Engine which provides support for data storage in a number of DBMSs including Oracle, DB2, and SQL Server. However, their proprietary 28

29 database integration mechanism is not published. As part of this research, we aim at providing an implementation of the Moving Balloon Algebra which is storage-independent and describing a mechanism for integrating the algebra into any extensible DBMS (Section 5.5). 29

30 CHAPTER 3 ABSTRACT MODEL OF THE MOVING BALLOON ALGEBRA In this chapter, we describe the abstract model which is the highest level of abstraction of the Moving Balloon Algebra 1. Here, we specifically focus on the essence of the conceptual modeling problem without impeded by any representation constraint. We present the abstract model by first describing how we can model and specify corresponding data types for historical and predicted movements taking into account the continuity property of movement and the inherent uncertainty of predicted movement. These concepts are then used to define highlevel data types for our algebra. This includes the introduction of balloon objects to represent snapshots of the knowledge of movement and the concept of a moving balloon object to model the continuous stream of these snapshots over time. Next, we present operations on the Moving Balloon Algebra followed by our spatiotemporal predicate model. Finally, we describe how our algebra can be used in different types of spatiotemporal queries. 3.1 Modeling Historical and Predicted Movements In this section, we specify the characteristic features of spatial object movement and deal with the problem of handling past and future movements in a database context. In Section 3.1.1, we describe how spatial objects can move by identifying some fundamental properties of movement. Especially, we define what continuous movement of a spatial object means. The knowledge gained from this section enables us in Section to directly derive (abstract) data types for historical movements of moving objects. Modeling future movement means dealing with the future and is inherently afflicted with the feature of uncertainty. In Section 3.1.3, we present our view of this problem in a database context and present (abstract) data types for predicted movements as a solution. All these concepts will be used in Section 3.2 to model 1 The research work in this chapter has been included in one of our technical reports [53] in preparation for a journal submission. 30

31 balloon objects and eventually moving balloon objects for representing the dynamic development of moving objects that potentially extend from the past into the future Continuity of Movement Fundamental properties of movement and evolution are continuous location change, continuous growing, and continuous shrinking of moving objects as well as the appearing, disappearing, splitting, and merging of moving object components. Modeling these aspects requires a concept of time and space. Since we are interested in continuously changing objects, we define our data type time as isomorphic to the set R of real numbers. A special temporal variable now keeps the permanently changing present time. In regard to space, we consider the two-dimensional Euclidean space R 2. Thus, we concern about moving objects describing the development of two-dimensional spatial objects over time. We further take into account that spatial data types also include the empty object ( ) which represents the nonexistence of a spatial object [59]. We can, for example, then express that the intersection of two disjoint region objects is the empty region object. To model the change of objects over time, we adopt our own modeling approach from [19, 22, 32] and define a temporally changing entity as a function over time. That is, we model values of a nontemporal type α that change over time as a function of type τ(α) = time α τ is a type constructor that constructs the temporal counterpart for a given nontemporal data type. Type τ(α) then denotes all functions from time to α. We call an element of τ(α) a temporal function or a temporal object. In case that α = real holds, τ(real) denotes a data type for temporal real numbers. These can, for example, be used to represent temperature curves. Similarly, we obtain data types for temporal Booleans, temporal integers, and temporal strings. If α {point,line,region}, we obtain spatiotemporal data types for moving points, moving lines, and moving regions. That is, we denote (spatial) change over time as movement. We also name all mentioned types mbool, mint, mstring, mreal, mpoint, mline, and mregion respectively. 31

32 Temporal functions should not be arbitrary since they do not necessarily adequately model change or movement. A first observation is that temporal objects can disappear or (re)appear. Hence, temporal functions are, in principle, partial functions. However, we prefer that they yield a value at each time. Therefore, we supplement them to total functions in the following way. We say that f τ(α) is defined at time t if f (t), and we define the domain of f as dom( f ) = {t time f (t) }. Further, if f is undefined at time t, we set f (t) :=. This allows us to comfortably model situations where temporal objects (re)appear ( f (t) ) or disappear ( f (t) = ). A second observation is that temporal objects can show a continuous evolution. For moving spatial objects, continuity is even the essential feature. Continuous evolution can, in general, be described by a continuous function for which, intuitively, small changes in the input result in small changes in the output. This leads us to the question how the change between two nonspatial objects, that is, between two Boolean values, two integer numbers, and two real numbers, can be specified, and, much more interestingly, how the change between two spatial objects, that is, between two points, two lines, and two regions, can be characterized in the Euclidean space. Each characterization should also capture discrete changes. For this purpose, Definition 3.1 introduces a dissimilarity measure φ for each data type. Definition 3.1 : Let dist(p,q) denote the Euclidean distance between two single points p and q, and let dist(p,q) be the distance from p to the closest point in a point object Q. Let length(l) return the length of a line object L, and let area(r) return the area of a region object R. For any type α {bool, int, string, real, point, line, region}, a dissimilarity measure φ : α α R is defined as follows: 32

33 0 if x = y (i) x,y α {bool,int,string},x,y : φ(x,y) = 1 otherwise (ii) x,y α = real,x,y : φ(x,y) = x y (iii) P 1,P 2 α = point,p 1,P 2 : φ(p 1,P 2 ) = p P 1 \P 2 dist(p,p 2 )+ p P 2 \P 1 dist(p,p 1 ) (iv) L 1,L 2 α = line,l 1,L 2 : φ(l 1,L 2 ) = length(l 1 \L 2 )+ length(l 2 \L 1 ) (v) R 1,R 2 α = region,r 1,R 2 : φ(r 1,R 2 ) = area(r 1 \R 2 )+ area(r 2 \R 1 ) Next, by leveraging this notion of dissimilarity, we specify the concept of a limit of a temporal function f at a time instant t. A one-sided or two-sided limit can only be defined if a one-sided or two-sided time interval belongs to dom( f ). Therefore, in Definition 3.2, we specify two predicates dfb and dft that check whether f is defined at t from the bottom and from the top respectively. Definition 3.2 : Let R + = {r R r > 0}, α {bool,int,string,real,point,line,region}, f τ(α) = time α, and t time. (i) dfb( f,t) := ε R + 0 < δ < ε : f (t δ) (ii) dft( f,t) := ε R + 0 < δ < ε : f (t + δ) Definition 3.3 now determines the limit of a temporal function f at a time instant t. t time. Definition 3.3 : Let α {bool,int,string,real,point,line,region}, f τ(α) = time α, and 33

34 (i) We say the limit from the bottom of f at t is L, and write lim φ δ 0 f (t δ) = L if, and only if, dfb( f,t) γ R + ε R + 0 < δ < ε : φ( f (t δ),l) < γ (ii) We say the limit from the top of f at t is L, and write lim φ δ 0 f (t + δ) = L if, and only if, dft( f,t) γ R + ε R + 0 < δ < ε : φ( f (t + δ),l) < γ (iii) We say the limit of f at t is L, and write lim φ δ 0 f (t ± δ) = L if, and only if, lim φ δ 0 f (t δ) = limφ δ 0 f (t + δ) = L Note that f does not have to be defined at t and that the limit specifications require the existence of a one-sided or two-sided time interval for which f is defined. Based on the concept of limit, we are now able to approach a definition of continuity for a temporal object at a time instant. For temporal objects based on a non-spatial data type, the notion of continuity is quite standard. These objects have the feature that, at each time instant of their domain, we obtain a single value (like a single string value or a single integer value) that evolves over time. For temporal objects based on the three (discrete) types bool, int, and string, we can immediately conclude that there are no continuous changes possible since a smooth transition is impossible. Either their values are stepwise constant for some time, or a discontinuity occurs whenever a value changes. For real numbers, we apply the classical definition of real-valued continuous functions. If a temporal object f based on any non-spatial data type has a jump discontinuity at a time instant t, we assume that the function value f (t) = lim φ δ 0 f (t + δ). Thus, f (t) lim φ δ 0 f (t δ). Figure 3-2A gives an example of this situation. The dashed line at time t represents an instantaneous jump and connects the movement before and after the jump. The hollow circle indicates that this is not the function value at time t; it is given by the full circle. The situation is different for temporal objects based on spatial data types, that is, for moving (spatial) objects. At each time instant of its domain, a moving object may include multiple simple spatial values. A point object may consist of several single points, a line object may include several blocks, and a region object may incorporate several faces (Section 2.1.1). This can, for example, be illustrated with Figure 2-3C in which any plane parallel to the (x,y)-plane and between the two dashed lines intersects the moving point object in a set of one, two, or three 34

35 points; each set forms a point object. Similarly, in Figure 2-3D, a plane parallel to the (x,y)-plane between the two upper dashed lines intersects the moving region object in a set of two faces making up a region object. The multiple simple values of a moving object at a time instant may move simultaneously over time, stay separate from each other, interact, coincide, merge, split, partially stop to exist, or partially start to exist. The goal of the following definitions is to allow these different behaviors. In Definition 3.4, we specify the important concept of continuity at a time instant for a moving object. It rests on the limit concept of Definition 3.3. Definition 3.4 : Let α {point,line,region}, f τ(α) = time α, t time, and f (t). Then (i) (ii) (iii) (iv) f is φ-continuous from the bottom at t if, and only if, lim φ δ 0 f (t δ) = f (t) f is φ-continuous from the top at t if, and only if, lim φ δ 0 f (t + δ) = f (t) f is φ-continuous at t if, and only if, lim φ δ 0 f (t ± δ) = f (t) f is φ-discontinuous at t if, and only if, f is not φ-continuous at t time time time time y y y y x x A B C D x x Figure 3-1. Examples of φ-continuous temporal functions. A) simultaneous movement. B) A merging situation. C) A splitting situation. D) A combined merging and splitting situation. This definition implies, for example, that the moving objects in Figure 2-3A and Figure 2-3B are φ-continuous on the open intervals indicated by the dashed lines. They are φ- discontinuous at the time interval endpoints since they are φ-continuous from the top at the lower endpoints, and φ-continuous from the bottom at the upper endpoints. We find similar situations 35

36 in Figure 3-1A (simultaneous movement), 3-1B (a merging situation), 3-1C (a splitting situation), and 3-1D (a combined merging and splitting situation) which also satisfy the property of φ-continuity in the open time intervals and φ-discontinuity in the time interval endpoints. Note that in Figure 3-1D, the moving point object is φ-continuous at the time instant when its two components intersect. time time t 4 t 3 time t t t 2 y y real t 1 A B C x x Figure 3-2. Examples of φ-discontinuous temporal functions. A) An instantaneous jump in an mreal object. B), C) Two constellations with time instants at which the function is event-φ-discontinuous. The discontinuities at the time interval endpoints are allowed and are examples of topological events. They arise here since the moving objects are undefined outside these time intervals. Another view is that components of a moving object start to exist at lower interval endpoints and cease to exist at upper interval endpoints. Discontinuities can also be found in Figures 2-3C and 2-3D as well as in Figures 2-4A to G. Surprisingly, most discontinuities describe a meaningful and thus correct temporal behavior of moving objects and have to be permitted. The reason is that multiple simple spatial values of the same moving object may evolve independently. Intuitively, a topological event arises in Figures 2-3C and 2-3D when the number of basic simple values changes at a time instant. Figures 3-2B and 3-2C illustrate this in more detail. The moving object in Figure 3-2B is φ-continuous from the top but not from the bottom at t 1 (change from zero to one component) and t 2 (change from one to two components) as well as φ-continuous from the bottom but not from the top at t 3 (change from two to one component) and t 4 (change from one to zero components). Figure 3-2C shows a case when a moving object is neither φ-continuous from the top nor from the bottom at a time instant t (change from two components before t to 36

37 three components at t to two components after t). Figures 2-4A and 2-4E represent moving objects that are alternately continuous and discontinuous on disjoint time intervals, that is, they are represented by partial functions. Figures 2-4B and 2-4F illustrate the case of an instantly appearing moving object with isolated (time, spatial object) pairs. We allow this kind of discontinuity although it is debatable whether a moving object can exist at a time instant only. Our main motivation to allow this situation consists in desired closure properties of spatiotemporal operations. If, for example, two moving point objects intersect in a single point at a time t, we would like to be able to represent the intersection result as a moving point object. Similarly, a time-slice operation should be able to yield a region object at time t as a moving region object. We also permit the cases in Figures 2-4C and 2-4G as valid moving objects. The reason is that instantaneous jumps can also be interpreted as the termination of one component and the emergence of another component at the same time instant. Figure 2-4G also shows two interesting situations where the bottom region of an upper component is located in the top region of a lower adjacent component. The function value at such a time instant is the larger region. Again, it is doubtful whether such an instantaneous shrinking (or growing) can happen in spatial reality but closure properties require the acceptance of such situations. A union of three moving region objects, each representing one of the three components, leads to the moving region in Figure 2-4G. We denote all aforementioned situations of permitted discontinuous topological events as event-φ-discontinuous. A situation we do not allow is a spatial outlier at a time instant t as in Figure 2-4D. It is given by a temporal function that does not represent a realistic movement since intuitively it deviates from its general route and returns to it for a time instant only. Definition 3.5 provides the full definition of event-φ-discontinuity. Definition 3.5 : Let α {point,line,region}, f τ(α) = time α, t time, and f (t). Further, let l = lim φ δ 0 f (t δ) if it exists, and let u = limφ δ 0 f (t + δ) if it exists. Then f is event-φ-discontinuous at t if one of the following conditions holds: 37

38 (i) dfb( f,t) dft( f,t) (ii) dfb( f,t) dft( f,t) u f (t) (iii) dfb( f,t) dft( f,t) l f (t) (iv) dfb( f,t) dft( f,t) u l u l f (t) (v) dfb( f,t) dft( f,t) u = l u f (t) Definition 3.5(i) means that f is isolated at t. Definitions 3.5(ii) and (iii) prevent a spatial outlier at an end point t of a time interval of the domain of f. In both cases, the limit must be part of the function value at t. If a spatial outlier occurs in the middle of a time interval, we have to distinguish two cases. If the limits from the top and from the bottom are different, they must be part of or equal to the function value at time t (Definition 3.5(iv)). If the limits are equal, the common limit must be properly contained in f (t) since equality would mean φ-continuity at t in contrast to our assumption (Definition 3.5(v)). time t 2 t 1 y Figure 3-3. Moving point object given by a temporal function with a local minimum and a local maximum. x An interesting observation is that the property of monotonicity with respect to the time axis does not play a role for the definition of movement. The reason is that complex (and not simple) spatial objects are the basis of constructing moving objects. Figure 3-3 shows a temporal function of a moving point object with a local minimum at t 1 and a local maximum at t 2. The only valid interpretation of this figure is that at t 1 two new components arise at the local minimum. The left of these two components merges and terminates with the outermost left component at t 2. 38

39 Based on Definitions 3.4 and 3.5, we are now able in Definition 3.6 to specify the desired properties of the type constructor τ for representing valid moving objects. The notations [a,b] and ]a,b[ represent closed and open intervals respectively with endpoints a and b. Definition 3.6 : Let α {point, line, region} and τ(α) = time α. We restrict τ to contain only temporal functions f τ(α) that fulfill the following conditions: (i) n N : dom( f ) = n i=1 [t 2i 1,t 2i ] (ii) 1 i n : t 2i 1 t 2i (iii) 1 i < n : t 2i t 2i+1 (iv) 1 < i n : t 2i 1 = t 2i t 2i 2 < t 2i 1 (v) 1 i < n : t 2i 1 = t 2i t 2i < t 2i+1 (vi) 1 i n t 2i 1 < t < t 2i : f is φ-continuous at t (vii) 1 i n t {t 2i 1,t 2i } : f is event-φ-discontinuous at t Function f is then called a moving object, and τ(α) for some α is called a spatiotemporal data type. Definition 3.6(i) implies that the lifespan of a moving object must be given by a finite number of time intervals. Definition 3.6(ii) allows that the endpoints of a time interval coincide. Definition 3.6(iii) requires that the domain of a moving object is a sequence of adjacent or disjoint time intervals. If a time interval should be degenerate and represent a time instant, Definitions 3.6(iv) and (v) ensure that the instant does neither coincide with the right endpoint of its preceding time interval nor with the left endpoint of its next time interval. The reason is that a moving object component has to be isolated if it only exists for a time instant. The last two definitions require φ-continuity within time intervals and event-φ-discontinuity at time interval endpoints. From now on, we will use the type constructor τ and all the types and concepts derived from it in the sense of Definition

40 3.1.2 Modeling Historical Movements of Moving Objects Acquiring knowledge of the historical locations and movement (trajectories, routes) of moving objects is important for many spatiotemporal analysis tasks in order to learn from the past. For example, hurricane research benefits from the observation of former hurricanes in order to understand their structure and behavior and to learn from them for the future. By studying the past, fire management is able to identify critical areas having a high probability of a fire outbreak and to analyze the spread, merge, and split of fires over time. Our modeling of historical movement assumes full knowledge about the past locations and extent of moving objects in their time domains (that is, when they are defined). By using partial temporal functions, lacking knowledge is expressed by time intervals when such functions are undefined. Spatiotemporal data types for historical moving objects can be directly modeled on the basis of the τ constructor. We define a type constructor θ with θ(α) τ(α) for α {point,line,region} in Definition 3.7. Definition 3.7 : Let α {point, line, region}. θ(α) = { f τ(α) t dom( f ) : t now} We use the spatiotemporal data types hpoint = θ(point), hline = θ(line), and hregion = θ(region) to describe historical movements of moving points, moving lines, and moving regions respectively. Due to their precise specification, these types replace the spatiotemporal data types mpoint, mline, and mregion discussed in Section Modeling Future Predictions of Moving Objects Predicting the locations and movement of moving objects in the near future is of great importance for many spatiotemporal applications and usually called location management [34]. Examples are the anticipation of possible terrorist activities, homeland security in general to protect territory from hazards, fire outbreak and hurricane prediction to determine evacuation areas, and disaster management to initiate emergency preparedness and mitigation efforts. 40

41 In Section , we present our approach for handling future predictions of moving objects. Taking into account the inherent uncertainty of the future, we explore how the future positions and extent of a moving object can be represented. We present corresponding spatiotemporal data types in Section Handling the uncertainty of the future positions and extent of moving objects Unlike movements in the past for which we assume to have precise knowledge, future predictions involve the inherent feature of uncertainty with regard to the future locations and/or extent of moving objects. From a database perspective, this feature raises two main issues. The first issue is how to predict future spatial evolution and deals with the development of prediction methods that can be employed for the forecast of future movement. The second issue is how to handle the computed data as the result of the prediction and deals with generic data modeling and representation techniques for predictions. A general property of prediction methods is that they are domain and application specific. For example, meteorology, fire management, and homeland security all require quite different prediction models with different input parameters. Hence, it is impossible to implement the large number of employed and future prediction methods from different disciplines in a database context. Any selection of a particular collection of prediction methods would be highly restrictive and unfavorable due to their limited applicability. Further, we aim at providing a general purpose model, tool, and solution. We therefore think that only the second issue should be supported by a database system but not the first issue. This means that application domains should develop prediction models outside of the database system. However, we consider it imperative that a database system provides data modeling and persistence support for representing, storing and querying predicted spatiotemporal data. Based on this view, we focus on the data modeling aspect of the future predictions of moving objects and how this type of data can be represented and queried in databases; we leave the task of prediction to the application domains. We consider a few examples in order to understand the uncertain nature of moving objects in the future and the requirements of their representation. The central issue is the representation 41

42 time now +12h now area of potential postions y time now +12h now +8h now +4h now potential positions over time y time now +15m now road segment y time now +15m now +10m now+5m now x A B C road segments over time time potential positions now +15m y now y x time now +15m positions over time now +10m now+5m now y x x D E F x x Figure 3-4. Modeling potential future positions of spatiotemporal objects. A) For a hurricane s eye at now+12 hours. B) Within the 12-hour period. C) For a vehicle at now+15 minutes. D) Within the 15-minute period. E) For a vehicle with a constant speed at now+15 minutes. F) Within the 15-minute period. of the potential future positions and/or the extent of a predicted moving object since both its positions and its extent are afflicted with uncertainty. For example, the position of the eye of a hurricane at 12 hours from now may possibly be anywhere within a predicted region (Figure 3-4A). That is, this region represents all potential future positions of the hurricane s eye at 12 hours from now. Likewise, if we are interested in the future positions for a certain period in the future, for example, from the present time to 12 hours in the future, then the actual position can be anywhere within a predicted volume if we adopt a three-dimensional interpretation (Figure 3-4B). This volume represents the geometric union of the predicted regions at all time instants during the 12-hour period. It can also be interpreted as the development of a predicted region over a period of time. Hence, it resembles a moving region which can be represented by using our spatiotemporal data type τ(region). Similarly, if we want to model the future position of a vehicle traveling in a road network, we can only state that the position of the vehicle at 15 minutes from now will be somewhere between mile marker 10 and 15. That is, the corresponding segment of the road represents the 42

43 potential positions of the vehicle at 15 minutes from now (Figure 3-4C). Similar statements can be made for other time instants such as at 5 minutes and 10 minutes. By forming the geometric union of the predicted road segments at all time instants during the 15-minute period, we obtain a surface in the three-dimensional space (Figure 3-4D). This surface represents all potential positions of the vehicle during the 15-minute period. The surface can also be regarded as the development of a predicted road segment over a period of time. Hence, it has the same feature as a moving line and can thus be represented by using our spatiotemporal data type τ(line). In case that the vehicle always maintains a constant speed, we can more precisely say that its position at 15 minutes from now will be at a specific point (if the road does not split) or among a set of points (if the road splits) (Figure 3-4E). In this case, the potential positions of the vehicle over a period of time can be modeled as a moving point and can thus be represented by our spatiotemporal data type τ(point) (Figure 3-4F). So far, we have assumed that a point object moves. If we consider an object with extent like a line object, its future prediction over time can be described by either a moving line or a moving region depending on the environment and the nature of its movement. For example, if we treat a train as a line object due to its possibly very long length, the future prediction of its extent in a railroad network at a time instant in the future can be represented by a line object. For a period of time, the development of the prediction can be represented by a moving line object of type τ(line). If we consider the movement of the boundary between fresh water of a river and salt water of an ocean where the river flows into, we may use a region to represent the potential whereabout of the boundary at a time instant in the future. This is because the movement of the boundary in an ocean is unrestricted. For a period of time, the development of this region can be represented by a moving region object of type τ(region). The other type of object with extent other than a line object is a region object. For a region object such as a storm, a future prediction of its extent at an instant in the future is always a region. This is because it is counter-intuitive to predict the extent of a storm to be a line object or 43

44 a point object. Thus, over a period of time in the future, the temporal evolution of this region can be represented by a moving region object of type τ(region). In our discussion of future spatiotemporal evolution, we have exclusively concentrated on its geometric aspects. Like historical spatiotemporal evolution, it can also be modeled by moving objects of type τ(α). However, we have so far completely neglected the uncertainty afflicted with it. That is, our concept so far does not specify the relative chance or degree of confidence with which a point will eventually represent the position or part of the extent of a predicted moving object at a future time instant. To do this, we require a concept of confidence distribution (C) in Definition 3.8 such that each point of a predicted spatial object as the function value of a predicted moving object at a particular time instant is associated with a degree of confidence. Definition 3.8 : The confidence distribution C(α) of a spatial object of type α representing the set of future positions or extent of a moving object at a time instant is defined as C(α) = α 2 (0,1] such that the degree of confidence of every point of the spatial object is between 0 (exclusively) and 1 (inclusively). The above definition allows any type of distribution for C(α). For example, C(α) can be a probability distribution over α describing the probability density (confidence level) of each point in α. Moreover, C(α) can also be a fuzzy set indicating the level of membership for each point in α. To apply this concept of confidence distribution to a moving object for representing future predictions over time, we can use the concept of spatiotemporal mapping to temporally lift C over time to define a moving confidence distribution (MC) as shown in Definition 3.9. Definition 3.9 : The moving confidence distribution MC(α) of a spatial object of type α representing the set of future positions or extent of a moving object is defined as MC(α) = time C(α) = time (α 2 (0,1] ). Here, we do not restrict how MC(α) develops over time since the confidence distribution information is domain specific, thus it may take any shape or form depending on a given 44

45 prediction model. To adequately describe the future prediction of a spatial object, we need two objects. The first object is a moving object representing the temporal evolution of the set of potential positions or extent of a spatial object in the future. The second object is a moving confidence distribution expressing the uncertainty of the movement. Figure 3-5. Representing the future prediction of a hurricane s eye using a moving region with a moving confidence distribution. The gradient indicates varied degree of confidence. To illustrate the concepts presented, consider the example of a hurricane. We can model the set of potential positions of the eye of this hurricane using an hregion object (Figure 3-4B). By applying a moving confidence distribution on the hregion object, we obtain a new kind of object which represents the set of potential future positions, each with a degree of confidence, of the hurricane s eye (Figure 3-5). This means that the future movement trajectory of the hurricane s eye is predicted to be a part of this object. We define the data types for this kind of objects in the next section Data types for future predictions of moving objects Provided that a combination of a moving object and a moving confidence distribution together represents the future prediction of a moving object, we can use this concept to define our future prediction data types. Thus, a future prediction data type can be constructed using the type constructor ϕ defined below. Definition 3.10 : Let α be a spatial data type and MC(α) be a moving confidence distribution on α. The future prediction data type ϕ(α) is defined as ϕ(α) = τ(α) MC(α) such that for each f = (m, p) ϕ(α), m is defined whenever p is defined. 45

46 Applying this definition to the spatial data types point, line, and region, we obtain three future prediction data types fpoint, fline, and fregion. fpoint = ϕ(point) = τ(point) MC(point) fline = ϕ(line) = τ(line) MC(line) fregion = ϕ(region) = τ(region) MC(region) Since each future data type is defined partially using our spatiotemporal data type τ(α), its validity also depends on the validity of the moving object represented by τ(α). Examples of valid and invalid future movements are depicted in Figure 3-6. A B C D Figure 3-6. Examples of valid future predictions. A) A continuous fpoint object. B) A continuous fregion object. C) A discontinuous fregion object. An example of invalid future predictions. D) A dimensionally collapsed object with multiple types. It is important to understand that these future data types are defined only for future predictions of moving objects. They do not make any reference or assumption on the historical spatiotemporal data types of the moving objects. For example, an object of type fregion can be used to represent the future prediction of either a moving point, a moving line, or a moving region. To model the nature of movement of a moving object properly, we require both the past model and the future model. We will see in the next section that not all combinations of the past and future data types represent valid movements. 46

47 3.2 Modeling Moving Balloon Objects In this section, we describe the development of the high-level data types for the Moving Balloon Algebra. We first define balloon data types in Section to represent snapshots (each consisting of a history of movement and possibly a prediction) of our knowledge about moving objects at specific time instants of their movement. Based on this concept, the spatiotemporal development of this knowledge which is a continuous stream of these snapshots is then represented by our spatiotemporal balloon data types defined in Section Balloon Data types Generally speaking, to build a balloon, we first need to prepare the string and the body of the balloon. Once all the parts are ready, they can then be connected to form a balloon. We perform this step by integrating both of our historical and predictive movement concepts to define balloon data types. In Section 3.1.2, we have defined our model for historical movements resulting in a type constructor θ(α). Since we use this type constructor to construct data types for historical movements, all time intervals specified as the domain of these data types must be intervals in the past. The latest known state of a moving object is assumed to be the current state of the object. This means that the current state of the object changes for every update of the object s position. Each update can either signify a continual movement of the last interval of knowledge or a period of no knowledge followed by a new instant of knowledge. In any case, the current state of the object is always defined as the state of the object at the last instant of the historical movement. We denote the current state of an object by t c. It is possible that t c may be earlier (older) than the absolute present (the current clock time now), denoted by t a. This situation can happen when we do not have information about the state of the object at the absolute present (Figure 3-7) possibly due to delay in obtaining sensor data. On the other hand, it is impossible for t c to be later (younger) than the absolute present. This would mean that the object has already moved in the future which is impossible. Hence, it is required that t c t a holds for all moving objects. We 47

48 now define a temporal domain time h for the historical movement of a moving object as a halfinfinite time domain that starts from and ends at t c inclusively. Thus, time h = (,t c ]. We choose to end time h at t c instead of t a because if t c < t a, we may want to predict the movement between t c and t a which is outside of time h. Otherwise, this prediction would be a part of time h which contradicts our definition above. The temporal domain time h is applied to all data types representing the past movement of a moving object. It will be used as part of a temporal composition to compose the entire temporal domain of a balloon object. Figure 3-7 illustrates an example of a historical temporal domain time h for a moving object. defined intervals t c t a time time h Figure 3-7. Example of a historical temporal domain time h that starts from and ends at t c inclusively. For future predictions of moving objects, we have defined a type constructor ϕ(β) which accepts as a parameter a spatial type β whose value represents the set of future positions or extent of a moving object at a specific instant in the future. Here, we would like to restrict the temporal domain of the future data types produced by ϕ such that these data types describe only the future predictions of moving objects. t c t a prediction intervals time time Figure 3-8. Example of a future temporal domain time f that starts exclusively from t c and extends indefinitely towards +. f We define a temporal domain time f for future predictions of a moving object as a halfinfinite open interval of time which starts exclusively from t c and extends indefinitely towards +. Hence, time f = (t c,+ ). We choose to begin time f from t c because this would allow a prediction to be made as close to the latest known state of the object as desired irrespective to the 48

49 value of the absolute present. This temporal domain is applicable to all objects of both τ(β) and MC(β). Figure 3-8 depicts an example of time f for a moving object. Having defined time h and time f to restrict the temporal domains of historical movements and future predictions of moving objects, we are now ready to define our balloon data types. We integrate the past (θ) and the future prediction (ϕ) type constructors to form a new type constructor Ω for balloon objects which is defined on the entire time domain. This time domain is a result of a temporal composition of time h and time f. Since the spatial type as the argument of θ refers to a different spatial object than that of the spatial type as the argument of ϕ, we denote the former by α and the latter by β. Thus, we have Ω(α,β) = θ(α) ϕ(β). That is, for a balloon object b = (h, f ), h θ(α) represents the past movement of a spatial object of type α and f ϕ(β) represents the future prediction of b given that the set of its potential future positions at a future time instant is described by a spatial object of type β. As indicated earlier, not all combinations of α and β constitute valid movements. For example, it is not possible to use fpoint to represent the future extent of a moving region. If this were to be possible, this means that, at a future time instant, the region object would have evolved into a point object. This is not possible since our definition of movement does not allow movements involving dimensional collapse into a different type. Therefore, the combination for which α is the region type and β is the point type has been proved to be an invalid combination. The general idea here is that the set of potential future positions or extent of a moving object at a future time instant must be a spatial object of dimension greater than or equal to the dimension of the object that is moving. This means that an object can move or evolve such that at a future time instant, it fits in or equal to its prediction without collapsing its dimension. Let dim be a function that returns the dimension of a spatial type. It is required that dim(β) dim(α) holds for all valid combinations of α and β. We now define our type constructor Ω for balloon data types in Definition Definition 3.11 : The type constructor Ω(α,β) for a balloon data type describing a balloon object whose past movement and future prediction are based on the spatial type α and β respectively, is defined as Ω(α,β) = θ(α) ϕ(β) such that all of the following conditions hold: 49

50 (i) (ii) (iii) dim(β) dim(α) θ(α) represents the past movement and is defined on time h ϕ(β) represents the future prediction and is defined on time f In other words, Ω(α,β) is a total function defined on the complete time domain such that it evaluates θ(α) for an instant t in time h or ϕ(β) for t in time f. By specifying α and β, we obtain six data types for balloon objects: balloon pp = Ω(point, point) = hpoint fpoint balloon pl = Ω(point,line) = hpoint fline balloon pr = Ω(point, region) = hpoint fregion balloon ll = Ω(line,line) = hline fline balloon lr = Ω(line, region) = hline fregion balloon rr = Ω(region, region) = hregion fregion Each of these balloon data types consists of a data type for past movements (the strings) and a data type for future predictions (the bodies). Now we can use these balloon data types to model balloon objects. A balloon object has the advantage of being able to capture both the past movement and the future prediction of a moving object with respect to a specific time instant representing the current state of the object. Examples of a balloon pp, a balloon pl, and a balloon pr object are shown in Figure 3-6A, 3-4D, and 3-6B respectively Spatiotemporal Balloon Data Types Having defined balloon data types to represent snapshots (including past developments and future predictions) of a moving object with respect to a specific time instant (that is, its current instant), we now need to model the dynamic of this object as it moves over time. It is clear that as a moving object advances its movement, we obtain a new snapshot consisting of a new (updated) past movement and possibly a new prediction with respect to the new current instant. Thus, the dynamic of a moving object can be represented by a development of a balloon object. We called 50

51 this development a moving balloon object which can be represented by a spatiotemporal balloon data type expressed as a function from time to a balloon data type. Furthermore, the property of this function must be defined such that for each time instant t in the domain, we have a balloon object that represents a valid snapshot of the object s dynamic. This means that (1) the current instant t c of the balloon object at t must be the same as t and (2) The past movement history of a balloon object at t + x (x is a positive number) is equal to the past movement history of a balloon object at t augmented by the movement between t to t + x. We call this phenomenon historical accumulation due to the obvious accumulation of movement. We do not make any assumption about the dynamic of predictions since, in general, they are generated discretely and independently by a prediction model. Due to the fact that prediction models are domain specific, the output of these models may experience abrupt changes depending on input parameters or the design of the models themselves. Hence, we do not pose any constraint on the dynamic of predictions. We define a type constructor mω for spatiotemporal balloon data types in Definition Definition 3.12 : A spatiotemporal balloon data type mω(α,β) describing a moving balloon object whose past movements and future predictions are based on the spatial type α and β respectively, is defined as: mω(α,β) = time Ω(α,β) such that f mω(α,β), the followings are true: (i) t dom( f ) : f (t).t c = t (ii) t 1,t 2 dom( f ),t 1 < t 2 : the historical movement of f (t 2 ) is a historical accumulation of that of f (t 1 ). 51

52 By applying the six balloon data types defined in the previous section to this definition, we obtain six different spatiotemporal balloon data types: mballoon pp = time balloon pp mballoon pl = time balloon pl mballoon pr = time balloon pr mballoon ll = time balloon ll mballoon lr = time balloon lr mballoon rr = time balloon rr Figure 3-9. Example of a moving balloon object of type mballoon pr. An example of a moving balloon object of type mballoon pr is depicted in Figure 3-9. When working with moving balloon objects, we must distinguish the different meanings of a time instant. With respect to a moving balloon object, a time instant t refers to an instant of the domain of f at which we obtain a balloon object. We distinguish this time domain as the dynamic time domain. With respect to a balloon object at a specific instant t of the dynamic time domain, a time instant t s refers to an instant of the domain of f (t) which is the union of time h and time f at which we obtain the position or extent of the object or its prediction. We distinguish this time domain as the snapshot time domain. Now we can use these spatiotemporal balloon data types 52

53 to model not only the development of moving objects in term of historical movements but also the development of their future predictions which are available at different time instants during the course of the movements. This allows one to perform useful operations on these predictions in addition to existing operations on moving objects. We discuss these operations in the next section. 3.3 Operations of the Moving Balloon Algebra Due to the fact that our Moving Balloon Algebra consists of a structured hierarchy of different sets of data types, we defined operations that are applicable to these data types starting from the most fundamental set, the data types for historical movements, to the most complex set, the spatiotemporal balloon data types Operations on Historical Movements The design of operations for the Moving Balloon Algebra follows the three principles set forth in [32] which are: (i) Design operations as generic as possible; (ii) Achieve closure and consistency between operations; (iii) Capture interesting phenomena. Each of these principles is achieved in the existing operations defined in the traditional moving object model [32] which is a vague, unrestrcited version of our historical movement model described in Section Thus, these operations are also applicable to our historical movement data types. Let the type periods represents the set of all defined intervals and defined instants of a movement. Assume also that the type intime(α) = α instant represents the state of the movement of a spatial object of type α at a specific instant in time. The function min(α,β) returns the spatial type α or β whichever has the smaller dimension. The operations are classified into five categories: projection, interaction, temporally lifted, rate of change, and predicate operations. Projection operations return projections of the movement into either the time domain or the space range. Interaction operations include decompositions and instantiations of the movement. Temporally lifted operations are those non-temporal operations that have been lifted over time into temporal operations. Rate of change operations include the different types of differentiations associated with movement such as velocity and turning rate. Finally, predicate operations are used to answer 53

54 questions about the spatiotemporal relationship (development) between movements. Table 3-1 lists these operations along with their signatures. The semantics for these operations as they are applied to historical movement data types are presented in [32]. Binary predicates include predicates between homogeneous types as well as heterogeneous types. Some of the basic spatiotemporal predicates are Disjoint, Meet, Overlap, Equal, Covers, CoveredBy, Contains, Inside, etc. Some of the complex spatiotemporal predicates include Touch, Snap, Release, Bypass, Excurse, Into, OutOf, Enter, Leave, Cross, Melt, Separate, Spring, Graze, etc. The detail modeling of these spatiotemporal predicates is described in [22]. For all other operations, they have been defined in [32]. So we will not go into detail about them here. However, what still need to be done here are: (1) determine whether and how these operations can be applied to our newly introduced data types including the future prediction data types, the balloon data types, and the spatiotemporal balloon data types; and (2) discover new operations for these new data types Operations on Future Predictions As defined in Section 3.1.3, each of our future prediction data types is composed of a movement data type representing the moving geometry of a prediction and a moving confidence distribution representing the uncertainty of the prediction. Thus, we can define two decomposition operations, mgeo and mconf, to obtain the moving geometry and the moving confidence from a prediction respectively. By decomposing a prediction in this way, we can define all geometry related operations on a prediction to have the same semantic as if these operations are applied to the moving geometry component of the prediction. Similarly, all confidence related operations are applicable to the moving confidence component of the prediction. These operations are shown in Table 3-1. We only describe the modified and newly introduced operations here. Let the type infutime(α) = α C(α) instant represents the state of a prediction at an instant in time. The decomposition of this type can be done using the three operations inst, val, and conf to obtain each of the component. The operations atinstant, initial, and final returns an object of the type infutime(α) when applied to a prediction of type ϕ(α). The point conf and pointset conf 54

55 Table 3-1. Operations on historical movements and future predictions of moving objects. Projection Operations Application to Historical Movements Application to Future Predictions deftime, lifespan θ(α) periods ϕ(α) periods locations θ(point) point ϕ(point) point trajectory θ(point) line ϕ(point) line traversed θ(line) region ϕ(line) region traversed θ(region) region ϕ(region) region routes θ(line) line ϕ(line) line Interaction Operations Application to Historical Movements Application to Future Predictions mgeo N/A ϕ(α) τ(α) mconf N/A ϕ(α) MC(α) atinstant θ(α) instant intime(α) ϕ(α) instant infutime(α) inst intime(α) instant infutime(α) instant val intime(α) α infutime(α) α conf N/A infutime(α) C(α) point conf N/A ϕ(α) point instant real pointset conf N/A ϕ(α) β instant real atperiods θ(α) periods θ(α) ϕ(α) periods ϕ(α) initial, final θ(α) intime(α) ϕ(α) infutime(α) present θ(α) instant bool ϕ(α) instant bool present θ(α) periods bool ϕ(α) periods bool at θ(α) β θ(min(α,β)) ϕ(α) β τ(min(α,β)) passes θ(α) β bool ϕ(α) β bool when θ(α) (α bool) θ(α) ϕ(α) (α bool) ϕ(α) Temporally Lifted Operations Application to Historical Movements Application to Future Predictions intersection θ(α) β θ(min(α,β)) ϕ(α) β τ(min(α,β)) intersection θ(α) θ(β) θ(min(α, β)) ϕ(α) ϕ(β) τ(min(α, β)) union, minus θ(α) α θ(α) ϕ(α) α τ(α) union, minus θ(α) θ(α) θ(α) ϕ(α) ϕ(α) τ(α) crossings θ(line) line θ(point) ϕ(line) line τ(point) crossings θ(line) θ(line) θ(point) ϕ(line) ϕ(line) τ(point) touch points θ(region) line θ(point) ϕ(region) line τ(point) touch points region θ(line) θ(point) region ϕ(line) τ(point) touch points θ(region) θ(line) θ(point) ϕ(region) ϕ(line) τ(point) common border θ(region) region θ(line) ϕ(region) region τ(line) common border θ(region) θ(region) θ(line) ϕ(region) ϕ(region) τ(line) no components θ(α) θ(int) ϕ(α) τ(int) length θ(line) θ(real) ϕ(line) τ(real) area θ(region) θ(real) ϕ(region) τ(real) perimeter θ(region) θ(real) ϕ(region) τ(real) distance θ(α) β θ(real) ϕ(α) β τ(real) distance θ(α) θ(β) θ(real) ϕ(α) ϕ(β) τ(real) direction θ(point) point θ(real) ϕ(point) point τ(real) Rate of Change Application to Historical Movements Application to Future Predictions derivative θ(real) θ(real) ϕ(real) τ(real) turn, velocity θ(point) θ(real) ϕ(point) τ(real) Predicates Application to Historical Movements Application to Future Predictions isempty θ(α) bool ϕ(α) bool <binary predicate> θ(α) θ(β) bool ϕ(α) ϕ(β) bool interaction potential N/A ϕ(α) ϕ(β) τ(real) interaction possible N/A ϕ(α) ϕ(β) bool interaction possible N/A ϕ(α) θ(β) bool 55

56 operations are domain specific operations that must be provided by the prediction model. The semantics of these operations are different depending on the type of prediction model used. In the case of a probability-based prediction model, the point conf operation is used to retrieve the density value of a given point at a given time instant during the prediction period. Note that this density value is not necessarily the probability value of occurrence. These two values are the same only in the case of a discrete probability distribution which is applicable to a prediction of type ϕ(point). This is not the case for a continuous probability distribution which is applicable to a prediction of type ϕ(line) or ϕ(region). We use the operation pointset conf to determine the probability of occurrence (percentage of chance) that a point as part of the moving object will fall within the given point-set at a given time instant. For a continuous probability distribution over a line based (or region based) prediction, the probability of occurrence is the integration of a probability distribution function (pdf) over a point-set, which corresponds to either an area (for ϕ(line)) or a volume (for ϕ(region)) under the curve or surface, respectively, of the pdf. Thus, the probability value for a point in these continuous distributions is always 0 since we cannot obtain an area or a volume by integrating over a point. Similarly, the probability value for a line in a two dimensional continuous distribution over a region-based prediction is also always 0 since we cannot obtain a volume by integrating over a line. Table 3-2 shows the value of the operation pointset conf (ϕ(α),β,instant) when applied to different type combinations of ϕ(α) and β for α,β {point,line,region}. Table 3-2. Value of the operation pointset conf (ϕ(α),β,instant) for each combination of ϕ(α) and β whether it is always 0, denoted by a value 0, or a meaningful value, denoted by a value M. ϕ(α)\β point line region ϕ(point) M M M ϕ(line) 0 M M ϕ(region) 0 0 M To further clarify the meaning of these operations, consider predictions at a time instant as shown in Figure The density value of the point p in Figure 3-10A is Since this prediction is of the type ϕ(point), we have a discrete probability distribution over a finite set 56

57 of points. Thus, the probability that a point of the moving object will fall on p is 25%. Notice that here we can only talk about the probability of a point as part of the moving object because the probability distribution only models the probability of occurrence of a single point event. Figure 3-10B illustrates a continuous probability distribution over a line-based prediction. The density value of the point p in this case is However, the probability of occurrence at p is 0 because we cannot obtain an area by integrating the pdf at p. A meaningful probability value can only be obtained by integrating the pdf over a segment of line which is a subset of the prediction. In this example, we show that the probability that a point of the moving object will be on the line segment (p,q) is 30% (the area under the pdf curve between p and q). Similarly, Figure 3-10C shows a probability of 20% that a point event will fall within a region A which is a subset of a region-based prediction. Here, the probability value is the volume defined by A under the pdf surface. A B C Figure Examples of predictions at a time instant. A) A point-based prediction with a discrete probability distribution. B) A line-based prediction with a one-dimensional continuous distribution. C) A region-based prediction with a two-dimensional continuous distribution. Unlike a probability-based prediction model, a fuzzy-based prediction model is designed to model the potential inclusion, called membership value, of each point of a prediction as part of a point-set event. Thus, the point conf operation returns the membership value for a given point signifying the level of confidence that this point will be part of the moving object. The pointset conf returns the average membership value of a given point-set. Hence this operation 57

58 indicates the average degree of confidence that each point of the given point-set will be part of the moving object. For temporally lifted operations, all such operations produce basic spatiotemporal objects instead of future predictions. This is because the future prediction is decomposed into its moving geometry component before applying these operations. With respect to predicates, the binary predicate operation between predictions has the same semantic as the binary predicate operation between their moving geometry components. However, with the confidence distribution information, we can also determine the degree in which the actual moving objects can potentially interact (non-disjoint) with each other during the period of the predictions. This is given by the interaction potential operation which returns a moving real number indicating the potential of interaction between the actual objects over the prediction period. The possibility of the actual object interaction depends on the interaction between their predictions and this is given by the interaction possible operation. This topic is further discussed in Section Operations on Balloon Objects One of the main advantages of balloon data types is that we can apply most of the operations to the entire object (the entire time domain). These operations include deftime, lifespan, location, trajectory, traversed, present, passes, no components, length, area, perimeter, distance, and direction. The semantic of these operations can be expressed as the union, for non-temporal return type, or temporal composition, for temporal return type, between the results of applying the operations to both historical and future components of the balloon objects. Although most of the operations on balloon data types can be applied to the entire object, a few of the operations, that is, atinstant, initial, and final), can only be applied by first decomposing a balloon object into its two components and then applying the corresponding operation to the component whose time domain is relevant. For example, the atinstant operation is applied to the historical movement component if the given instant is within the time domain of this component. Otherwise, it is applied to the future prediction. In both cases, a decomposition operation must be applied in 58

59 advance. We define two decomposition operations, past proj and future proj, to obtain the historical movement and future prediction component of a balloon object respectively. By using these decomposition operations, we can apply all supported operations described in previous sections for these components. With respect to spatiotemporal predicates between balloon objects, we describe a model for these predicates in Section The interaction possible and interaction potential operations determine whether there is any interaction and the degree of interaction respectively between two balloon objects for the duration of their defined periods. Let γ be a spatial data type. The operations that are applicable to balloon data types are listed in Table Operations on Moving Balloon Objects Since spatiotemporal balloon data types represent the dynamic developments of balloon objects over time, most of the operations on moving balloon objects operate on this dynamic time domain. The operation deftime when applied to a moving balloon object returns the periods of the dynamic time domain for which the moving balloon object is defined. Therefore, this is the period of the actual movement up to the current instant and which does not include any future prediction period beyond this instant. For example, in Figure 3-9, the defined period of the moving balloon object is the period between t 0 and t 4. This ensures that at any instant of this defined period, we can obtain a balloon object. In other words, the actual movement made by the object during this defined period can be obtained from the past component of the current (latest) balloon object (using the atperiods operation on this past component given the defined period of the moving balloon object). In fact, this actual movement of the object which is of type θ(α) is used to determine the results to many operations such as locations, trajectory, traversed, present, passes, no components, length, perimeter, area, distance, direction, turn, and velocity. Assuming that we have a type indytime(α,β) := Ω(α,β) instant representing a state of a moving balloon object at a time instant of the dynamic time domain, the current balloon object can be obtained by using the final operation and then applying the val function to extract the balloon object from the resulting final state. Similarly, the initial state is provided by the 59

60 Table 3-3. Operations on balloon objects and moving balloon objects. Projection Operations Application to Balloon Data Types Application to Spatiotemporal Balloon Data Types deftime, lifespan Ω(α, β) periods mω(α, β) periods locations Ω(point, point) point mω(point, point) point trajectory Ω(point, point) line mω(point, point) line traversed Ω(line, line) region mω(line, line) region traversed Ω(line, region) region mω(line, region) region traversed Ω(region, region) region mω(region, region) region Interaction Operations Application to Balloon Data Types Application to Spatiotemporal Balloon Data Types past proj Ω(α, β) θ(α) N/A future proj Ω(α, β) ϕ(β) N/A atinstant N/A mω(α, β) instant indytime(α, β) inst N/A indytime(α, β) instant val N/A indytime(α, β) Ω(α, β) atperiods N/A mω(α, β) periods mω(α, β) initial, final N/A mω(α, β) indytime(α, β) present Ω(α,β) instant bool mω(α,β) instant bool present Ω(α,β) periods bool mω(α,β) periods bool passes Ω(α,β) γ bool mω(α,β) γ bool update N/A mω(α,β) Ω(α,β) mω(α,β) update N/A mω(α,β) intime(α) ϕ(β) mω(α,β) verify prediction at N/A mω(α, β) instant bool has bad prediction N/A mω(α, β) bool accuracy at N/A mω(α, β) instant τ(real) accuracy at N/A mω(α, β) instant instant real Lifted Operations Application to Balloon Data Types Application to Spatiotemporal Balloon Data Types no components Ω(α, β) τ(int) mω(α, β) τ(int) length Ω(line, line) τ(real) mω(α, β) τ(real) area Ω(region, region) τ(real) mω(region, region) τ(real) perimeter Ω(region, region) τ(real) mω(region, region) τ(real) distance Ω(α,β) γ τ(real) mω(α,β) γ τ(real) distance Ω(α 1,β 1 ) Ω(α 2,β 2 ) τ(real) mω(α 1,β 1 ) mω(α 2,β 2 ) τ(real) direction Ω(point, point) point τ(real) mω(point, point) point τ(real) Rate of Change Application to Balloon Data Types Application to Spatiotemporal Balloon Data Types turn, velocity Ω(point, point) τ(real) mω(point, point) τ(real) Predicates Application to Balloon Data Types Application to Spatiotemporal Balloon Data Types isempty Ω(α,β) bool mω(α,β) bool <binary predicate> Ω(α 1,β 1 ) Ω(α 2,β 2 ) bool mω(α 1,β 1 ) mω(α 2,β 2 ) bool mω(α 1,β 1 ) mω(α 2,β 2 ) instant bool interaction potential Ω(α 1,β 1 ) Ω(α 2,β 2 ) τ(real) mω(α 1,β 1 ) mω(α 2,β 2 ) τ(real) mω(α 1,β 1 ) mω(α 2,β 2 ) instant τ(real) interaction possible Ω(α 1,β 1 ) Ω(α 2,β 2 ) bool mω(α 1,β 1 ) mω(α 2,β 2 ) bool mω(α 1,β 1 ) mω(α 2,β 2 ) instant bool 60

61 operation initial. A more general way to access any state of a moving balloon object within its defined period is through the use of the operation atinstant. To get a moving balloon object for a specific period of time, we can use the atperiods operation. Other than these access operations, an important operation that allows the realization of the dynamic of a moving balloon object is the update operation. As the object moves in time, its history of movement is extended by a new position or extent, and a new future prediction may be acquired. The new data can be in the form of a new balloon object or a combination of a new state and a new prediction. In any case, the update operation is used to update the moving balloon object to reflect the new movement. Besides the normal set of operations, the spatiotemporal balloon data types support a special set of operations that allows one to perform certain analysis about the accuracy of predictions. This is one of the main features of this data model which can be of particular importance to domain experts in research and development of prediction models. The moving balloon data model allows one to verify whether or not, the object s actual movement stays within a specific prediction made in the past. This is achieved by using the verify prediction at operation. Given a moving balloon object and a specific time instant, this operation intersects the prediction made at this instant, if such a prediction exists, with a segment of the actual movement of the object within the period of the prediction. If the resulting intersection is the same as the segment of the actual movement, this means that the object s movement had always been within the confinement of the prediction, and thus we say that this prediction provides full coverage of the movement. Otherwise, the prediction provides only partial coverage which can be thought of as an inaccurate or a bad prediction. An example of a partial coverage prediction is the prediction made at t 2 as shown in Figure 3-9. Other predictions made at t 1, t 3, and t 4 are full coverage predictions. To determine whether a moving balloon object has any bad prediction, we use the operation has bad prediction. This operation is useful in persistent queries for monitoring the accuracy of predictions as the object moves in time. We will discuss persistent queries and other types of spatiotemporal queries in Section 3.5. So far, we have only discussed whether a prediction provides partial or full coverage, but an even more interesting aspect is the quantification of the 61

62 accuracy of the prediction itself. However, there are many ways to define the semantic of such accuracy. One way is to determine the density value of each point of the actual movement from the prediction and then determine the mean value over the period of the prediction. We use the accuracy at operation for this purpose. As far as the predicate operations are concerned, the unary operation isempty is obvious. The relationship between the entire moving balloon objects does not make much sense and is difficult to find any practical meaning. However, the relationship between their balloon object components such as their final balloon objects offers insight into the spatiotemporal relationship between their past movements as well as their future predictions. Thus, we define the binary predicate operation between two moving balloon objects to have the same semantic as the binary predicate operation between their final balloon objects. If an instant of the dynamic time domain is specified, the balloon objects at this instant will be used to determine the spatiotemporal relationship. Similarly, the interaction potential and interaction possible operations also have the same semantic as if they are applied to the final balloon objects or the corresponding balloon objects at a specified dynamic time instant. Therefore, one can always determine or verify the spatiotemporal relationship between any states (balloon objects) of moving balloon objects. We discuss this topic in more detail in the next section. 3.4 Spatiotemporal Predicates Since relationship between moving balloon objects does not make much sense and is very difficult to find any practical meaning, we will only focus on the modeling of the relationship between balloon objects. Defining the relationship between uncertain movements of moving objects is a very complex task. For instance, consider a prediction of an airplane that crosses a prediction of a hurricane. It is not necessary that the airplane will always cross the hurricane; it may only get close to or touch the actual hurricane even though its prediction crosses the hurricane s prediction. However, there is a chance that the airplane would cross the hurricane as well. The quantification of this chance of future interaction of the two objects depends on a complex calculation of the 62

63 moving confidence distributions of both objects. Thus, we can distinguish two different types of information here. One is the spatiotemporal relationship between the moving geometries, in this case the predictions, and another is the quantification of the chance that there will be an interaction between the two (actual) objects (the plane and the hurricane) in the future. We treat each of these types of relationship information separately so that we can present the model in its most simplest and understandable form as possible. In Section 3.4.1, we define predicates between balloon objects (balloon predicates) and explore their properties by focusing only on the relationship between their moving geometries. Hence, we can treat the future prediction component ϕ(β) as simply τ(β). Therefore, the balloon data type constructor can be written for this purpose as Ω(α,β) = θ(α) τ(β). For a balloon object b = (b h,b p ) Ω(α,β), the first moving object b h, called the history part, describes the historical movement of b. The second moving object b p, called the prediction part, describes the moving geometry of a prediction of the balloon object. For the treatment of the second type of information, we provide our reasoning about the potential future interaction between the actual objects in Section Modeling Balloon Predicates In order to help explaining the method for defining our balloon predicate model, we first describe our general mechanism in Section We then discuss how a balloon predicate can be specified using traditional STPs in Section Finally, we determine the canonical collection of balloon predicates in Section General mechanism for balloon predicates The approach we present here is based on two main goals. The first goal is to develop a formalism that works independently of the balloon data types to which it is applied. It is desired that the formalism can be equally applied to any pair of balloon objects irrespective of their data types. The second goal concerns the importance of making use of existing definitions of STPs [22]. Since balloon objects are constructed based on moving objects. It is only consistent to have balloon predicates be constructed from STPs. With this goal, we can benefit from both theoretical and implementation advantages such that the formalism and implementation of 63

64 balloon predicates can make use of the existing work done for traditional moving object data model. Figure 3-11 shows the relationships between traditional moving object data model and balloon object data model. Figure Relations between traditional moving object data model and balloon data model. The general method we propose characterizes balloon predicates based on the idea that as two spatial objects move over time, the relationship between them may also change over time. By specifying this changing relationship as a predicate, we can ask a true/false question of whether or not such a changing relationship (development) occurs. Thus, we can define a balloon predicate as a function from balloon data types to a Boolean type. Definition 3.13 : A balloon predicate is a function of the form Ω(α 1,β 1 ) Ω(α 2,β 2 ) bool for α 1, β 1, α 2, β 2 {point,line,region}. The change of relationship over time between two balloon objects indicates that there is a sequence of relationships that hold at different times. This suggests that a balloon predicate can also be modeled as a development (sequence) of spatial and spatiotemporal predicates. Due to the fact that a balloon object consists of a history part followed by a prediction part, the specification of a balloon predicate must take into account the relationships between both parts. To do this, let us first explore how relationships between balloon objects can be modeled. Each balloon object has a defined current state at its current instant t c which separates the history part and the prediction part. Between two balloon objects A = (A h,a p ) and B = (B h,b p ), A s current instant may either be earlier, at the same time, or later than B s current instant. In each of these scenarios, certain sequences of spatiotemporal relationships are possible between the parts of A and B. Here, we are only interested in the relationship between a part of A and another part of B 64

65 whose temporal domains overlap since, in this case, the two parts may be defined on the same period of time. Figure 3-12 illustrates all the possible related pairs for each scenario between parts of A and B. A B C Figure Possible relationships between parts of balloon objects A and B. A) When A s current instant is earlier. B) At the same time. C) Later than that of B s. Although there are four possible types of relationships between all parts of two balloon objects, it turns out that in any case, there are at most three types of relationships that may exist between parts of any two balloon objects. These include history/history, history/prediction or prediction/history, and prediction/prediction relationships. The history/prediction and prediction/history relationships cannot exist at the same time due to the temporal composition between the history and prediction parts of a balloon object Specification based on traditional spatiotemporal predicates If we observe more closely, all the relationships between the parts of two balloon objects that may exist in a scenario form a development such that the entire relationship between the two balloon objects can be seen as a sequence of these relationships between their parts. For example, consider an airplane represented by a balloon pp object P = (P h,p p ) and a hurricane represented by a balloon pr object R = (R h,r p ) (Figure 3-13). In the past, P has been disjoint from R s path as well as part of R s prediction. However, the predicted route of P crosses the predicted future of R. The relationship between P and R can be described as a development or sequence of uncertain spatial and spatiotemporal predicates which hold at different times, that is, 65

66 Figure Future crossing situation between a balloon pp object P and a balloon pr object R. Dis joint u meet u Inside u meet u Dis joint u (the subscript u indicates uncertain predicates or predicates that involve predictions). However, these spatial and spatiotemporal predicates may represent relationships between different parts of the balloon objects. For instance, the first Dis joint u predicate is actually a temporal composition of three different types of disjointedness between the corresponding parts of P and R, that is, Dis joint(p h,r h ) Dis joint u (P h,r p ) Dis joint u (P p,r p ). The rest of the predicates represent relationships between the prediction parts of both objects. Hence, we can expand the original sequence as Dis joint(p h,r h ) Dis joint u (P h,r p ) Dis joint u (P p,r p ) meet u (P p,r p ) Inside u (P p,r p ) meet u (P p,r p ) Dis joint u (P p,r p ). In this sequence, the subsequence Dis joint u (P p,r p ) meet u (P p,r p ) Inside u (P p,r p ) meet u (P p,r p ) Dis joint u (P p,r p ) can be represented by an STP Cross u (P p,r p ) since they are applied to the same prediction parts of the two balloon objects. Thus, we have Dis joint(p h,r h ) Dis joint u (P h,r p ) Cross u (P p,r p ). As a result, we are left with a sequence of three STPs each applied to different combination pairs of parts of the balloon objects. This example illustrates that balloon predicates can be appropriately modeled by sequences of three STPs between the related parts of the objects. Hence, we can specify balloon predicates based on the traditional STPs as follows: Definition 3.14 : Let P and R be two balloon objects of type Ω(α 1,β 1 ) and Ω(α 2,β 2 ) respectively. A balloon predicate between P and R is a temporal composition of traditional spatiotemporal predicates: 66

67 stp(τ(α 1 ),τ(α 2 )) (stp(τ(α 1 ),τ(β 2 )) stp(τ(β 1 ),τ(α 2 ))) stp(τ(β 1 ),τ(β 2 )). We consider an STP between two moving objects to be meaningful if and only if there exists a period of time for which both objects are defined. Hence, each element of the above sequence is meaningful only if the relationship between the corresponding parts is meaningful. The predicate of the first element in the sequence represents an interaction that did occur. The first and second alternative predicates of the second element in the sequence represents an interaction that may have occurred. These predicate options reflect the constraint described in Section which dictates that the two predicates cannot exist at the same time. The predicate of the third element in the sequence denotes an interaction that probably will occur. Thus, the second and third elements indicates whether there is a possibility that an interaction will occur whereas the first element tells exactly whether or not an interaction has occurred. The combinations of multiple of these interactions represents a more complex relationship between balloon objects. For example, an interaction that did occur in the past and probably will occur in the future can indicate that there is a chance that it probably always occurs. Table 3-4 shows an example of assigning a meaningful prefix to the name for each pairwise combination between these interactions. Other Table 3-4. Assigning naming prefixes to pairwise combinations of interactions. did may have probably will did - may have been probably always may may have been - probably will have probably will probably always probably will have - combinations with larger number of interactions also exist, but it is usually not obvious to name these relationships. Here are some examples of balloon predicates: did cross := Cross(τ(α 1 ),τ(α 2 )) probably will cross := Cross u (τ(β 1 ),τ(β 2 )) may have been dis joint := Dis joint(τ(α 1 ),τ(α 2 )) Dis joint u (τ(α 1 ),τ(β 2 )) probably always inside := Inside(τ(α 1 ),τ(α 2 )) Inside u (τ(β 1 ),τ(β 2 )) 67

68 Canonical collection of balloon predicates Having defined a model for balloon predicates, we can now search for a canonical collection of balloon predicates. The use of traditional STPs in the definition of balloon predicates suggests that the canonical collection of balloon predicates can be expressed in terms of the canonical collection of traditional STPs, which is provided in [22]. Another important factor that affects the canonical collection is whether dependencies exist between the three elements of the sequence. More specifically, we need to investigate whether the existence of a STP as an element of the sequence can prevent or restrict another STP from representing another element of the sequence. According to [22], the dependency between STPs, which are parts of a continuous development, is expressed using a development graph. This graph describes all the possible developments of STPs which correspond to continuous topological changes of moving objects. For example, if a moving point is inside a moving region, it must meet the boundary of the moving region before it can be disjoint from the region. This constraint relies on the continuity of the moving point. If we allow discontinuity such as a period of unknown movement as in the case of the balloon model to model our limited knowledge of the movement, then such constraint cannot be applied. Although the history part and the prediction part of a balloon object cannot temporally overlap each other, it is possible that they can be separated by a period of unknown movement. Further, there can also be periods of unknown movement within the history or the prediction part of a balloon object. Due to the possible discontinuity of balloon objects, we can deduce that each element of the predicate sequence, which is a STP between the parts of two balloon objects, is independent of each other. Thus, all the combinations of the STPs involved are possible. This means that the canonical collection of balloon predicates can be determined solely based on the canonical collections of the traditional STPs involved. As provided in [22], there are 13 distinct temporal evolutions between two moving points without repetitions, 28 between a moving point and a moving region, and 2,198 between two moving regions. With this information, we can determine, for example, the number of distinct, non-repetitive balloon predicates between two balloon pp objects to be 13 ( ) 13 = 4,394. Each of the three parts 68

69 Table 3-5. Number of balloon predicates between balloon pp, balloon pr, and balloon rr objects. balloon pp balloon pr balloon rr balloon pp 4,394 14,924 43,904 balloon pr 14,924 1,600, ,996,944 balloon rr 43, ,996,944 21,237,972,784 of the multiplication represents the number of distinct STPs for each element of the sequence. Similarly, we can determine the number of balloon predicates between all type combinations of balloon pp, balloon pr, and balloon rr as shown in Table 3-5. Since the numbers of STPs that involve moving line objects are not specified in [22], we omit those calculations that involve balloon objects which are based on moving line objects Reasoning About Actual Future Interactions So far, we have modeled balloon predicates based on the relationships between the geometries of the parts of balloon objects. This allows us to distinguish relationships involving future predictions as uncertain relationships with respect to the moving objects themselves. Unlike relationships between the past movement histories which indicate interactions (non-disjoint relationship) or non-interactions (disjoint relationship) that had definitely occurred between the moving objects, uncertain relationships only indicate the existence of a chance whether the moving objects will interact with one another in the future. Thus in this section, we will study how this chance of future interaction between the actual moving objects can be quantified based on the given relationship of their predictions. Recall that the future prediction of a balloon object represents the set of all potential future positions or extents of the moving object. This means that a non-interaction relationship with this future prediction component guarantees a non-interaction relationship with the actual object in the future. However, an interaction relationship with this future prediction component can only signify a potential interaction with the actual object in the future. For example, if the route of a ship does not intersect the future prediction of a hurricane, this means that there is no chance that the ship will encounter the hurricane in the future. However, if the route crosses the hurricane s 69

70 future prediction, a number of possibilities can happen. The ship will either cross, meet, or avoid the hurricane all together. There are two interesting questions here that we need to investigate: (1) What are the different types of possible interactions between the actual objects in the future given an interaction between their future predictions? and (2) How much of a chance that the objects will interact in the future? The problem of the first question is similar to the problem of inferring the set of potential topological relationships between two spatial objects given the topological relationship between their bounding boxes as described in [10]. However, a future prediction is not a bounding box. In fact, at any instant of a prediction, a moving object can be anywhere within its prediction. This allows plenty of freedom for any possible configuration of the object within its prediction, more specifically, within any divisible part of the interior of its prediction. This means that for an interaction between two predictions where the interiors of the predictions intersect, all possible types of interaction are possible between the actual objects. On the other hand, if the interiors of the predictions do not intersect but their boundaries intersect, the actual moving objects can either interact by sharing their boundaries or be disjoint. Finally, if the predictions are disjoint, this implies that the actual moving objects will be disjoint as well. Table 3-6 summarizes these interaction inferences. Table 3-6. Inferring the types of interaction between actual objects from the types of interaction between their predictions. Prediction Interactions Possible Object Interactions interior intersection any interaction possible boundary intersection boundary intersection, disjoint disjoint disjoint In order to answer the second question, let us consider each type of prediction interactions. For disjoint predictions, it is guaranteed that the object will be disjoint. Thus the chance of interaction in this case is 0. For predictions with boundary intersection, the chance of the actual objects sharing their boundaries at this intersection is proportional to the product of the point-set confidence values of the intersection with respect to each object. This quantity is an infinitely small positive number approaching 0 since the dimension of the boundary intersection is always 70

71 smaller than the dimension of the prediction. But there is still a possibility that the boundary intersection interaction can occur between the actual objects. Similarly, in the case of predictions with interior intersection, the chance that the actual objects will interact at this intersection is proportional to the product of the point-set confidence values of the intersection of each prediction. However, this quantity here is a meaningful quantity since each of the point-set confidence values is a meaningful value. It is important to note that this quantity does not indicate the probability of the interaction between the actual objects, but merely represents the probability of both objects being in the intersection. But it is reasonable to say that the higher the probability of both objects being in the intersection, the higher the chance that they will interact with one another. We use the operation interaction potential for this purpose. The result of this operation is of type τ(real) indicating the temporally dependent value of the chance that the objects will be in the proximity (intersection) where interaction is possible. To determine whether there is a possibility of interaction thus distinguishing the interior intersection and boundary intersection cases from the disjoint case, we use the predicate interaction possible. By using the combination of these operations together with the binary predicate operation, one can obtain the uncertainty information of future interactions between moving objects. 3.5 Querying Using the Moving Balloon Algebra To illustrate the query language resulting from our design, we first present how the query procedure works by specifying the interoperability between our Moving Balloon Algebra and prediction models in Section Then we discuss how our data model supports different types of spatiotemporal queries in Section Interoperating with Prediction Models The concept of separating domain specific prediction modeling from moving object data modeling in databases allows us to design a generic moving balloon data model which can be used with any prediction model as long as it provides appropriate access operations for retrieving prediction data. These operations include the point conf and pointset conf operations. The 71

72 signature for these operations is shown below. point conf : C(α) point instant real pointset conf : C(α) β instant real These two operations represent the connection point between our Moving Balloon Algebra and domain specific prediction models. They are prediction model specific, and thus are required to be provided by prediction models. Furthermore, they are used as a foundation for supporting many other high level, prediction-related operations. There are at least two types of prediction models, probability based models and fuzzy-based models, which can be used in conjunction with our Moving Balloon Algebra. Therefore, in order to pose queries that require retrievals of prediction data, we must first indicate the appropriate prediction model to be used. For example, assuming that we have a moving balloon object of type mω(point,region) representing a ship moving in an ocean. We can pose a query on this object as follows: USE Probability_Prediction_Model SELECT pointset_conf(future_proj(val(final(ship.movement))),queryregion.region,now()+3h) FROM Ship, QueryRegion WHERE Ship.name = SuperFreighter and QueryRegion.name = RestrictedZone1 Note that in this query, we use the pointset conf operation as it is applied to the future prediction data type ϕ(region). This operation in turn invokes the pointset conf operation for C(region) which must be provided by the specified Probability Prediction Model Spatiotemporal Queries Traditionally, database queries are typically processed and answered using the current state of the database, that is, the database state at the time the queries are entered (the concept of a database state and database history is described in [60]). However, in spatiotemporal databases, this is not necessarily always the case. Spatiotemporal databases manage temporally dependent objects such as moving objects which are continuously changing. Thus, movement histories and predictions can be stored such that they can be used to answer queries at different states of 72

73 the database. As defined in [60], there are three types of spatiotemporal queries: instantaneous, continuous, and persistent queries. The same query can be entered as instantaneous, continuous, or persistent, producing different results in each case. An instantaneous query entered at time t is evaluated based on the current database state at t whereas a continuous query entered at time t is a sequence of instantaneous queries at time t > t evaluated at each time t. On the other hand, a persistent query entered at time t is a sequence of instantaneous queries at time t that are evaluated at each time t > t for which the database is updated. These query types can be supported through the use of a Future Temporal Logic (FTL) query language as described in [60]. All that is needed to support these query types is an implementation of an FTL query processor on top of our Moving Balloon Algebra. This is possible only if our algebra satisfies all the data model requirements of FTL. It turns out that this is the case. FTL requires a data model that can represent future developments of moving objects and that access to future states of moving objects is available. Our Moving Balloon Algebra provides this functionality through the use of a future prediction data type. In fact, the algebra offers much more data model support than that is needed by FTL including historical movements as well as future uncertainty. As an example, consider a scenario in which the U.S. coast guard rescue team needs to know about all small ships with less that 100 feet in length which will intercept the storm Albert within the next 3 hours. This query can be entered in FTL as follows: RETRIEVE ship WHERE ship.length < 100 AND storm.name = Albert AND Eventually_within_3h Inside(ship.position,storm.extent) Here the ship is modeled as a moving balloon point with a moving point prediction, and the storm is modeled using a moving balloon region with a moving region prediction. The temporal operator Eventually within c (g) asserts that the predicate g will be satisfied within c time units from the current instant. If the query is entered as an instantaneous query, the result will include all less-than-100-feet ships that will be inside the storm within 3 hours from the current instant. However, if the query is entered as a continuous query, this query will be evaluated continuously as time moves on. The result will also include other small ships that do not satisfy the criteria 73

74 at the time of the query being entered, but satisfies the criteria at some future time. This kind of continuous queries is similar to the concept of a database trigger which is useful for monitoring certain conditions such that appropriate actions can be initiated. Besides these query types, our data model design offers many new functionalities including querying about the uncertainty of future predictions as well as the accuracy of such predictions. For the purpose of illustrate these functionalities, we use a simple SQL like query language. Consider an application scenario of a hurricane prediction. The movement of the eye of a hurricane can be modeled as a moving balloon point with a moving region type prediction, that is, an mballoon pr object. For the extent of the hurricane force wind, we model its movement using an mballoon rr object. For cities, we represent their geography by a region object. Hence, we have the following relations: hurricanes(name:string, eye:mballoon_pr, extent:mballoon_rr) cities(name:string, geography:region) Figure Movement of the eye of hurricane Katrina. Assuming that these relations have been previously populated with all necessary data. For the purpose of our example, assume also that hurricane Katrina is currently making its way across the Gulf of Mexico (Figure 3-14). We can ask a query about the future prediction of the hurricane What area will potentially be affected by the eye of hurricane Katrina at 12 hours from now? 74

75 SELECT val(atinstant(future_proj(val(final(eye))),now()+12h)) FROM hurricanes WHERE name="katrina" Following the same trend, the total area that may be affected by the hurricane force wind at any time in the future can be determined by using the traversed operation on the final prediction of the extent of the hurricane. Beyond these queries, we can also ask questions relating to the degree of confidence such as What is the chance that Katrina s eye will be on the city of New Orleans 24 hours from now? SELECT pointset_conf(val(future_proj(val(final(eye)))),geography,now()+24h) FROM hurricanes, cities WHERE hurricanes.name="katrina" AND cities.name="new Orleans" Assume that a meteorologist needs to analyze existing hurricane prediction data. She can, for example, ask for all the hurricanes that have had any bad prediction for their eye movements. The has bad prediction operation can be used for this purpose. SELECT hurricanes.name FROM hurricanes WHERE has_bad_prediction(eye) More interestingly, she can also determine the accuracy of a specific prediction, say Katrina s prediction made 48 hours ago, at a specific time, say 1 hour ago. She can even compare this data with the same data from a more recent prediction, say a prediction made 24 hours ago. This allows her to verify whether, and to what degree, the prediction accuracy increases over time. The ability to do this can help her in making necessary adjustments to the prediction model. SELECT accuracy_at(eye,now()-48h,now()-1h), accuracy_at(eye,now()-24h,now()-1h) FROM hurricanes WHERE hurricanes.name="katrina" Other than these operations, we can also use spatiotemporal predicates between moving balloon objects. A number of approaches have been proposed for specifying and using spatiotemporal predicates in queries. One solution is to use the spatiotemporal query language (STQL) [20] to support textual specifications of spatiotemporal predicates. STQL allows us to textually formulate spatiotemporal queries that involve the use of spatiotemporal predicates. To illustrate 75

76 how spatiotemporal predicates between moving balloon objects can be used, consider the scenario of airplanes which can be modeled as mballoon pp objects due to their well defined routes. We can create the corresponding relations for these objects. airplanes(flightno:string, flight:mballoon_pp) We may want to divert all airplanes whose flight will potentially cross the projected extent of hurricane Katrina. This query requires the use of a spatiotemporal predicate potentially cross between moving balloon objects. For the purpose of this example, we assume that this predicate has been defined between moving balloon objects of type mballoon pp and mballoon rr. SELECT flightno FROM airplanes, hurricanes WHERE hurricanes.name="katrina" AND potentially_cross(flight, extent) Another approach for using spatiotemporal predicates between balloon objects in queries is to employ the visual query language [23, 21]. This visual language allows a convenient and intuitive graphical specification of spatiotemporal predicates as well as provides support for the formulation of spatiotemporal queries with these predicates. 76

77 CHAPTER 4 DISCRETE MODEL OF THE MOVING BALLOON ALGEBRA In this chapter, we describe how we can define a finite representation for all the data types of the abstract model of the Moving Balloon Algebra. The main idea behind this chapter is to determine a finite set of information (that is, defined by a discrete type) which can be used to represent an infinite set of values (that is, defined by an abstract type). For example, we can represent a segment which consists of an infinite set of points by two endpoints which is a finite set of information; yet we can interpolate these two endpoints to obtain any points on the segment. To define a finite representation for the Moving Balloon Algebra, we must define a discrete type for each abstract type of the algebra. In doing so, our approach is to start from the bottom, most basic level of the algebra s data type hierarchy and work our way to the top. We describe a finite representation for non-temporal data types of the algebra in Section 4.1. For movement over time, we make use of a concept called sliced representation to define a finite representation for basic spatiotemporal data types in Section 4.2. Finally, we show how the balloon data types and spatiotemporal balloon data types can be finitely represented in Section 4.3. The work in this chapter has been included in one of our technical reports [52] in preparation for a journal submission. 4.1 Non-Temporal Data Types Non-temporal data types include base data types, time data types, and spatial data types. We described their finite representation in the following subsections Base Data Types and Time Data Types Base data types such as int, real, string, and bool normally have their corresponding discrete types directly implemented in programming languages. The time data type instant can be implemented using the real number implementation to express the continuous time domain. All of the data types includes the undefined value denoted by which represents the empty object. The empty object is needed to represent the case that an operation yields an empty result. For example, the intersection of two parallel segments yields an empty object. Therefore, any 77

78 operation such as distance involving this empty object would yield an empty value. We defined the discrete data types for these base data types in Definition 4.1. Definition 4.1 : Let int, real, string, and bool be the programming language types provided for integers, real numbers, strings, and boolean values respectively. The discrete data types int, real, string, bool, and instant are defined as: int = int { } real = real { } string = string { } bool = bool { } instant = real { } Another time data type is the interval data type. We can represent a time interval by its endpoints l (left) and r (right) and two boolean flags lc and rc indicating whether it is left-closed and right-closed respectively. We define the type interval in Definition 4.2. Definition 4.2 : The type interval is defined as: interval = {(l,r,lc,rc) l,r instant,lc,rc bool,l r,(l = r) (lc = rc = true)} Between two intervals, we are interested in two types of relationships namely disjointedness and adjacency. We define interval relationships r disjoint (right disjoint), disjoint, r adjacent (right adjacent), and adjacent in Definition 4.3. Definition 4.3 : Given two time intervals i = (l i,r i,lc i,rc i ) and j = (l j,r j,lc j,rc j ), we define their dis joint and ad jacent relationships as follows: r dis joint(i, j) r i < l j (r i = l j (rc i lc j )) dis joint(i, j) r dis joint(i, j) r dis joint( j,i) r ad jacent(i, j) dis joint(i, j) (r i = l j (rc i lc j )) ad jacent(i, j) r ad jacent(i, j) r ad jacent( j,i) 78

79 With these interval relationships, we can define, in Definition 4.4, a finite set of time intervals (an interval set) such that it has a unique and minimal representation. Definition 4.4 : The type interval set is defined as: interval set = {U interval (i, j U i j) dis joint(i, j) ad jacent(i, j)} Interval sets are useful for representing time periods of movements. For example, they are used as the return values for the lifespan operation which determines the time periods during which a movement is defined Spatial Data Types Based on the abstract model of spatial data types given in [59], a finite representation for spatial data types such as point, line, and region have been studied in our implementation of topological predicates between complex spatial objects [54, 51]. Here, we give an overview of this representation. Recall that the type point represents complex points (that is, collections of single points). Hence, we first define how a single point, represented by the type poi, can be described. In two-dimensional Euclidean space, a single point can be described by a pair of coordinates (x,y) as shown in Definition 4.5. Definition 4.5 : The type poi is defined as: poi = {(x,y) x,y real} { } In Definition 4.6, a value of the type point is simply define as a set of single points. Definition 4.6 : The type point is defined as: point = 2 poi The type line and region can be described discretely by using linear approximations. A value of the type line is essentially a finite set of line segments. The abstract type described in [32] defines a line as a set of curves in the plane. We can discretely represent curves by polylines 79

80 which in turn are sets of line segments. However, we can also take a less structured view and represent a line by a set of line segments. Definition 4.7 shows how the type seg representing a line segment can be discretely defined by its two endpoints. Definition 4.7 : A line segment with two endpoints p and q is represented by the type seg which is defined as: seg = {(p,q) p,q poi, p < q} { } Now we can define the type line based on line segments as in Definition 4.8. Definition 4.8 : The type line is defined as: line = {S seg s,t seg : s t collinear(s,t) dis joint(s,t)} The predicate collinear determines whether two line segments are on the same infinite line in a plane. Thus, if there are such segments, they must be disjoint; otherwise, they can be merged into a single line segment. This ensures the uniqueness of the line representation. Figure 4-1 shows an example of a line object of the abstract model and its corresponding discrete representation. y y A x B x Figure 4-1. Representations of a line object. A) In the abstract model. B) In the discrete model. A region object can be represented discretely as a collection of polygonal faces with polygonal holes. They are defined based on the concept of cycles. A cycle is a simple polygon and is defined in Definition

81 Definition 4.9 : The type cycle is defined as: cycle = {S seg (i) (ii) n 3, S = n s,t S : s t i intersect(s,t) touch(s,t) (iii) p points(s) : card(p,s) = 2 (iv) s 0,...,s n 1 : {s 0,...,s n 1 } = S ( i {0,...,n 1} : meet(s i,s (i+1) mod n ))} The predicate i intersect checks whether two segments intersect in their interior. Two segments touch if an endpoint of a segment lies in the interior of the other segment. The function points(s) returns all the endpoints of the segments in S, thus points(s) = {p poi s S : s = (p,q) s = (q, p)}. The number of occurrence of an endpoint p in S is given by the function card(p, S) = {s S s = (p, q) s = (q, p)}. Therefore, a cycle is (i) a collection of 3 or more segments where (ii) no segments intersect or touch one another, (iii) each endpoint occurs in exactly two segments, and (iv) all the segments together form a single cycle. Using the definition of cycle, we define, in Definition 4.10, a face as a pair consisting of an outer cycle and a set of 0 or more hole cycles. Definition 4.10 : The type face is defined as: f ace = {(c,h) (i) (ii) c cycle,h cycle h H : edge inside(h,c) (iii) h 1,h 2 H : h 1 h 2 edge dis joint(h 1,h 2 ) (iv) any cycle that can be formed from the segments of c or H is either c or one of the cycles of H} A cycle c is edge-inside another cycle d if its interior is a subset of the interior of d and no edges of c and d overlap. They are edge-disjoint if their interiors are disjoint and their edges do not overlap. However, in both case, their edges may touch at single points. The last condition (iv) 81

82 ensures unique representation, that is, it does not allow a face to be decomposed into two or more edge-disjoint faces. A region is then defined in Definition 4.11 as a set of edge-disjoint faces. Definition 4.11 : The type region is defined as: region = {F f ace f 1, f 2 F : f 1 f 2 edge dis joint( f 1, f 2 )} Two faces are edge-disjoint if either their outer cycles are edge-disjoint, or one of the outer cycles is edge-inside one of the holes of the other face. Thus, two faces in a region may touch each other at single, isolated points but must not have overlapping edges. Figure 4-2 shows an example of a region object in both abstract and discrete representation. y y A x B x Figure 4-2. Representations of a region object. A) In the abstract model. B) In the discrete model. 4.2 Basic Spatiotemporal Data Types For a finite representation of spatiotemporal data types, we use the sliced representation concept as introduced in [25]. The idea is to represent a movement of an object by a sequence of simple movements called slices or temporal units. A temporal unit of a moving data type α is a maximal time interval where values taken by an instant of α can be described by a simple function. Thus, a temporal unit represents the evolution of a value v of some type α in a given time interval i while maintaining type-specific constraints during such evolution. Figure 4-3A shows a temporal unit of a moving point object consisting of two point moving independently. Each temporal unit is a pair (i,v), where i is called the unit interval and v is called the unit 82

83 function. In Definition 4.12, temporal units are described as a generic concept to formulate the definition of the sliced representation. Their specialization to various data types is provided in the next subsections where we define unit types such as ureal, upoi, upoint, uline, and uregion. Definition 4.12 : Let S be a set of unit function representations. The temporal unit type of S is defined as: unit(s) = interval S time time y y A x B x Figure 4-3. A discrete representation of a moving point object. A) A temporal unit. B) A sliced representation. The sliced representation is provided by a mapping type constructor which represents a moving object as a sequence of temporal units. Its type depends on the type of the temporal units (that is, the unit type). Figure 4-3B illustrates a slice representation with three temporal units or slices for a moving point object. We define the mapping type constructor in Definition Definition 4.13 : Let U be a temporal unit type. The temporal evolution of a moving object based on the unit type U is a mapping of U and is defined as: mapping(u) = { (i 1,v 1 ),(i 2,v 2 ),...,(i n,v n ) (i) j {1,...,n} : (i j,v j ) U (ii) j {1,...,n 1} : r dis joint(i j,i j+1 ) (iii) j {1,...,n 1} : ad jacent(i j,i j+1 ) v j v j+1 } Condition (i) requires that each unit of the slice representation is of the same unit type U. Condition (ii) imposes a restriction that each unit must be right disjoint with respect to the next 83

84 unit in the sequence. Condition (iii) requires that any two consecutive, adjacent units must have different unit function representations. This ensures a unique and minimal representation since two adjacent units with the same unit function representation can be merged into a single unit over the combined unit interval. By defining this mapping type constructor, we can construct discrete spatiotemporal data types for all of our abstract types. For instance, assuming that we have temporal unit types upoint, uline, and uregion (which we will define later in the next section), we can construct discrete spatiotemporal data types mapping(upoint), mapping(uline), and mapping(uregion) to represent moving point, moving line, and moving region objects respectively. Although this is somewhat straight forward, we must be careful to ensure that each temporal unit describes a valid development of a moving object. Since temporal units describe certain simple functions of time, we define, in Definition 4.14, a generic function ι on each unit type to evaluate the unit function at a given time instant. This function is essential for defining semantic requirements of each unit type as we will see later. Definition 4.14 : Let α be a non-temporal type (for example, point), and u α be the corresponding unit type (for example, upoint) with u α = interval S α, where S α is a suitably defined set of unit function representations for α. The function ι α is defined as: ι α = S α instant α The function ι allows us to express constraints on the structure of a unit in terms of the constraints on the structure of the corresponding non-temporal value. It also serves as a basis for the implementation of the atinstant operation on the unit Temporal Units for Base Types Unlike the domain of the real type which is continuous, the domains of the types int, string, and bool are discrete in nature. This means that a value of these domains can only change in discrete steps. For this reason, we introduce a type constructor const in Definition 4.15 that produces a temporal unit for a non-temporal type α. 84

85 Definition 4.15 : Let α be a non-temporal type. The constant unit type of α is defined as: const(α) = interval α { } A unit is not allowed to contain an undefined or empty value since for such interval, we can simply let no unit exist within a mapping. The type constructor const is used for defining temporal unit for int, string, and bool. However it can also be applied to other data types for applications where values of such types change only in discrete steps. The value of a constant unit function of value v at any time instant t of a unit is trivially given by ι(v,t) = v. For the real type, we introduce a unit type ureal in Definition 4.16 for the representation of moving real numbers within a temporal unit. To balance the trade-off between the expressiveness and simplicity of the representation, the simple function for this unit type is chosen to be either a polynomial of degree less than or equal to two or a square root of such a polynomial. Such square root functions are required to express the time-dependent distance functions in Euclidean metric. Thus, with this choice, one can implement the temporally lifted versions of the size, perimeter, and distance operations. Definition 4.16 : The unit type ureal is defined as: ureal = interval {(a,b,c,r) a,b,c real,r bool} The evaluation of a unit function of ureal is given as: at 2 + bt + c if r ι((a,b,c,r),t) = at 2 + bt + c if r Temporal Units for Spatial Data Types The temporal evolution of spatial objects is characterized by its continuity and smoothness properties similar to that of the real numbers and can be approximated in various ways. Although complex functions like polynomials of degree higher than one can be used as the basis of representation, to strike the balance between richness and simplicity of representation, we make 85

86 the design decision to base our approximations of the temporal behavior of moving spatial objects on linear functions. This ensures simple and efficient representation for the data types and a manageable complexity of algorithms. In order to describe the permitted behavior of moving spatial objects within a temporal unit, we need to specify how type-specific constraints are satisfied during such unit. We require that constraints are satisfied only during the respective open interval of a unit interval since the endpoints of a unit interval indicate a change in the description of the movement. For example, a collapse of components of a moving object can occur at the endpoints of the unit interval. Similarly, a birth of a new component can also occur at the beginning of a unit interval. This is completely acceptable since one of the reasons for the introduction of the sliced representation is to have simple and continuous description of the moving value within each unit interval and to limit discontinuities in the description to a finite set of instants. Thus, the sliced representation concept also allows one to model appearances and disappearances of object components at endpoints of intervals. This means that the sliced representation can also represent event points which are instances when the temporal function of a moving object is eventφ-discontinuous as specified in the abstract model. In this section, we define temporal unit types upoint, uline, and uregion. They are used to construct the spatiotemporal mappings mapping(upoint), mapping(uline), and mapping(uregion) which describe a finite representation for the basic spatiotemporal data types mpoint, mline, and mregion respectively Unit point Before we can define temporal units for point, we need to define how the temporal evolution of single points can be represented. We introduce a set MPoi which defines 3D lines that describe continuous, unlimited temporal evolution of 2D single points. MPoi = {(a x,a y,b x,b y ) a x,a y,b x,b y real} The 4-tuple (a x,a y,b x,b y ) is a representation of the linear functions of the coordinates of a single point over time such that (a x,a y ) is the position of the point at t = 0 and (b x,b y ) is the position of 86

87 the point at t = 1. The evaluation of this representation at an arbitrary time t is given by: ι((a x,a y,b x,b y ),t) = (a x + (b x a x )t,a y + (b y a y )t) t instant The unit type upoi for the temporal evolution of single points can then be defined in Definition Definition 4.17 : The unit type upoi is defined as: upoi = interval MPoi To describe a moving point (that is, a moving complex point), we define the unit type upoint in Definition Definition 4.18 : Let i = (l,r,lc,rc) interval, M MPoi and M 1. The unit type upoint is defined as: upoint = {(i,m) (i) (ii) t,l < t < r p,q M : p q ι(p,t) ι(q,t) s = e ( p,q M : p q ι(p,l) ι(q,l))} Condition (i) indicates that the type-specific constraint of a point object having distinct components (that is, single points) must be satisfied over the open interval of the unit. Condition (ii) requires that point units which are defined only in a single time instant have distinct components at that instant. An example of a unit point object is shown in Figure 4-3A. For a unit point (i,m), an evaluation at time t within the interval i is given by: ι(m,t) = {ι(m,t)} m M We assume that ι distributes through sets and tuples such that ι(m,t) is defined for any set M as shown above, and for a tuple r = (r 1,...,r n ), we have ι(r,t) = (ι(r 1,t),...,ι(r n,t)). 87

88 Unit line For moving lines, we introduce a unit type uline. Here, we restrict the movements of segments of a line such that during the unit interval of a line unit, each segment only moves along a plane. That is, segments are not allowed to rotate during their movement. Rotating segments create curved surfaces in 3D space which can be approximated by a sequence of plane surfaces. This constraint allows us to keep the representation simple and easy to deal with. Before we can define uline, we define a set MSeg as the set of all pairs of coplanar lines produced by a pair of moving single points in 3D space, which will be used to represent moving segments. MSeg = {(p,q) p,q MPoi, p q, p is coplanar with q} The definition of uline as shown in Definition 4.19 is based on a set of moving segments with the above restriction and which never overlaps at any instant within the respective open interval. Definition 4.19 : Let i = (l, r, lc, rc) interval, M MSeg and M 1. The unit type uline is defined as: uline = {(i,m) (i) (ii) t,l < t < r : ι(m,t) line { } l = r ι(m,l) line { })} Similar to the conditions for the definition of upoint, the first and second conditions above specify data type constraints for the open time interval and for the case where a unit is defined only at a single time instant respectively. Figure 4-4A shows an example of a valid uline object. Since ι distributes through sets and tuples, we can use ι(m,t) which represents the value of a unit line at a time instant t to define the structural constraint that requires this value to be a valid line composed of segments. For instance, condition (i) requires that, at each time instant t of the 88

89 time time y y A x B x Figure 4-4. Representing a moving line object. A) A uline value. B) A discrete representation of a moving line object. open interval, we can obtain a segment from each of the moving segments of M. t,l < t < r (p,q) M : (ι(p,t),ι(q,t)) Seg It is clear that the semantic of uline can be expressed using the ι function for the open interval. However, at the endpoints of an interval, a special consideration is needed since, in these points, moving segments can degenerate into points and different moving segments can merge or split as shown in Figure 4-4A. To handle these situations, a regularization process is needed. We define a separate ι functions denoted by ι l which removes from ι(i,m) segments that have the same left and right endpoints (that is, segments degenerated into a single point) and merge overlapping segments into maximal ones (this is defined by a merge segs function). Let ((l,r,lc,rc),m) uline. Then, the instantiation of this unit at a time instant t of the interval is defined as: ι l (M,t) = merge segs({(p,q) ι(m,t) p < q}) An example of a discrete representation of a moving line object containing a single unit line is shown in Figure 4-4B. It is important to note that even though we restrict the moving segment representation such that segments of a line cannot rotate, rotation can be approximated by triangulation since moving segments are allowed to degenerate. Thus, many possible mappings 89

90 exist between segment endpoints of the lines at the start and the end of a unit line interval as long as the non-rotating constraint is satisfied. To get a better approximation, this unit can be divided into smaller units by introducing additional internal instants along with their discrete representations. It can be easily seen that arbitrary precision of representation can be achieved with this approach Unit region To represent a temporal unit of a moving region, we introduce the unit type uregion. Similar to line, the fundamental of the discrete representation of the region data type is also based on segments. Thus, we can employ the same restriction on moving segments as for uline where rotation of segments within unit intervals is not permitted. Therefore, we can base our definition of uregion on the same set of all coplanar pairs of lines, that is, MSeg, with additional constraints to ensure that we always obtain a valid region throughout the entire unit (validity constraints). An example of a valid uregion value (with allowable degeneracies) is illustrated in Figure 4-5. Following the same structured approach for defining the region data types, we can define a time y Figure 4-5. Example of a uregion value. x uregion based on the concept of moving cycle (MCycle) and moving face (MFace). However, we do not need to specify the validity constraints on MCycle and MFace here as this will be done directly in the uregion definition. We introduce the sets MCycle and MFace to describe the 90

91 moving version of a cycle and a face respectively, without any restriction on time. MCycle = {S MSeg S 3} MFace = {(c,h) c MCycle,H MCycle} We can now define uregion in Definition Definition 4.20 : Let i = (l, r, lc, rc) interval, F MFace. The unit type uregion is defined as: uregion = {(i,f) (i) (ii) t,l < t < r : ι(f,t) region { } l = r ι(f,l) region { }} For the endpoints of the unit interval, we again need to perform a regularization process by providing a separate function ι r to obtain a valid region value and handle the degeneracies. This function works as follows. Evaluate ι(f,l) or ι(f,r) and remove all pairs of points (p,q) (segments) that are not valid segments. Then, for all collections of overlapping segments, partition all participating segments into fragments (for example, two overlapping segments (p,q) and (r,s) with the endpoints ordered on the line as < p,r,q,s > produce fragments (p,r), (r,q), and (q,s)). For each fragment, if the number of segments containing it is even, remove the fragment; otherwise, treat this fragment as a new segment of the result. 4.3 Balloon Data Types and Spatiotemporal Balloon Data Types Having defined a finite representation for the basic spatiotemporal data types, we can now use this concept to define a finite representation for the balloon data types in Section as well as the spatiotemporal balloon data types in Section Balloon Data Types Since the balloon data types are composed of historical movement and future prediction data types, we will discuss these data types first. The historical movement data types such as hpoint, hline, and hregion are defined based on basic spatiotemporal data types such as mpoint, mline, 91

92 and mregion respectively. Therefore, the sliced representation for the basic spatiotemporal data types is sufficient to represent the historical movement data types. For the future prediction data types, only the geometry aspect of future predictions is relevant here since the representation of the confidence distribution aspect is domain-specific and can be assumed to be given by prediction models. The geometry aspect of the future prediction data types is defined using the basic spatiotemporal data types. Hence, their discrete representation is the same, that is, they can also be discretely represented using the sliced representation concept. A balloon data type which consists of both historical movement and future prediction information can then be described as a spatiotemporal mapping of both the historical part and the predicted part such that the mapping of the historical part precedes that of the predicted part. In other words, the last unit interval of the historical part must be r disjoint with the first unit interval of the predicted part. This spatiotemporal mapping for a balloon object is formally defined in Definition Definition 4.21 : Let mapping(uα) and mapping(uβ) be the sliced representations for a historical movement based on a unit type uα and a future prediction based on a unit type uβ respectively for a balloon object of type Ω(α,β). The sliced representation of this balloon object is a mapping mapping(uα,uβ) which is defined as: mapping(uα,uβ) = { (i 1,v 1 ),(i 2,v 2 ),...,(i n,v n ),(i n+1,v n+1 ),...,(i n+m,v n+m ) (i) (ii) (i 1,v 1 ),(i 2,v 2 ),...,(i n,v n ) mapping(uα) (i n+1,v n+1 ),...,(i n+m,v n+m ) mapping(uβ) (iii) r dis joint(i n,i n+1 )} This representation describes a balloon object as a sequence of n + m temporal units where the first n units represent its historical movement (condition (i)) and the last m units represent its future prediction (condition (ii)). Finally, the constraint that the history part must precede the future prediction part is specified in condition (iii). 92

93 4.3.2 Spatiotemporal Balloon Data Types At the highest level of the Moving Balloon Algebra type system, we have the spatiotemporal balloon data types. These data types describe the temporal development of balloon objects. Thus, we can also say that they describe the temporal development of movement history as well as future prediction with the constraint that, at any instant of this development, the movement history and the future prediction, if available, together form a valid balloon object. This allows us to treat the development of each part separately. As mentioned in the abstract concept, the development of the movement history is a historical accumulation phenomenon which means that, as an object moves or evolves over time, new movement information is appended to the existing movement history. Thus, the movement history at each time instant t in the past is a part of the current history. That is, it is the history starting from the beginning instant up to the instant t. Therefore, it is sufficient to represent the development of movement history by the latest known movement history and providing an appropriate, separate instantiation function ι h α (as opposed to ι α which retrieve the position or extent value) to obtain the movement history at any time instant t of the development. Let uα be a unit type of a spatial type α. The development of movement history is discretely represented as a sliced representation of a unit type uα with an ι h α function defined as: ι h α = mapping(uα) instant mapping(uα) The function ι h α allows us to express constraints on a development of movement in terms of the constraints on the corresponding movement value. In a way, it also serves as a basis for the implementation of the atperiod operation. The second part of the spatiotemporal balloon data types is the temporal development of future prediction. Since each future prediction is provided by a prediction model which is a concept outside the control of the algebra, we cannot make any assumption on the continuity aspect between different predictions. However, we can safely assume that each prediction is discretely made with respect to a specific time instant and provided by a prediction model either 93

94 on a regular basis or on a request basis. In any case, each prediction is to be stored and managed in databases such that they can be later retrieved and used in query for various analysis. This approach allows us to maintain a collection of predictions made over the past which may no longer be available to be requested from a prediction model since this model may be tweaked and modified over time by domain experts. Therefore, the development of the future prediction part of a moving balloon object can be represented by a finite sequence of future predictions, each made at a specific time instant of the history. Definition 4.22 formally describes a finite representation of a development of prediction. Definition 4.22 : Let a pair (t,mapping(uα)) represents a prediction of the unit type uα with respect to a time instant t. The development of the future prediction of the unit type uα, denoted by mprediction(uα), is defined as: mprediction(uα) = { (t 1, p 1 ),(t 2, p 2 ),...,(t n, p n ) i {1,2,...,n} : (i) (ii) t i instant p i mapping(uα) (iii) i < n t i < t i+1 } Since this development of future prediction is a finite sequence of discrete values of prediction, an instantiation of the development at any time instant other than those specified would return an empty value. However, in query where the future prediction at time t of a moving object is need, one can choose to use the most current prediction available whose prediction period contains t. This is because each prediction is produced to describe the future prediction of an object s movement for a certain period of time. By discretely representing the development of the movement history and the future prediction, we effectively obtain a representation for a moving balloon object, as defined in Definition 4.23, which is a combination of the two. 94

95 Definition 4.23 : A finite representation of the spatiotemporal balloon data types mballoon(α,β) is defined as: mballoon(uα, uβ) = mapping(uα) mprediction(uβ) This definition also requires a constraint that any instantiation at a time instant t of a moving balloon object results in a valid balloon object. This indicates that the instantiations at t of both parts of the object must together produce a valid balloon object. Having defined discrete data types for each of the abstract data types of our Moving Balloon Algebra, we can now use this discrete model as a specification to develop implementable data structures for supporting algorithmic design and implementation of operations. 95

96 CHAPTER 5 IMPLEMENTATION MODEL OF THE MOVING BALLOON ALGEBRA In the implementation model, we are interested in how we can implement the finite representation set forth in the discrete model. Thus, we are interested in defining data structures for each data types of the algebra as well as algorithms for operations and predicates. Since the implementation of spatiotemporal data types and spatiotemporal predicates requires the use of spatial data types and topological predicates, we first present our data structures for spatial data types and spatiotemporal data types (Section 5.1). Then, we present our topological predicate implementation including the algorithms for determining the topological relationship between two spatial objects 1 (Section 5.2). These algorithms are then used to support the implementation of spatiotemporal predicates between moving objects (Section 5.3) which in turn is the basis for implementing balloon predicates (Section 5.4). Since the algebra is to be made available for use in a database system, we also describe our mechanism for integrating the algebra into a DBMS (Section 5.5). Finally, we provide a case study describing an application of our algebra in the field of hurricane research (Section 5.6). 5.1 Data Structures In this section, we describe how we can translate the concepts specified in the discrete model into appropriate data structures for implementation in a database system. The discrete representation of the Moving Balloon Algebra is in fact a high level specification of such data structures. The design of the data structures is also influenced by the context of the system where the data structures are to be implemented as well as the efficiency requirements of algorithms to be supported. We begin with some general requirements of the data structures due to their use in a database context. Then, we proceed to define data structures for spatial data types and finally spatiotemporal data types. 1 Our research work on the efficient implementation of topological predicates has been published in two journal articles [51, 54]. 96

97 5.1.1 General Requirements of Database-Compatible Data Structures Data structures for spatial and spatiotemporal data types have to satisfy a number of special requirements. First, it is our goal that the data structures implementing the data types are to be used in a database system to represent attribute data types within some data model implementation. Thus, data are placed into memory under control of the DBMS. This means that one should not use main memory pointers in the design, and that the representations should allows easy movements of the data between secondary and main memory. These requirements can be fulfilled by implementing each data type using DBMS large objects (LOB) which may consist of a number of fixed size components and arrays for varying size components. All references are internal references with respect to a LOB. Second, our spatial and spatiotemporal data types are set-valued. This requires that a unique order is defined on the set domains and to store elements in the array in that order. Two spatial or spatiotemporal values, respectively, are equal if their array representations are equal. This enables efficient comparisons. Third, the data structure design is also affected by the requirement of the algorithms. For instance, in spatial data model, algorithms based on the plane sweep paradigm are essential for efficient implementation of topological predicates and set operations. These algorithms requires a data structure with data points or segments in lexicographical order. We describe data structures for spatial data types in Section In spatiotemporal data model, the algorithm for the atinstant operation is the most fundamental, and it is the foundation for implementing many other operations. Hence, it is important to consider the efficiency of this operation in the design of the data structures. For this reason, the data structures for spatiotemporal data types are designed with the temporal unit as the major order such that a search in the temporal domain can be done efficiently. We describe this aspect in more detail in Section Data Structures for Spatial Data Types At the lowest level, we assume a number system Ω ensuring robust geometric computation, for example, by means of rational numbers allowing value representations of arbitrarily, finite 97

98 length, or by means of infinite precision numbers. At the next higher level, we introduce some two-dimensional robust geometric primitives that we assume to be implemented on the basis of Ω. The primitives serve as elementary building blocks for all higher-level structures and contribute significantly to their behavior, performance, and robustness. All objects of robust geometric primitive types are stored in records. Here, we define the robust geometric primitive types poi2d and seg2d which correspond the discrete type poi and seg. The type poi2d incorporates all single, two-dimensional points we can represent on the basis of our robust number system. That is, this type is defined as poi2d = {(x,y) x,y Ω} {ε} The value ε represents the empty object as described in the discrete model and is an element of all data types. Given two points p,q poi2d, we assume a predicate = (p = q p.x = q.x p.y = q.y) and the lexicographic order relation < (p < q p.x < q.x (p.x = q.x p.y < q.y)). The type seg2d includes all straight segments bounded by two endpoints. That is seg2d = {(p,q) p,q poi2d, p < q} {ε} The order defined on the endpoints normalizes segments and provides for a unique representation. This enables us to speak of a left end point and a right end point of a segment. The predicates on,in : poi2d seg2d bool check whether a point is located on a segment including and excluding its endpoints respectively. The predicates poiintersect,segintersect : seg2d seg2d bool test whether two segments intersect in a point or a segment respectively. The predicates collinear, equal, disjoint, meet : seg2d seg2d bool determine whether two segments lie on the same infinite line, are identical, do not share any point, and touch each other in exactly one common endpoint respectively. The function len : seg2d real computes the length of a segment. The type real is our own approximation type for the real numbers and implemented on the basis of Ω. The operation poiintersection : seg2d seg2d poi2d returns the intersection point of two segments. 98

99 The type mbb2d comprises all minimum bounding boxes, that is, axis-parallel rectangles. It is defined as mbb2d = {(p,q) p,q poi2d, p.x < q.x, p.y < q.y} {ε} Here, the predicate disjoint : mbb2d mbb2d bool checks whether two minimum bounding boxes are disjoint; otherwise, they interfere with each other. At the next higher level, we assume the geometric component data type halfsegment2d that introduces halfsegments as the basic implementation components of objects of the spatial data types line2d and region2d. A halfsegment, which is stored in a record, is a hybrid between a point and a segment. That is, it has features of both geometric structures; each feature can be inquired on demand. We define the set of all halfsegments as the component data type halfsegment2d = {(s,d) s seg2d {ε}, d bool} For a halfsegment h = (s,d), the Boolean flag d emphasizes one of the segment s end points, which is called the dominating point of h. If d = true (d = false), the left (right) end point of s is the dominating point of h, and h is called left (right) halfsegment. Hence, each segment s is mapped to two halfsegments (s,true) and (s,false). Let dp be the function which yields the dominating point of a halfsegment. The representation of line2d and region2d objects requires an order relation on halfsegments. For two distinct halfsegments h 1 and h 2 with a common endpoint p, let α be the enclosed angle such that 0 < α 180. Let a predicate rot be defined as follows: rot(h 1,h 2 ) is true if, and only if, h 1 can be rotated around p through α to overlap h 2 in counterclockwise direction. This enables us now to define a complete order on halfsegments. For two halfsegments h 1 = (s 1,d 1 ) and h 2 = (s 2,d 2 ) we obtain: h 1 < h 2 dp(h 1 ) < dp(h 2 ) (case 1) (dp(h 1 ) = dp(h 2 ) (( d 1 d 2 ) (case 2a) (d 1 = d 2 rot(h 1,h 2 )) (case 2b) (d 1 = d 2 collinear(s 1,s 2 ) len(s 1 ) < len(s 2 )))) (case 3) 99

100 D D D D D D D D D D D D D D D D? = I A? = I A =? = I A >? = I A! Figure 5-1. Examples of the order relation on halfsegments: h 1 < h 2 Examples of the order relation on halfsegments are given in Figure 5-1. Case 1 is exclusively based on the (x,y)-lexicographical order on dominating points. In the other cases the dominating points of h 1 and h 2 coincide. Case 2a deals with the situation that h 1 is a right halfsegment and h 2 is a left halfsegment. Case 2b handles the situation that h 1 and h 2 are either both left halfsegments or both right halfsegments so that the angle criterion is applied. Finally, case 3 treats the situation that h 1 and h 2 are collinear. Two halfsegments h 1 = (s 1,d 1 ) and h 2 = (s 2,d 2 ) are equal if, and only if, s 1 = s 2 and d 1 = d 2. We will also need an order relation between a point v poi2d and a halfsegment h halfsegment2d. We define v < h v < dp(h) and v = h v = dp(h). This shows the hybrid nature of halfsegments having point and segment features. At the highest level, we have the three complex spatial data types point2d, line2d, and region2d (see Section for their intuitive description and [59] for their formal definition). They are the input data types for topological predicates and are essentially represented as ordered sequences of elements of variable length. We here ignore additionally stored information about spatial objects since it is not needed for our purposes. The type of the elements is poi2d for point2d objects, halfsegment2d for line2d objects, and attributed halfsegments (see below) for region2d objects. Ordered sequences are selected as representation structures, since they directly and efficiently support parallel traversals (Section ) and the plane sweep paradigm (see Section ). 100

101 We now have a closer look at the type definitions. Let N 0 := N {0}. We define the type point2d as point2d = { p 1,..., p n n N 0, 1 i n : p i poi2d {ε}, 1 i < n : p i < p i+1 } Since n = 0 is allowed, the empty sequence represents the empty point2d object. The spatial data type line2d is defined as line2d = { h 1,...,h 2n (i) n N 0 (ii) 1 i 2n : h i halfsegment2d (iii) h i = (s i,d i ) {h 1,...,h 2n } h j = (s j,d j ) {h 1,...,h 2n }, 1 i < j 2n : equal(s i,s j ) d i = d j (iv) 1 i < 2n : h i < h i+1 (v) h i = (s i,d i ),h j = (s j,d j ) {h 1,...,h 2n },i j : equal(s i,s j ) disjoint(s i,s j ) meet(s i,s j )} The value n is equal to the number of segments of a line2d object. Since each segment is represented by a left and a right halfsegment (condition (iii)), a line2d object has 2n halfsegments. Since n = 0 is allowed (condition (i)), the empty sequence represents the empty line2d object. Condition (iv) expresses that a line2d object is given as an ordered halfsegment sequence. Condition (v) requires that the segments of two distinct halfsegments are either equal (this only holds for the left and right halfsegments of a segment), disjoint, or meet. The internal representation of region2d objects is similar to that of line2d objects. But for each halfsegment, we also need the information whether the interior of the region is above/left or below/right of it. We denote such a halfsegment as attributed halfsegment. Each element of the sequence consists of a halfsegment that is augmented by a Boolean flag ia (for interior above ). If ia = true holds, the interior of the region is above or, for vertical segments, left of the segment. The type region2d is defined as 101

102 region2d = { (h 1,ia 1 ),...,(h 2n,ia 2n ) (i) n N 0 (ii) 1 i 2n : h i halfsegment2d,ia i bool (iii) h i = (s i,d i ) {h 1,...,h 2n } h j = (s j,d j ) {h 1,...,h 2n },1 i < j 2n : s i = s j d i = d j ia i = ia j (iv) 1 i < 2n : h i < h i+1 (v) additional topological constraints } Condition (v) refers to some additional topological constraints that all components (faces) of a region must be edge-disjoint from each other and that for each face its holes must be located inside its outer polygon, be edge-disjoint to the outer polygon, and be edge-disjoint among each other. We mention these constraints for reasons of completeness and assume their satisfaction. As an example, Figure 5-2 shows a line2d object L (with two components (blocks)) and a region2d object R (with a single face containing a hole). Both objects are annotated with segment names s i. We determine the halfsegment sequences of L and R and let h l i = (s i,true) and h r i = (s i,false) denote the left halfsegment and right halfsegment of a segment s i respectively. For L we obtain the ordered halfsegment sequence L = h l 4,hl 1,hr 4,hl 5,hl 7,hr 1,hl 2,hr 7,hl 8,hr 5,hl 6,hr 8,hr 6,hl 9,hr 2,hl 3,hr 9,hr 3 For R we obtain the following ordered sequence of attributed halfsegments (t true, f false): R = (h l 1,t),(hl 2, f ),(hl 3, f ),(hl 4,t),(hr 4,t),(hl 5,t),(hr 2, f ),(hl 6, f ),(hr 5,t),(hr 3, f ), (h r 6, f ),(hr 1,t) Since inserting a halfsegment at an arbitrary position needs O(n) time, in our implementation we use an AVL-tree embedded into an array whose elements are linked in halfsegment order. An insertion then requires O(logn) time. 102

103 I I 4 I & I ' I % I $ I $ I " I # I! I " I # I I! I Figure 5-2. A line2d object L and a region2d object R If we take into account that the segments of a line2d object as well as the segments of a region2d object are not allowed to intersect each other or touch each other in their interiors according to their type specifications, the definition of the order relation on halfsegments seems to be too intricate. If, in Figure 5-1, we take away all subcases of case 1 except for the upper left subcase as well as case 3, the restricted order relation can already be leveraged for complex lines and complex regions. In case that all spatial objects of an application space are defined over the same realm 2 [30, 57], the restricted order relation can also be applied for a parallel traversal of the sequences of two (or more) realm-based line2d or region2d objects. Only in the general case of intersecting spatial objects, the full order relation on halfsegments is needed for a parallel traversal of the objects halfsegment sequences Data Structures for Spatiotemporal Data Types The discrete version of the spatiotemporal data types presented in Section 4.2 and 4.3 offers a precise basis for the design of data structures which form the basis for describing the algorithmic scheme employed for spatiotemporal predicate evaluations (Section 5.3). In fact, the discrete model is a high level specification of such data structures. In this section, we 2 A realm provides a discrete geometric basis for the construction of spatial objects and consists of a finite set of points and non-intersecting segments, called realm objects. That is, a segment inserted into the realm is intersected and split according to a special strategy with all realm objects. All spatial objects like complex points, complex lines, and complex regions are then defined in terms of these realm objects. Hence, all spatial objects defined over the same realm become acquainted with each other beforehand. 103

104 describe how we can translate the discrete specification of the basic spatiotemporal data types and spatiotemporal balloon data types into appropriate data structures for implementation Data structures for basic spatiotemporal data types A moving point mp mapping(upoint) is represented as a record containing some global object information fields and an array of units ordered by their time interval. That is, mp = n,ls,ob j pbb, up 1,...,up n = n, ti 1,...,ti k,((x l,y l ),(x u,y u )), (unit pbb 1,c 1,i 1,v 1 ),...,(unit pbb n,c n,i n,v n ) The value n stores the number of units of mp. The value ls keeps the lifespan of mp, which is given as the subarray of disjoint time intervals ti j,1 j k,k n, for which mp is defined. The lifespan is obtained by merging the time intervals of all units. Adjacent unit intervals are then fused to a single time interval. For the evaluation of some operations it can be helpful to use an approximation of mp. We use the object projection bounding box ob j p bb for this purpose, which represents the minimum, axis-parallel rectangle with respect to all points in the 2D space that at some time instant belong to mp. At the end of mp, its unit sequence is stored in a subarray containing n unit points up i with 1 i n. Each unit consists of four components. The first component contains the unit projection bounding box (by analogy with the object projection bounding box). The second component stores the number of moving unit single point in the unit. The third component is the unit interval i k = (l k,r k,lc k,rc k ) with 1 k n where l k,r k instant denote the left (start) and right (end) time instant of i k and the two Boolean flags lc k and rc k indicate whether i k is leftclosed and/or right-closed. We require that i k < i l for all 1 k < l n where the < -relationship on intervals is defined as: i k < i l = r dis joint(i k,i l ) r ad jacent(i k,i l ) The last component describes the unit function for a unit point. It is given by a sequence of m quadruples v k = (x 1,A,x 1,B,y 1,A,y 1,B ),...,(x m,a,x m,b,y m,a,y m,b ) where each quadruple represents the function f j (t) = (x j (t),y j (t)) = (x j,0 + x j,1 t,y j,0 + y j,1 t) with 1 j m. Such functions describe a linearly moving single point. Thus, each quadruple corresponds to an 104

105 element of the set MPoi, and the sequence v k corresponds to the an element of the type upoint defined in the discrete model (Section ). For uniqueness and minimality of representation we require in addition that r ad jacent(i k,i l ) (v k v l ) The reason for this requirement is that we can merge two adjacent units with the same unit function representation into a single unit over the merged time interval. The representation of a moving line or a moving region is in principle the same as for moving points. But due to the higher complexity of these types, the unit function of a uline or a uregion value is more complex. It essentially describes a line or a region whose vertices move linearly (i.e., whose vertex positions are linear functions of time), such that for all instants in the unit interval the evaluation of the vertex functions yields a correct line or region value respectively. In general, a uline unit consists of a sequence of moving unit segments where each moving unit segment is an element of the set MSeg defined in Section A moving unit segment ms = (u,v) with u,v MPoi is a pair of moving unit single points that are coplanar in the 3D space. Consequently, a moving unit segment that is restricted to a time interval forms a trapezium, or, in the degenerate case, a triangle in the 3D space. Rotations of segments are not permitted since this leads to curvilinear lateral surfaces (viewed from the 3D perspective) whose computational treatment is rather difficult (see Figure 4-4 and Section ). The data structure of a moving line ml mapping(uline) and a moving region mr mapping(uregion) can now be described as follows: ml = n,ls,ob j pbb, ul 1,...,ul n = n, ti 1,...,ti k,((x l,y l ),(x u,y u )), (unit pbb 1,c 1,i 1,v 1 ),...,(unit pbb n,c n,i n,v n ) mr = n,ls,ob j pbb, ur 1,...,ur n = n, ti 1,...,ti k,((x l,y l ),(x u,y u )), (unit pbb 1,c 1,i 1,v 1 ),...,(unit pbb n,c n,i n,v n ) The values n, ls, ob j pbb, ti j, unit pbb l, and i l have the same meaning and properties as for moving points. In particular, we have the same order on unit intervals as for moving points, and 105

106 if two consecutive unit intervals are adjacent, their unit function representations are different. The value c l denotes the number of moving unit segments in each unit. What remains to be explained is the structure of the unit function v l. In both cases of the moving line ml and the moving region mr, we take the unstructured approach by representing the unit function v l as a sequence of moving unit segments ms k with 1 k c l for a moving line or with 3 k c l for a moving region (since a region must be composed from a minimum of 3 segments). Thus, we have v l = ms 1,...,ms cl. We can take this unstructured approach instead of a structured one (with intermediate structures such as moving blocks for a moving line or moving face and hole cycles for a moving region) because, at the spatial level, we have devised methods for validating and computing the structure of an unstructured line or region object (which are based directly on segments). For example, given a set of segments, we can validate whether it is a valid line object by using a plane sweep process to check for intersecting or overlapping segments, or we can validate whether it is a valid region object by using our cycle walk algorithm as presented in [41]. This eliminates the need to represent intermediate structures such as blocks for a line object or face and hole cycles for a region object since these structures are generally used for validation purposes, and if they are needed, they can be computed from the set of segments by using a similar flavor of our validation algorithms. Another important difference between the representation of a moving line and that of a moving region is that a moving unit segment ms k in the case of a moving region contains an additional information ia which is a Boolean value indicating whether the interior of the region is above the segment at all time instants of the unit interval. This allows one to derive a region data structure representation at any time instant of the unit interval since such a data structure are composed of attributed halfsegments (see Section 5.1.2) which can be constructed by using this information Data structures for balloon and spatiotemporal balloon data types Spatiotemporal balloon data types are defined based on basic spatiotemporal data types. Consequently their data structures are also based on those of basic spatiotemporal data types. The data structure of a balloon object b mapping(uα,uβ) can be described as follows: 106

107 b = t,ls,ob j pbb,h, p The value t is the time instant of the knowledge that defines the balloon object. This instant is typically the time instant of the last known position or extent of the moving object or the time instant when the future prediction is produced. The components ls and ob j pbb represent the combined/merged lifespan and projection bounding box respectively of both the historical movement and the predicted movement of the balloon object. The component h represents the historical movement which is of the type mapping(uα) and has a data structure of the corresponding basic spatiotemporal data type. Similarly, the component p describes the predicted movement of type mapping(uβ) and also has a data structure of the corresponding basic spatiotemporal data type. As specified in the discrete model, a restriction between h and p must be preserved such that the lifespan of h must precede that of p. For a moving balloon object mb mballoon(uα,uβ), its data structure is slightly more complex than that of a balloon object since now we need to represent a sequence of predicted movements. The data structure of mb can be described as follows: mb = n,ls,ob j pbb,h, (t 1, p 1 ),...,(t n, p n ) The value n stores the number of predicted movements available. The components ls and ob j pbb represent the combined/merged lifespan and projection bounding box respectively of the historical movement and all of the predicted movements. The component h represents the development of the historical movement. Since we assume that this development obeys the historical accumulation phenomenon stated in the abstract and discrete models, we can represent this development by using the data structure of a corresponding basic spatiotemporal data type and provide a special temporal instantiation function ι h α (Section 4.3.2) to obtain any historical movement knowledge at any instant in the past. In the last component, each of the tuple (t k, p k ) with 0 k n represents a predicted movement p k produced at time t k. Note that the predicted movements are optional. This is the case when k = 0 for which the sequence of predicted movements is empty. In such case, the moving balloon object is nothing more than a basic moving object. Hence, a moving balloon object can be classified as a high level, generalized 107

108 version of a moving object with the ability to retain the development over time of the knowledge of the past movement and predicted movements. 5.2 Algorithms for Topological Predicates on Complex Spatial Objects In the implementation of topological predicates on complex spatial objects, we are especially interested in answering two kinds of queries. Given two objects A and B of any complex spatial data type point2d, line2d, or region2d, we can pose at least two kinds of topological queries: (1) Do A and B satisfy the topological predicate p? and (2) What is the topological predicate p between A and B?. Only query 1 yields a Boolean value, and we call it hence a verification query. This kind of query is of large interest for the query processing of spatial joins and spatial selections in spatial databases and GIS. Query 2 returns a predicate (name), and we call it hence a determination query. This kind of query is interesting for spatial reasoning and all applications analyzing the topological relationships of spatial objects. It is especially important in the implementation of spatiotemporal predicates as we will see later. Our goal in this section is to develop and present efficient implementation strategies for topological predicates between all combinations of the three complex spatial data types point2d, line2d, and region2d. We distinguish two phases of predicate execution: In an exploration phase (Section 5.2.2), a plane sweep scans a given configuration of two spatial objects, detects all topological events (like intersections), and records them in so-called topological feature vectors. These vectors serve as input for the evaluation phase (Section 5.2.3) which analyzes these topological data and determines the Boolean result of a topological predicate (query 1) or the kind of topological predicate (query 2). To speed up the evaluation process, we also present, in Section 5.2.4, two fine-tuned and optimized approaches of matrix thinning for predicate verification and minimum cost decision trees for predicate determination. The twophase approach provides a direct and sound interaction and synergy between conceptual work (9-intersection model) and implementation (algorithmic design). Interface methods for accessing our implementation of this concept is given in Section We begin by presenting some basic algorithmic concepts needed for the exploration algorithms in Section

109 5.2.1 Basic Algorithmic Concepts In this section, we describe three algorithmic concepts that serve as the foundation of the exploration algorithms in Section These concepts are the parallel object traversal (Section ), overlap numbers (Section ), and the plane sweep paradigm (Section ). Parallel object traversal and overlap numbers are employed during a plane sweep. We will not describe these three concepts in full detail here, since they are well known methods in Computational Geometry [3] and spatial databases [33]. However, we will focus on the specialties of these concepts in our setting, including some improvements compared to standard plane sweep implementations. These comprise a smoothly integrated handling of general (that is, intersecting) and realm-based (that is, non-intersecting) pairs of spatial objects. An objective of this section is also to introduce a number of auxiliary operations and predicates that make the description of the exploration algorithms later much easier and more comprehensible Parallel object traversal For a plane sweep, the representation elements (points or segments) of the spatial operand objects have usually to be merged together and sorted afterwards according to some order relation (for example, the order on x-coordinates). This initial merging and sorting is rather expensive and requires O(nlogn) time, if n is the number of representation elements of both operand objects. Our approach avoids this initial sorting, since the representation elements of point2d, line2d, and region2d objects are already stored in the order we need (point order or halfsegment order). We also do not have to merge the object representations, since we can deploy a parallel object traversal that allows us to traverse the point or halfsegment sequences of both operand objects in parallel. Hence, by employing a cursor on both sequences, it is sufficient to check the point or halfsegment at the current cursor positions of both sequences and to take the lower one with respect to the point order or halfsegment order for further computation. If the operand objects have already been intersected with each other, like in the realm case [30], the parallel object traversal has only to operate on two static point or halfsegment sequences. But in the general case, intersections between both objects can exist and are detected 109

110 during the plane sweep. A purely static sequence structure is insufficient in this case, since detected intersections have to be stored and handled later during the plane sweep. In order to avoid a change of the original object representations, which would be very expensive and only temporarily needed, each object is associated with an additional and temporary dynamic sequence, which stores newly detected points or halfsegments of interest. Hence, our parallel object traversal has to handle a static and a dynamic sequence part for each operand object and thus four instead of two point or halfsegment sequences. It returns the smallest point or halfsegment from the four current cursor positions. We will give an example of the parallel object traversal when we discuss our plane sweep approach in Section To simplify the description of this parallel scan, two operations are provided. Let O 1 α and O 2 β with α,β {point2d,line2d,region2d}. The operation select first(o 1, O 2, object, status) selects the first point or halfsegment of each of the operand objects O 1 and O 2 and positions a logical pointer on both of them. The parameter object with a possible value out of the set {none, first, second, both} indicates which of the two object representations contains the smaller point or halfsegment. If the value of object is none, no point or halfsegment is selected, since O 1 and O 2 are empty. If the value is first (second), the smaller point or halfsegment belongs to O 1 (O 2 ). If it is both, the first point or halfsegment of O 1 and O 2 are identical. The parameter status with a possible value out of the set {end of none, end of first, end of second, end of both} describes the state of both object representations. If the value of status is end of none, both objects still have points or halfsegments. If it is end of first (end of second), O 1 (O 2 ) is exhausted. If it is end of both, both object representations are exhausted. The operation select next(o 1, O 2, object, status), which has the same parameters as select first, searches for the next smallest point or halfsegment of O 1 and O 2. Two points (halfsegments) are compared with respect to the lexicographic (halfsegment) order. For the comparison between a point and a halfsegment, the dominating point of the halfsegment and hence the lexicographic order is used. If before this operation object was equal to both, select next moves forward the logical pointers of both sequences; otherwise, if object was equal 110

111 to first (second), it only moves forward the logical pointer of the first (second) sequence. In contrast to the first operation, which only has to consider the static sequence part of an object, this operation also has to check the dynamic sequence part of each object. Both operations together allow one to scan in linear time two object representations like one ordered sequence Overlap numbers The concept of overlap numbers is exclusively needed for the computation of the topological relationships between two region2d objects. The reason is that we have to find out the degree of overlapping of region parts. Points in the plane that are shared by both region2d objects obtain the overlap number 2. Points that are shared only by one of the objects obtain the overlap number 1. All other points are outside of both objects and obtain the overlap number 0. In our implementation, since a segment s h of an attributed halfsegment (h,ia h ) = ((s h,d h ),ia h ) of a region object separates space into two parts, an interior and an exterior one, during a plane sweep each such segment is associated with a segment class which is a pair (m/n) of overlap numbers, a lower (or right) one m and an upper (or left) one n (m,n N 0 ). The lower (upper) overlap number indicates the number of overlapping region2d objects below (above) the segment. In this way, we obtain a segment classification of two region2d objects and speak about (m/n)- segments. Obviously, 0 m,n 2 holds. Of the nine possible combinations only seven describe valid segment classes. This is because a (0/0)-segment contradicts the definition of a complex region2d object, since then at least one of both regions would have two holes or an outer cycle and a hole with a common border segment. Similarly, (2/2)-segments cannot exist, since then at least one of the two regions would have a segment which is common to two outer cycles of the object. Hence, possible (m/n)-segments are (0/1)-, (0/2)-, (1/0)-, (1/1)-, (1/2)-, (2/0)-, and (2/1)-segments. Figure 5-3 gives an example Plane sweep The plane sweep technique [3, 55] is a well known algorithmic scheme in Computational Geometry. Its central idea is to reduce a two-dimensional geometric problem to a simpler onedimensional geometric problem. A vertical sweep line traversing the plane from left to right 111

112 Figure 5-3. Example of the segment classification of two region2d objects stops at special event points which are stored in a queue called event point schedule. The event point schedule must allow one to insert new event points discovered during processing; these are normally the initially unknown intersections of line segments. The state of the intersection of the sweep line with the geometric structure being swept at the current sweep line position is recorded in vertical order in a data structure called sweep line status. Whenever the sweep line reaches an event point, the sweep line status is updated. Event points which are passed by the sweep line are removed from the event point schedule. Note that, in general, an efficient and fully dynamic data structure is needed to represent the event point schedule and that, in many plane-sweep algorithms, an initial sorting step is needed to produce the sequence of event points in (x,y)-lexicographical order. In our case, the event points are either the points of the static point sequences of point2d objects or the (attributed) halfsegments of the static halfsegment sequences of line2d (region2d) objects. This especially holds and is sufficient for the realm case. In addition, in the general case, new event points are determined during the plane sweep as intersections of line segments; they are stored as points or halfsegments in the dynamic sequence parts of the operand objects and are needed only temporarily for the plane sweep. As we have seen in Section , the concepts of point order, halfsegment order, and parallel object traversal avoid an expensive initial sorting at the beginning of the plane sweep. We use the operation get event to provide the element to which the logical pointer of a point or halfsegment sequence is currently pointing. The Boolean predicate look ahead tests whether the dominating points of a given halfsegment and the next halfsegment after the logical pointer of a given halfsegment sequence are equal. 112

113 I Several operations are needed for managing the sweep line status. The operation new sweep creates a new, empty sweep line status. If a left (right) halfsegment of a line2d or region2d object is reached during a plane-sweep, the operation add left (del right) stores (removes) its segment component into (from) the segment sequence of the sweep line status. The predicate coincident checks whether the just inserted segment partially coincides with a segment of the other object in the sweep line status. The operation set attr (get attr) sets (gets) an attribute for (from) a segment in the sweep line status. This attribute can be either a Boolean value indicating whether the interior of the region is above the segment or not (the Interior Above flag), or it can be an assigned segment classification. The operation get pred attr yields the attribute from the predecessor of a segment in the sweep line status. The operation pred exists (common point exists) checks whether for a segment in the sweep line status a predecessor according to the vertical y-order (a neighbored segment of the other object with a common end point) exists. The operation pred of p searches the nearest segment below a given point in the sweep line status. The predicate current exists tests whether such a segment exists. The predicate poi on seg (poi in seg) checks whether a given point lies on (in) any segment of the sweep line status. I Figure 5-4. Changing overlap numbers after an intersection. Intersections of line segments stemming from two lines2d objects, two region2d objects, or a line2d object and a region2d object are of special interest, since they indicate topological changes. If two segments of two line2d objects intersect, this can, for example, indicate a proper intersection, or a meeting situation between both segments, or an overlapping of both segments. If a segment of a line2d object intersects a segment of a region2d object, the former segment can, for example, enter the region, leave the region, or overlap with the latter segment. Overlap numbers can be employed here to determine entering and leaving situations. If segments 113

114 of two region2d objects intersect, this can, for example, indicate that they share a common area and/or a common boundary. In this case, intersecting line segments have especially an effect on the overlap numbers of the segments of both region2d objects. In Section we have tacitly assumed that any two segments from both region2d objects are either disjoint, or equal, or meet solely in a common end point. Only if these topological constraints are satisfied, we can use the concepts of overlap numbers and segment classes for a plane sweep. But the general case in particular allows intersections. Figure 5-4 shows the problem of segment classes for two intersecting segments. The segment class of s 1 [s 2 ] left of the intersection point is (0/1) [(1/2)]. The segment class of s 1 [s 2 ] right of the intersection point is (1/2) [(0/1)]. That is, after the intersection point, seen from left to right, s 1 and s 2 exchange their segment classes. The reason is that the topology of both segments changes. Whereas, to the left of the intersection, s 1 (s 2 ) is outside (inside) the region to which s 2 (s 1 ) belongs, to the right of the intersection, s 1 (s 2 ) is inside (outside) the region to which s 2 (s 1 ) belongs. In order to be able to make the needed topological detections and to enable the use of overlap numbers for two general regions, in case that two segments from two different regions intersect, partially coincide, or touch each other within the interior of a segment, we pursue a splitting strategy that is executed during the plane sweep on the fly. If segments intersect, they are temporarily split at their common intersection point so that each of them is replaced by two segments (that is, four halfsegments) (Figure 5-5A). If two segments partially coincide, they are split each time the endpoint of one segment lies inside the interior of the other segment. Depending on the topological situations, which can be described by Allen s thirteen basic relations on intervals [1], each of the two segments either remains unchanged or is replaced by up to three segments (that is, six halfsegments). From the thirteen possible relations, eight relations (four pairs of symmetric relations) are of interest here (Figure 5-5B). If an endpoint of one segment touches the interior of the other segment, the latter segment is split and replaced by two segments (that is, four halfsegments) (Figure 5-5C). This splitting strategy is numerically stable and thus feasible from an implementation standpoint since we assume numerically 114

115 Figure 5-5. Splitting of segments. A) two intersecting segments. B) two partially coinciding segments (without symmetric counterparts). C) A segment whose interior is touched by another segment. Digits indicate part numbers of segments after splitting. robust geometric computation that ensures topological consistency of intersection operations. Intersecting and touching points can then be exactly computed, lead to representable points, and are thus precisely located on the intersecting or touching segments. However, as indicated before, the splitting of segments entails some algorithmic effort. On the one hand, we want to keep the halfsegment sequences of the line2d and region2d objects unchanged, since their update is expensive and only temporarily needed for the plane sweep. On the other hand, the splitting of halfsegments has an effect on these sequences. As a compromise, for each line2d or region2d object, we maintain its static representation, and the halfsegments obtained by the splitting process are stored in an additional dynamic halfsegment sequence. The dynamic part is also organized as an AVL tree which is embedded in an array and whose elements are linked in sequence order. Assuming that k splitting points are detected during the plane sweep, we need O(k) additional space, and to insert them requires O(k logk) time. After the plane sweep, this additional space is released. Figure 5-6. Sweep line status. A) Before the splitting (s 4 to be inserted). B) After the splitting. The vertical dashed line indicates the current position of the sweep line. 115

116 Table 5-1. Static and dynamic halfsegment sequences of the regions R 1 and R 2 in Figure 5-6. R 1 dynamic sequence part (h r s 4,1, f ) (h l s 4,2, f ) (h r s 4,2, f ) R 1 static sequence part (h l s 1,t) (h l s 2, f ) (h l s 3,t) (h l s 4, f ) (h r s 3,t) (h r s 2, f ) (h r s 4, f ) (h l s 5, f ) (h r s 5, f ) (h r s 1,t) R 2 static sequence part (h l v 1,t) (h l v 2, f ) (h r v 2, f ) (h l v 3, f ) (h r v 3, f ) (h r v 1,t) R 2 dynamic sequence part (h r v 1,1,t) (h l v 1,2,t) (h r v 1,2,t) To illustrate the splitting process in more detail, we consider two region2d objects R 1 and R 2. In general, we have to deal with the three cases in Figure 5-5. We first consider the case that the plane sweep detects an intersection. This leads to a situation like in Figure 5-6A. The two static and the two dynamic halfsegment sequences of R 1 and R 2 are shown in Table 5-1. Together they form the event point schedule of the plane sweep and are processed by a parallel object traversal. Before the current position of the sweep line (indicated by the vertical dashed line in Figure 5-6), the parallel object traversal has already processed the attributed halfsegments (h l s 1,t), (h l s 2, f ), (h l v 1,t), and (h l v 2, f ) in this order. At the current position of the sweep line, the parallel object traversal encounters the halfsegments (h l s 3,t) and (h l s 4, f ). For each left halfsegment visited, the corresponding segment is inserted into the sweep line status according to the y-coordinate of its dominating point and checked for intersections with its direct upper and lower neighbors. In our example, the insertion of s 4 leads to an intersection with its upper neighbor v 1. This requires segment splitting; we split v 1 into the two segments v 1,1 and v 1,2 and s 4 into the two segments s 4,1 and s 4,2. In the sweep line status, we have to replace v 1 by v 1,1 and s 4 by s 4,1 (Figure 5-6B). The new halfsegments (h r s 4,1, f ), (h l s 4,2, f ), and (h r s 4,2, f ) are inserted into the dynamic halfsegment sequence of R 1. Into the dynamic halfsegment sequence of R 2, we insert the halfsegments (h r v 1,1,t), (h l v 1,2,t), and (h r v 1,2,t). We need not store the two halfsegments (h l s 4,1, f ) and (h l v 1,1,t) since they refer to the past and have already been processed. On purpose we have accepted a little inconsistency in this procedure, which can fortunately be easily controlled. Since, for the duration of the plane sweep, s 4 (v 1 ) has been replaced by s 4,1 (v 1,1 ) and s 4,2 (v 1,2 ), the problem is that the static sequence part of R 1 (R 2 ) still includes the now invalid halfsegment (h r s 4, f ) ((h r v 1,t)), which we may not delete (see Figure 5-6B). However, this 116

117 is not a problem due to the following observation. If we find a right halfsegment in the dynamic sequence part of a region2d object, we know that it stems from splitting a longer, collinear, right halfsegment that is stored in the static sequence part of this object, has the same right end point, and has to be skipped during the parallel object traversal. For the second and third case in Figure 5-5, the procedure is the same but more splits can occur. In case of overlapping, collinear segments, we obtain up to six new halfsegments. In case of a touching situation, the segment whose interior is touched is split The Exploration Phase for Collecting Topological Information For a given scene of two spatial objects, the goal of the exploration phase is to discover appropriate topological information that is characteristic and unique for this scene and that is suitable both for verification queries (query type 1) and determination queries (query type 2). Our approach is to scan such a scene from left to right by a plane sweep and to collect topological data during this traversal that later in the evaluation phase helps us confirm, deny, or derive the topological relationship between both objects. From both phases, the exploration phase is the computationally expensive one since topological information has to be explicitly derived by geometric computation. Our research shows that it is unfavorable to aim at designing a universal exploration algorithm that covers all combinations of spatial data types. This has three main reasons. First, each of the data types point2d, line2d, and region2d has very type-specific, well known properties that are different from each other (like different dimensionality). Second, for each combination of spatial data types, the topological information we have to collect is very specific and especially different from all other type combinations. Third, the topological information we collect about each spatial data type is different in different type combinations. Therefore, using the basic algorithmic concepts of Section 5.2.1, in this section, we present exploration algorithms for all combinations of complex spatial data types. Between two objects of types point2d, line2d, or region2d, we have to distinguish six different cases, if we assume that the 117

118 first operand has an equal or lower dimension than the second operand 3. All algorithms except for the point2d/point2d case require the plane sweep technique. Depending on the types of spatial objects involved, a boolean vector v F consisting of a special set of topological flags is assigned to each object F. We call it a topological feature vector. Its flags are all initialized to false. Once certain topological information about an object has been discovered, the corresponding flag of its topological feature vector is set to true. Topological flags represent topological facts of interest. We obtain them by analyzing the topological intersections between the exterior, interior and boundary of a complex spatial object with the corresponding components of another complex spatial object according to the 9-intersection matrix (Figure 2-2A). That is, the concept is to map the matrix elements of the 9-intersection matrix, which are predicates, into a topological feature vector and to eliminate redundancy given by symmetric matrix elements. For all type combinations, we aim at minimizing the number of topological flags of both spatial argument objects. In symmetric cases, only the first object gets the flag. The topological feature vectors are later used in the evaluation phase for predicate matching. Hence, the selection of topological flags is highly motivated by the requirements of the evaluation phase (Section 5.2.3,[51]). Let P(F) be the set of all points of a point2d object F, H(F) be the set of all (attributed) halfsegments [including those resulting from our splitting strategy] of a line2d (region2d) object F, and B(F) be the set of all boundary points of a line2d object F. For f H(F), let f.s denote its segment component, and, if F is a region2d object, let f.ia denote its attribute component. The definitions in the next subsections make use of the operations on robust geometric primitives and halfsegments (Section 5.1.2). 3 If, in the determination query case, a predicate p(a,b) has to be processed, for which the dimension of object A is higher than the dimension of object B, we process the converse predicate p conv (B,A) where p conv has the transpose of the 9-intersection matrix (see Figure 2-2A) of p. 118

119 The exploration algorithm for the point2d/point2d case The first and simplest case considers the exploration of topological information for two point2d objects F and G. Here, the topological facts of interest are whether (i) both objects have a point in common and (ii) F (G) contains a point that is not part of G (F). Hence, both topological feature vectors v F and v G get the flag poi disjoint. But only v F in addition gets the flag poi shared since the sharing of a point is symmetric. We obtain (the symbol : means equivalent by definition ): Definition 5.1 : Let F,G point2d, and let v F and v G be their topological feature vectors. Then (i) v F [poi shared] : f P(F) g P(G) : f = g (ii) v F [poi disjoint] : f P(F) g P(G) : f g (iii) v G [poi disjoint] : g P(G) f P(F) : f g For the computation of the topological feature vectors, a plane sweep is not needed; a parallel traversal suffices, as the algorithm in Figure 5-7 shows. The while-loop terminates if either the end of one of the objects has been reached or all topological flags have been set to true (lines 7 and 8). In the worst case, the loop has to be traversed l + m times where l (m) is the number of points of the first (second) point2d object. Since the body of the while-loop requires constant time, the overall time complexity is O(l + m) The exploration algorithm for the point2d/line2d case In case of a point2d object F and a line2d object G, at the lowest level of detail, we are interested in the possible relative positions between the individual points of F and the halfsegments of G. This requires a precise understanding of the definition of the boundary of a line2d object, as it has been given in [59]. It follows from this definition that each boundary point of G is an endpoint of a (half)segment of G and that this does not necessarily hold vice versa, as Figure 5-8A indicates. The black segment endpoints belong to the boundary of G, since exactly one segment emanates from each of them. Intuitively, they bound G. In contrast, the 119

120 .. / 01 algorithm ExplorePoint2DPoint2D 02 input: point2d objects F and G, topological feature 03 vectors v F and v G initialized with false 04 output: updated vectors v F and v G 05 begin 06 select first(f, G, object, status); 07 while status = end of none and not (v F [poi disjoint] 08 and v G [poi disjoint] and v F [poi shared]) do 09 if object = first then v F [poi disjoint] := true 10 else if object = second then v G [poi disjoint] := true 11 else /* object = both */ 12 v F [poi shared] := true; 13 endif 14 select next(f, G, object, status); 15 endwhile; 16 if status = end of first then v G [poi disjoint] := true 17 else if status = end of second then 18 v F [poi disjoint] := true 19 endif 20 end ExplorePoint2DPoint2D. Figure 5-7. Algorithm for computing the topological feature vectors for two point2d objects grey segment endpoints belong to the interior of G, since several segments emanate from each of them. Intuitively, they are connector points between different segments of G. / / A B C Figure 5-8. Boundary point intersections. A) Boundary points (in black) and connector points (in grey) of a line2d object. B) A scenario where a boundary point of a line2d object exists that is unequal to all points of a point2d object. C) A scenario where this is not the case. The following argumentation leads to the needed topological flags for F and G. Seen from the perspective of F, we can distinguish three cases since the boundary of F is empty [59] and the interior of F can interact with the exterior, interior, or boundary of G. First, (the interior of) a point f of F can be disjoint from G (flag poi disjoint). Second, a point f can lie in the interior 120

121 of a segment of G (flag poi on interior). This includes an endpoint of such a segment, if the endpoint is a connector point of G. Third, a point f can be equal to a boundary point of G (flag poi on bound). Seen from the perspective of G, we can distinguish four cases since the boundary and the interior of G can interact with the interior and exterior of F. First, G can contain a boundary point that is unequal to all points in F (flag bound poi disjoint). Second, G can have a boundary point that is equal to a point in F. But the flag poi on bound already takes care of this situation. Third, the interior of a segment of G (including connector points) can comprehend a point of F. This situation is already covered by the flag poi on interior. Fourth, the interior of a segment of G can be part of the exterior of F. This is always true since a segment of G represents an infinite point set that cannot be covered by the finite number of points in F. Hence, we need not handle this as a special situation. Formally, we define the semantics of the topological flags as follows: Definition 5.2 : Let F point2d, G line2d, and v F and v G be their topological feature vectors. Then, (i) v F [poi disjoint] : f P(F) g H(G) : on( f,g.s) (ii) v F [poi on interior] : f P(F) g H(G) b B(G) : on( f,g.s) f b (iii) v F [poi on bound] : f P(F) g B(G) : f = g (iv) v G [bound poi disjoint] : g B(G) f P(F) : f g Our algorithm for computing the topological information for this case is shown in Figure 5-9. The while-loop is executed until the end of the line2d object (line 9) and as long as not all topological flags have been set to true (lines 10 to 11). The operations select first and select next compare a point and a halfsegment according to the order relation defined in Section in order to determine the next element(s) to be processed. If only a point has to be processed (line 12), we know that it does not coincide with an endpoint of a segment of G and hence not with a boundary point of G. But we have to check whether the point lies in the interior of a segment in the sweep line status structure S. This is done by the search operation poi in seg on S (line 13). If this is not the case, the point must be located outside the segment (line 14). If only a halfsegment 121

122 01 algorithm ExplorePoint2DLine2D 02 input: point2d object F and line2d object G, 03 topological feature vectors v F and v G 04 initialized with false 05 output: updated vectors v F and v G 06 begin 07 S := new sweep(); last dp := ε; 08 select first(f, G, object, status); 09 while status end of second and status end of both and 10 not (v F [poi disjoint] and v F [poi on interior] and 11 v F [poi on bound] and v G [bound poi disjoint]) do 12 if object = first then p := get event(f); 13 if poi in seg(s, p) then v F [poi on interior] := true 14 else v F [poi disjoint] := true endif 15 else if object = second then 16 h := get event(g); /* h = (s,d) */ 17 if d then add left(s, s) else del right(s, s) endif; 18 if dp(h) last dp then last dp := dp(h); 19 if not look ahead(h,g) then 20 v G [bound poi disjoint] := true 21 endif 22 endif 23 else /* object = both */ 24 h := get event(g); /* h = (s,d) */ 25 if d then add left(s, s) else del right(s, s) endif; 26 last dp := dp(h); 27 if look ahead(h,g) then 28 v F [poi on interior] := true 29 else v F [poi on bound] := true endif 30 endif 31 select next(f, G, object, status); 32 endwhile; 33 if status = end of second then 34 v F [poi disjoint] := true 35 endif 36 end ExplorePoint2DLine2D. Figure 5-9. Algorithm for computing the topological feature vectors for a point2d object and a line2d object 122

123 h has to be processed (line 15), its segment component is inserted into (deleted from) S if h is a left (right) halfsegment (line 17). We also have to test if the dominating point of h, say v, is a boundary point of G. This is the case if v is unequal to the previous dominating point stored in the variable last dp (line 18) and if the operation look ahead finds out that v does also not coincide with the dominating point of the next halfsegment (lines 19 to 20). In case that a point v of F is equal to a dominating point of a halfsegment h in G (line 23), we know that v has never been visited before and that it is an end point of the segment component of h. Besides the update of S (line 25), it remains to decide whether v is an interior point (line 28) or a boundary point (line 29) of h. For this, we look ahead (line 27) to see whether the next halfsegment s dominating point is equal to v or not. If l is the number of points of F and m is the number of halfsegments of G, the while-loop is executed at most l + m times. The insertion of a left halfsegment into and the removal of a right halfsegment from the sweep line status needs O(logm) time. The check whether a point lies within or outside a segment (predicate poi in seg) also requires O(logm) time. Altogether, the worst time complexity is O((l + m)logm). The while-loop has to be executed at least m times for processing the entire line2d object in order to find out if a boundary point exists that is unequal to all points of the point2d object (Figures 5-8B and C) The exploration algorithm for the point2d/region2d case In case of a point2d object F and a region2d object G, the situation is simpler than in the previous case. Seen from the perspective of F, we can again distinguish three cases between (the interior of) a point of F and the exterior, interior, or boundary of G. First, a point of F lies either inside G (flag poi inside), on the boundary of G (flag poi on bound), or outside of region G (flag poi outside). Seen from the perspective of G, we can distinguish four cases between the boundary and the interior of G with the interior and exterior of F. The intersection of the boundary (interior) of G with the interior of F implies that a point of F is located on the boundary (inside) of G. This situation is already covered by the flag poi on bound (poi inside). The intersection of the boundary (interior) of G with the exterior of F is always true, since F 123

124 as a finite point set cannot cover G s boundary segments (interior) representing an infinite point set. More formally, we define the semantics of the topological flags as follows (we assume poiinregion to be a predicate which checks whether a point lies inside a region2d object): Definition 5.3 : Let F point2d, G region2d, and v F and v G be their topological feature vectors. Then, (i) v F [poi inside] : f P(F) : poiinregion( f,g) (ii) v F [poi on bound] : f P(F) g H(G) : on( f,g.s) (iii) v F [poi outside] : f P(F) g H(G) : poiinregion( f,g) on( f,g.s) We see that v G is not needed. The algorithm for this case is shown in Figure The while-loop is executed as long as none of the two objects has been processed (line 9) and as long as not all topological flags have been set to true (lines 9 to 10). If only a point has to be processed (line 11), we must check its location. The first case is that it lies on a boundary segment; this is checked by the sweep line status predicate poi on seg (line 12). Otherwise, it must be located inside or outside of G. We use the operation pred of p (line 13) to determine the nearest segment in the sweep line status whose intersection point with the sweep line has a lower y-coordinate than the y-coordinate of the point. The predicate current exists checks whether such a segment exists (line 14). If this is not the case, the point must be outside of G (line 17). Otherwise, we ask for the information whether the interior of G is above the segment (line 14). We can then derive whether the point is inside or outside the region (lines 15 to 16). If only a halfsegment h has to be processed or a point v of F is equal to a dominating point of a halfsegment h in G (line 20), h s segment component is inserted into (deleted from) S if h is a left (right) halfsegment (line 20 to 21). In case of a left halfsegment, in addition, the information whether the interior of G is above the segment is stored in the sweep line status (line 21). If v and the dominating point of h coincide, we know that the point is on the boundary of G (line 23). If l is the number of points of F and m is the number of halfsegments of G, the while-loop is executed at most l + m times. Each of the sweep line status operations add left, del right, 124

125 01 algorithm ExplorePoint2DRegion2D 02 input: point2d object F and region2d object G, 03 topological feature vectors v F and v G 04 initialized with false 05 output: updated vectors v F and v G 06 begin 07 S := new sweep(); 08 select first(f, G, object, status); 09 while status = end of none and not (v F [poi inside] 10 and v F [poi on bound] and v F [poi outside]) do 11 if object = first then p := get event(f); 12 if poi on seg(s, p) then v F [poi on bound] := true 13 else pred of p(s, p); 14 if current exists(s) then ia := get attr(s); 15 if ia then v F [poi inside] := true 16 else v F [poi outside] := true endif 17 else v F [poi outside] := true 18 endif 19 endif 20 else h := get event(g); ia := get attr(g); /* h = (s,d) */ 21 if d then add left(s, s); set attr(s, ia) 22 else del right(s, s) endif; 23 if object = both then v F [poi on bound] := true endif 24 endif 25 select next(f, G, object, status); 26 endwhile; 27 if status = end of second then 28 v F [poi outside] := true 29 endif 30 end ExplorePoint2DRegion2D. Figure Algorithm for computing the topological feature vectors for a point2d object and a region2d object poi on seg, pred of p, current exists, get attr, and set attr needs O(log m) time. The total worst time complexity is O((l + m) log m) The exploration algorithm for the line2d/line2d case We now consider the exploration algorithm for two line2d objects F and G. Seen from the perspective of F, we can differentiate six cases between the interior and boundary of F and the interior, boundary, and exterior of G. First, the interiors of two segments of F and G can 125

126 partially or completely coincide (flag seg shared). Second, if a segment of F does not partially or completely coincide with any segment of G, we register this in the flag seg unshared. Third, we set the flag interior poi shared if two segments intersect in a single point that does not belong to the boundaries of F or G. Fourth, a boundary endpoint of a segment of F can be located in the interior of a segment (including connector points) of G (flag bound on interior). Fifth, both objects F and G can share a boundary point (flag bound shared). Sixth, if a boundary endpoint of a segment of F lies outside of all segments of G, we set the flag bound disjoint. Seen from the perspective of G, we can identify the same cases. But due to the symmetry of three of the six topological cases, we do not need all flags for G. For example, if a segment of F partially coincides with a segment of G, this also holds vice versa. Hence, it is sufficient to introduce the flags seg unshared, bound on interior, and bound disjoint for G. We define the semantics of the topological flags as follows: Definition 5.4 : Let F,G line2d, and let v F and v G be their topological feature vectors. Then, (i) v F [seg shared] : f H(F) g H(G) : segintersect( f.s,g.s) (ii) v F [interior poi shared] : f H(F) g H(G) p B(F) B(G) : poiintersect( f.s,g.s) poiintersection( f.s,g.s) p (iii) v F [seg unshared] : f H(F) g H(G) : segintersect( f.s,g.s) (iv) v F [bound on interior] : f H(F) g H(G) p B(F) \ B(G) : poiintersection( f.s, g.s) = p (v) v F [bound shared] : p B(F) q B(G) : p = q (vi) v F [bound disjoint] : p B(F) g H(G) : on(p,g.s) (vii) v G [seg unshared] : g H(G) f H(F) : segintersect( f.s,g.s) (viii) v G [bound on interior] : f H(F) g H(G) p B(G) \ B(F) : poiintersection( f.s, g.s) = p (ix) v G [bound disjoint] : q B(G) f H(F) : on(q, f.s) 126

127 01 algorithm ExploreLine2DLine2D 02 input: line2d objects F and G, topological feature 03 vectors vf and vg initialized with false 04 output: updated vectors vf and vg 05 begin 06 S := new sweep(); last dp in F := ε; last dp in G := ε; 07 last bound in F := ε; last bound in G := ε; 08 select first(f, G, object, status); 09 while status end of both and not (vf[seg shared] 10 and vf[interior poi shared] and vf[seg unshared] 11 and vf[bound on interior] and vf[bound shared] 12 and vf[bound disjoint] and vg[bound disjoint] 13 and vg[bound on interior] and vg[seg unshared]) do 14 if object = first then h := get event(f); /* h = (s,d) */ 15 if d then add left(s, s) 16 else del right(s, s); vf[seg unshared] := true endif; 17 if dp(h) last dp in F then last dp in F := dp(h); 18 if not look ahead(h,f) then 19 last bound in F := dp(h); 20 if last bound in F = last bound in G then 21 vf[bound shared] := true 22 else if last bound in F = last dp in G then 23 vf[bound on interior] := true 24 else if not look ahead(h,g) then 25 vf[bound disjoint] := true 26 endif 27 endif 28 endif; 29 if dp(h) last bound in F then 30 if dp(h) = last bound in G then 31 vg[bound on interior] := true 32 else if dp(h) = last dp in G then 33 vf[interior poi shared] := true 34 endif 35 endif 36 else if object = second then h := get event(g); /* like lines 15 to 35 with F and G swapped */ 38 else /* object = both */ 39 h := get event(f); vf[seg shared] := true; 40 if d then add left(s, s) else del right(s, s) endif; 41 if dp(h) last dp in F then last dp in F := dp(h); 42 if not look ahead(h,f) then 43 last bound in F := dp(h) 44 endif 45 endif; 46 if dp(h) last dp in G then last dp in G := dp(h); 47 if not look ahead(h,g) then 48 last bound in G := dp(h) 49 endif 50 endif; 51 if last bound in F = last bound in G then 52 vf[bound shared] := true 53 else 54 if last bound in F = last dp in G then 55 vf[bound on interior] := true 56 endif; 57 if last bound in G = last dp in F then 58 vg[bound on interior] := true 59 endif 60 endif 61 endif; 62 if status = end of first then 63 vg[seg unshared] := true; 64 else if status = end of second then 65 vf[seg unshared] := true; 66 endif 67 select next(f, G, object, status); 68 endwhile; 69 end ExploreLine2DLine2D. Figure Algorithm for computing the topological feature vectors for two line2d objects 127

128 The exploration algorithm for this case is given in Figure The while-loop is executed until both objects have been processed (line 9) and as long as not all topological flags have been set to true (lines 9 to 13). If a single left (right) halfsegment of F (line 14) has to be processed (the same for G (line 36)), we insert it into (delete it from) the sweep line status (lines 15 and 16). The deletion of a single right halfsegment further indicates that it is not shared by G (line 16). If the current dominating point, say v, is unequal to the previous dominating point of F (line 17) and if the operation look ahead finds out that v is also unequal to the dominating point of the next halfsegment of F (line 18), v must be a boundary point of F (line 19). In this case, we perform three checks. First, if v coincides with the current boundary point in G, both objects share a part of their boundary (lines 20 to 21). Second, otherwise, if v is equal to the current dominating point, say w, in G, w must be an interior point of G, and the boundary of F and the interior of G share a point (lines 22 to 23). Third, otherwise, if v is different from the dominating point of the next halfsegment in G, F contains a boundary point that is disjoint from G (lines 24 to 25). If v has not been identified as a boundary point in the previous step (line 29), it must be an interior point of F. In this case, we check whether it coincides with the current boundary point in G (lines 30 to 31) or whether it is also an interior point in G (lines 32 to 33). If a halfsegment belongs to both objects (line 38), we can conclude that it is shared by them (line 39). Depending on whether it is a left or right halfsegment, it is inserted into or deleted from the sweep line status (line 40). Lines 41 to 45 (46 to 50) test whether the dominating point v of the halfsegment is a boundary point of F (G). Afterwards, we check whether v is a boundary point of both objects (lines 51 to 52). If this is not the case, we examine whether one of them is a boundary point and the other one is an interior point (lines 54 to 59). Lines 62 to 66 handle the case that exactly one of the two halfsegment sequences is exhausted. Let l (m) be the number of halfsegments of F (G). Segments of both objects can intersect or partially coincide (Figure 5-5), and we handle these topological situations with the splitting strategy described in Section If, due to splitting, k is the total number of additional halfsegments stored in the dynamic halfsegment sequences of both objects, the while-loop is 128

129 executed at most l +m+k times. The only operations needed on the sweep line status are add left and del right for inserting and deleting halfsegments; they require O(log(l + m + k)) time each. No special predicates have to be deployed for discovering topological information. Due to the splitting strategy, all dominating end points either are already endpoints of existing segments or become endpoints of newly created segments. The operation look ahead needs constant time. In total, the algorithm requires O((l + m + k) log(l + m + k)) time and O(l + m + k) space The exploration algorithm for the line2d/region2d case Next, we describe the exploration algorithm for a line2d object F and a region2d object G. Seen from the perspective of F, we can distinguish six cases between the interior and boundary of F and the interior, boundary, and exterior of G. First, the intersection of the interiors of F and G means that a segment of F lies in G (flag seg inside). Second, the interior of a segment of F intersects with a boundary segment of G if either both segments partially or fully coincide (flag seg shared), or if they properly intersect in a single point (flag poi shared). Third, the interior of a segment of F intersects with the exterior of G if the segment is disjoint from G (flag seg outside). Fourth, a boundary point of F intersects the interior of G if the boundary point lies inside of G (flag bound inside). Fifth, if it lies on the boundary of G, we set the flag bound shared. Sixth, if it lies outside of G, we set the flag bound disjoint. Seen from the perspective of G, we can differentiate the same six cases as before and obtain most of the topological flags as before. First, if the interiors of G and F intersect, a segment of F must partially or totally lie in G (already covered by flag seg inside). Second, if the interior of G and the boundary of F intersect, the boundary point of a segment of F must be located in G (already covered by flag bound inside). Third, the case that the interior of G intersects the exterior of F is always true due to the different dimensionality of both objects; hence, we do not need a flag. Fourth, if the boundary of G intersects the interior of F, a segment of F must partially or fully coincide with a boundary segment of G (already covered by flag seg shared). Fifth, if the boundary of G intersects the boundary of F, a boundary point of a segment of F must lie on a boundary segment of G (already covered by flag bound shared). Sixth, if the boundary 129

130 of G intersects the exterior of F, a boundary segment of G must be disjoint from F (new flag seg unshared). More formally, we define the semantics of the topological flags as follows: Definition 5.5 : Let F line2d, G region2d, and v F and v G be their topological feature vectors. Then, (i) v F [seg inside] : f H(F) g H(G) : segintersect( f.s, g.s) seginregion( f.s, G) (ii) v F [seg shared] : f H(F) g H(G) : segintersect( f.s,g.s) (iii) v F [seg outside] : f H(F) g H(G) : segintersect( f.s, g.s) seginregion( f.s, G) (iv) v F [poi shared] : f H(F) g H(G) : poiintersect( f.s,g.s) poiintersection( f.s, g.s) / B(F) (v) v F [bound inside] : f H(F) : poiinregion(dp( f ),G) dp( f ) B(F) (vi) v F [bound shared] : f H(F) g H(G) : poiintersect( f.s,g.s) poiintersection( f.s, g.s) B(F) (vii) v F [bound disjoint] : f H(F) g H(G) : poiinregion(dp( f ),G) dp( f ) B(F) on(dp( f ),g.s) (viii) v G [seg unshared] : g H(G) f H(F) : segintersect( f.s,g.s) The operation seginregion is assumed to check whether a segment is located inside a region; it is an imaginary predicate and not implemented as a robust geometric primitive. The exploration algorithm for this case is given in Figure The while-loop is executed until at least the first object has been processed (line 10) and as long as not all topological flags have been set to true (lines 11 to 14). In case that we only encounter a halfsegment h of F (line 15), we insert its segment component s into the sweep line status if it is a left halfsegment (line 16). If it is a right halfsegment, we find out whether h is located inside or outside of G (lines 18 to 23). We know that it cannot coincide with a boundary segment of G, since this is another case. The predicate pred exists checks whether s has a predecessor in the sweep line status (line 18); it ignores segments in the sweep line status that stem from F. If this is not the case (line 22), s 130

131 01 algorithm ExploreLine2DRegion2D 02 input: line2d object F and region2d object G, 03 topological feature vectors vf and vg 04 initialized with false 05 output: updated vectors vf and vg 06 begin 07 S := new sweep(); last dp in F := ε; last dp in G := ε; 08 last bound in F := ε; 09 select first(f, G, object, status); 10 while status end of first and status end of both 11 and not (vf[seg inside] and vf[seg shared] 12 and vf[seg outside] and vf[poi shared] 13 and vf[bound inside] and vf[bound shared] 14 and vg[bound disjoint] and vg[seg unshared]) do 15 if object = first then h := get event(f); /* h = (s,d) */ 16 if d then add left(s, s) 17 else 18 if pred exists(s,s) then 19 (mp/np) := get pred attr(s, s); 20 if np = 1 then vf[seg inside] := true 21 else vf[seg outside] := true endif 22 else vf[seg outside] := true endif; 23 del right(s, s); 24 endif; 25 if dp(h) last dp in F then last dp in F := dp(h); 26 if not look ahead(h,f) then 27 last bound in F := dp(h); 28 if last bound in F = last dp in G 29 or look ahead(h,g) then 30 vf[bound shared] := true 31 else 32 if pred exists(s,s) then 33 (mp/np) := get pred attr(s, s); 34 if np = 1 then vf[bound inside] := true 35 else vf[bound outside] := true endif 36 else vf[bound outside] := true endif 37 endif 38 endif 39 endif; 40 if dp(h) last bound in F and 41 (dp(h) = last dp in G or look ahead(h, G)) then 42 vf[poi shared] := true 43 endif 44 else if object = second then 45 h := get event(g); ia := get attr(g); 46 if d then add left(s, s); set attr(s, ia) 47 else del right(s, s); vg[seg unshared] := true endif; 48 if dp(h) last dp in G then 49 last dp in G := dp(h) endif; 50 else /* object = both */ vf[seg shared] := true; 51 h := get event(g); ia := get attr(g); 52 if d then add left(s, s); set attr(s, ia) 53 else del right(s, s) endif; 54 if dp(h) last dp in F then last dp in F := dp(h); 55 if not look ahead(h,f) then 56 vf[bound shared] := true 57 else vf[poi shared] := true endif 58 endif; 59 if dp(h) last dp in G then 60 last dp in G := dp(h) endif; 61 endif; 62 if status = end of second then 63 vf[seg outside] := true endif; 64 select next(f, G, object, status); 65 endwhile; 66 if status = end of first then 67 vg[seg unshared] := true endif 68 end ExploreLine2DRegion2D. Figure Algorithm for computing the topological feature vectors for a line2d object and a region2d object 131

132 . I / / must lie outside of G. Otherwise, we check the upper overlap number of s s predecessor (line 19). The overlap number 1 indicates that s lies inside G (line 20); otherwise, it is outside of G (line 21). After this check, we remove s from the sweep line status (line 23). Next we test whether the dominating point of h is a boundary point of F (line 26) by using the predicate look ahead. If this is the case, we determine whether this point is shared by G (lines 28 to 30) or whether this point is located inside or outside of G (lines 31 to 38). Last, if the dominating point turns out not to be a boundary point of F, we check whether it is an interior point that shares a boundary point with G (lines 40 to 43). In case that we only obtain a halfsegment h of G (line 44), we insert its segment component s into the sweep line status and attach the Boolean flag ia indicating whether the interior of G is above s or not (line 46). Otherwise, we delete a right halfsegment h from the sweep line status and know that it is not shared by F (line 47). In case that both F and G share a halfsegment, we know that they also share their segment components (line 50). The sweep line status is then modified depending on the status of h (lines 52 to 53). If we encounter a new dominating point of F, we have to check whether F shares a boundary point (lines 55 to 56) or an interior point (line 57) with the boundary of G. If the halfsegment sequence of G should be exhausted (line 62), we know that F must have a segment whose interior is outside of G (line 63). If after the while-loop only F is exhausted but not G (line 66), G must have a boundary segment that is disjoint from F (line 67). Let l be the number of halfsegments of F, m be the number of attributed halfsegments of G, and k be the total number of new halfsegments created due to our splitting strategy. The while-loop is then executed at most l + m + k times. All operations needed on the sweep line status require O(log(l + m + k)) time each. Due to the splitting strategy, all dominating end points are already endpoints of existing segments or become endpoints of newly created I I " I! I " I! Figure Special case of the plane sweep. 132

133 segments. The operation look ahead needs constant time. In total, the algorithm requires O((l + m + k)log(l + m + k)) time and O(l + m + k) space The exploration algorithm for the region2d/region2d case The exploration algorithm for the region2d/region2d case is quite different from the preceding five cases, since it has to take into account the areal extent of both objects. The indices of the vector fields, with one exception described below, are not flags as before but segment classes. The fields of the vectors again contain Boolean values that are initialized with false. The main goal of the exploration algorithm is to determine the existing segment classes in each region2d object. Hence, the topological feature vector for each object is a segment classification vector. Each vector contains a field for the segment classes (0/1), (1/0), (0/2), (2/0), (1/2), (2/1), and (1/1). The following definition makes a connection between representational concepts and point set topological concepts as it is later needed in the evaluation phase. For a segment s = (p,q) seg2d, the function pts yields the infinite point set of s as pts(s) = {r R 2 r = p + λ(q p),λ R,0 λ 1}. Further, for F region2d, we define F = f H(F) pts( f.s), F = {p R 2 poiinregion(p,f)}, and F = R 2 F F. We can now define the semantics of this vector as follows: Definition 5.6 : Let F,G region2d and v F be the segment classification vector of F. Then, (i) v F [(0/1)] : f H(F) : f.ia pts( f.s) G (ii) v F [(1/0)] : f H(F) : f.ia pts( f.s) G (iii) v F [(1/2)] : f H(F) : f.ia pts( f.s) G (iv) v F [(2/1)] : f H(F) : f.ia pts( f.s) G (v) v F [(0/2)] : f H(F) g H(G) : f.s = g.s f.ia g.ia (vi) v F [(2/0)] : f H(F) g H(G) : f.s = g.s f.ia g.ia (vii) v F [(1/1)] : f H(F) g H(G) : f.s = g.s ((f.ia g.ia) ( f.ia g.ia)) (viii) v F [bound poi shared] : f H(F) g H(G) : f.s g.s dp( f ) = dp(g) 133

134 The segment classification vector v G of G includes the cases (i) to (iv) with F and G swapped; we omit the flags for the cases (v) to (viii) due to their symmetry (or equivalence) to flags of F. The flag bound poi shared indicates whether any two unequal boundary segments of both objects share a common point. Before the splitting, such a point may have been a segment endpoint or a proper segment intersection point for each object. The determination of the boolean value of this flag also includes the treatment of a special case illustrated in Figure If two regions F and G meet in a point like in the example, such a topological meeting situation cannot be detected by a usual plane sweep. The reason is that the plane sweep forgets completely about the already visited segments (right halfsegments) left of the sweep line. In our example, after s 1 and s 2 have been removed from the sweep line status, any information about them is lost. When s 3 is inserted into the status sweep line, its meeting with s 2 cannot be detected. Our solution is to look ahead in object G for a next halfsegment with the same dominating point before s 2 is removed from the sweep line status. The segment classification is computed by the algorithm in Figure The while-loop is executed as long as none of the two objects has been processed (line 8) and as long as not all topological flags have been set to true (lines 8 to 12). Then, according to the halfsegment order, the next halfsegment h is obtained, which belongs to one or both objects, and the variables for the last considered dominating points in F and/or G are updated (lines 13 to 20). Next, we check for a possible common boundary point in F and G (lines 21 to 25). This is the case if the last dominating points of F and G are equal, or the last dominating point in F (G) coincides with the next dominating point in G (F). The latter algorithmic step, in particular, helps us solve the special situation in Figure If h is a right halfsegment (line 26), we update the topological feature vectors of F and/or G correspondingly (lines 27 to 32) and remove its segment component s from the sweep line status (line 33). In case that h is a left halfsegment, we insert its segment component s into the sweep line status (line 34) according to the y-order of its dominating point and the y-coordinates of the intersection points of the current sweep line with the segments momentarily in the sweep line status. If h s segment component s either belongs to 134

135 01 algorithm ExploreRegion2DRegion2D 02 input: region2d objects F and G, topological feature 03 vectors vf and vg initialized with false 04 output: updated vectors vf and vg 05 begin 06 S := new sweep(); last dp in F := ε; last dp in G := ε; 07 select first(f, G, object, status); 08 while status = end of none and not (vf[(0/1)] and vf[(1/0)] 09 and vf[(1/2)] and vf[(2/1)] and vf[(0/2)] and 10 vf[(2/0)] and vf[(1/1)] and vf[bound poi shared] 11 and vg[(0/1)] and vg[(1/0)] and vg[(1/2)] and 12 vg[(2/1)]) do 13 if object = first then /* h = (s,d) */ 14 h := get event(f); last dp in F := dp(h) 15 else if object = second then 16 h := get event(g); last dp in G := dp(h) 17 else /* object = both */ 18 h := get event(f); 19 last dp in F := dp(h); last dp in G := dp(h) 20 endif; 21 if last dp in F = last dp in G 22 or last dp in F = look ahead(h, G) 23 or last dp in G = look ahead(h, F) then 24 vf[bound poi shared] := true 25 endif; 26 if d = right then 27 {(ms/ns)} := get attr(s); 28 if object = first then vf[(ms/ns)] := true 29 else if object = second then vg[(ms/ns)] := true 30 else if object = both then 31 vf[(ms/ns)] := true; vg[(ms/ns)] := true 32 endif; 33 del right(s, s) 34 else add left(s, s); 35 if coincident(s, s) then object := both endif; 36 if not pred exists(s, s) then (mp/np) := ( /0) 37 else {(mp/np)} := get pred attr(s) endif; 38 ms := np; ns := np; 39 if object = first or object = both then 40 if get attr(f) then ns := ns else ns := ns 1 endif 42 endif; 43 if object = second or object = both then 44 if get attr(g) then ns := ns else ns := ns 1 endif 46 endif; 47 set attr(s, {(ms/ns)}); 48 endif; 49 select next(f, G, object, status); 50 endwhile; 51 if status = end of first then 52 vg[(0/1)] := true; vg[(1/0)] := true 53 else if status = end of second then 54 vf[(0/1)] := true; vf[(1/0)] := true 55 endif 56 end ExploreRegion2DRegion2D. Figure Algorithm for computing the topological feature vectors for two region2d objects 135

136 F or to G, but not to both objects, and partially coincides with a segment from the other object in the sweep lines status, our splitting strategy is applied. Its effect is that the segment we currently consider suddenly belongs to both objects. Therefore, we modify the object variable in line 35 correspondingly. Next, we compute the segment class of s. For this purpose, we determine the lower and upper overlap numbers m p and n p of the predecessor p of s (lines 36 to 37). If there is no predecessor, m p gets the undefined value. The segment classification of the predecessor p is important since the lower overlap number m s of s is assigned the upper overlap number n p of p, and the upper overlap number n s of s is assigned its incremented or decremented lower overlap number, depending on whether the Boolean flag Interior Above obtained by the predicate get attr is true or false respectively (lines 39 to 46). The newly computed segment classification is then attached to s (line 47). The possible 19 segment class constellations between two consecutive segments in the sweep line status are shown in Table 5-2. The table shows which segment classes (m s /n s ) a new segment s just inserted into the sweep line status can get, given a certain segment class (m p /n p ) of a predecessor segment p. The first two columns show the special case that at the beginning the sweep line status is empty and the first segment is inserted. This segment can either be shared by both region objects ((0/2)-segment) or stems from one of them ((0/1)-segment). In all these cases (except the first two cases), n p = m s must hold. Let l be the number of attributed halfsegments of F, m be the number of attributed halfsegments of G, and k be the total number of new halfsegments created due to our splitting strategy. The while-loop is then executed at most l + m + k times. All operations needed on the sweep line status require at most O(log(l + m + k)) time each. The operations on the halfsegment sequences Table 5-2. Possible segment class constellations between two consecutive segments in the sweep line status. n s m s n p m p

137 of F and G need constant time. In total, the algorithm requires O((l + m + k)log(l + m + k)) time and O(l + m + k) space The Evaluation Phase for Matching Topological Predicates In the previous section, we have determined the topological feature vectors v F and v G of two complex spatial objects F α and G β with α,β {point,line,region}. The vectors v F and v G contain specific topological feature flags for each type combination. The flags capture all topological situations between F and G and are different for different type combinations. The goal of the evaluation phase is to leverage the output of the exploration phase, that is, v F and v G, either for verifying a given topological predicate or for determining such a predicate. Our general evaluation strategy is to accommodate the objects topological feature vectors with an existing topological predicate for both predicate verification and predicate determination. Section presents an ad hoc evaluation method called direct predicate characterization. Learning from its shortcomings, in Section , we propose a novel, systematic, provably correct, and general evaluation method called 9-intersection matrix characterization. The next two subsections elaborate on a particular step of the general method that is dependent on the type combination under consideration. Section deals with the special region/region case while Section handles the cases of all other type combinations Direct predicate characterization: a simple evaluation method The first method provides a direct predicate characterization of all n topological predicates of each type combination (see Table 2-2B for the different values of n) and is based on the topological feature flags of v F and v G of the two spatial argument objects F and G. That is, for the line/line case, we have to determine which topological feature flags of v F and v G must be turned on and which flags must be turned off so that a given topological predicate (verification query) or a predicate to be found (determination query) is fulfilled. For the region/region case, the central question is to which segment classes the segments of both objects must belong so that a given topological predicate or a predicate to be found is satisfied. The direct predicate characterization gives an answer for each individual predicate of each individual type combination. This means 137

138 that we obtain 184 individual predicate characterizations without converse predicates and 248 individual predicate characterizations with converse predicates. In general, each characterization is a Boolean expression in conjunctive normal form and expressed in terms of the topological feature vectors v F and v G. We give two examples of direct predicate characterizations. As a first example, we consider the topological predicate number 8 (meet) between two line objects F and G (Figure 5-15A and [59]) and see how the flags of the topological feature vectors (Definition 5.4) are used. p 8 (F,G) : v F [seg shared] v F [interior poi shared] v F [seg unshared] v F [bound on interior] v F [bound shared] v F [bound disjoint] v G [seg unshared] v G [bound on interior] v G [bound disjoint] If we take into account the semantics of the topological feature flags, the right side of the equivalence means that both objects may only and must share boundary parts. More precisely and by considering the matrix in Figure 5-15A, intersections between both interiors ( v F [seg shared], v F [interior poi shared]) as well as between the boundary of one object and the interior of the other object ( v F [bound on interior], v G [bound on interior]) are not allowed; besides intersections between both boundaries (v F [bound shared), each component of one object must interact with the exterior of the other object (v F [seg unshared], v G [seg unshared], v F [bound disjoint], v G [bound disjoint]) A B Figure The 9-intersection matrices. A) Matrix number 8 for the predicate meet between two line objects. B) Matrix number 7 for the predicate inside between two region objects. Next, we view the topological predicate number 7 (inside) between two region objects F and G (Figure 5-15B and [59]) and see how the segment classes kept in the topological feature vectors (Definition 5.6) are used. 138

139 p 7 (F,G) : v F [(0/1)] v F [(1/0)] v F [(0/2)] v F [(2/0)] v F [(1/1)] v F [bound poi shared] (v F [(1/2)] v F [(2/1)]) v G [(1/2)] v G [(2/1)] (v G [(0/1)] v G [(1/0)]) For the inside predicate, the segments of F must be located inside of G since the interior and boundary of F must be located in the interior of G; hence they must all have the segment classes (1/2) or (2/1). This for all quantification is tested by checking whether v F [(1/2)] or v F [(2/1)] are true and whether all other vector fields are false. The fact that all other vector fields are false means that the interior and boundary of F do not interact with the boundary and exterior of G. That is, the segments of G must be situated outside of F, and thus they all must have the segment classes (0/1) or (1/0); other segment classes are forbidden for G. Further, we must ensure that no segment of F shares a common point with any segment of G ( v F [bound poi shared]). The predicate characterizations can be read in both directions. If we are interested in predicate verification, that is, in evaluating a specific topological predicate, we look from left to right and check the respective right side of the predicate s direct characterization. This corresponds to an explicit implementation of each individual predicate. If we are interested in predicate determination, that is, in deriving the topological relationship from a given spatial configuration of two spatial objects, we have to look from right to left. That is, consecutively we evaluate the right sides of the predicate characterizations by applying them to the given topological feature vectors v F and v G. For the characterization that matches we look on its left side to obtain the name or number of the predicate. The direct predicate characterization demonstrates how we can leverage the concept of topological feature vectors. However, this particular evaluation method has three main drawbacks. First, the method depends on the number of topological predicates. That is, each of the 184 (248) topological predicates between complex spatial objects requires an own specification. Second, in the worst case, all direct predicate characterizations with respect to a particular type combination have to be checked for predicate determination. Third, the direct predicate characterization is error-prone. It is difficult to ensure that each predicate 139

140 characterization is correct and unique and that all predicate characterizations together are mutually exclusive and cover all topological predicates. From this standpoint, this solution is an ad hoc approach The 9-intersection matrix characterization method The drawbacks of the direct predicate characterization are the motivation for another, novel approach called 9-intersection matrix characterization (9IMC) that avoids these shortcomings. In particular, its correctness can be formally proved. Instead of characterizing each topological predicate directly, the central idea of our second approach is to uniquely characterize each element of the 3 3-matrix of the 9-intersection model (Figure 2-2A) by means of the topological feature vectors v F and v G. As we know, each matrix element is a predicate called matrix predicate that checks one of the nine intersections between the boundary F, interior F, or exterior F of a spatial object F with the boundary G, interior G, or exterior G of another spatial object G for inequality to the empty set. For each topological predicate, its specification is then given as the logical conjunction of the characterizations of the nine matrix predicates. Since the topological feature vectors are different for each type combination, the characterization of each matrix predicate is different for each type combination too. The characterizations themselves are the themes of the next subsections. The general method for predicate verification works as follows. Based on the topological predicate p to be verified as well as v F and v G as input, we evaluate in a loop the characterizations of all matrix predicates numbered from left to right and from top to bottom. The ninth matrix predicate F G always yields true [59]; hence, we do not have to check it. After the computation of the value of the matrix predicate i (1 i 8), we compare it to the corresponding value of the matrix predicate p(i) of p. If the values are equal, we proceed with the next matrix predicate i + 1. Otherwise, we stop, and p yields false. If there is a coincidence between the computed values of all matrix predicates with the corresponding values of p s matrix, p yields true. The benefit of this approach is that it only requires eight predicate characterizations and that these characterizations are the same for each of the n topological predicates of the same type 140

141 combination. In particular, an individual characterization of all n topological predicates is not needed. In Section , we show that this method can be even further improved. The general method for predicate determination works as follows. Based on v F and v G as input, we evaluate the 9IM characterizations of all eight matrix predicates and insert the Boolean values into an intersection matrix m initialized with true for each matrix predicate. Matrix m is then compared against the matrices p i (1 i n) of all n topological predicates. We know that one of them must match m. The merit of this approach is that only eight characterizations are needed to determine the intersection matrix of the topological predicate. But unfortunately we need n matrix comparisons to determine the pertaining topological predicate in the worst case. In Section , we introduce a method that eliminates this problem. But the method here is already a significant improvement compared with the necessity to compute all n direct predicate characterizations Type combination dependent 9-intersection matrix characterization The last, missing step refers to the characterizations of the eight matrix predicates of the 9-intersection matrix for all spatial data type combinations. A 9IMC means that each matrix predicate, which takes abstract, infinite point sets F and G representing spatial objects as arguments, is uniquely characterized by the topological feature vectors v F and v G, which are discrete implementation concepts. For this purpose, for each discrete spatial object F α {point,line,region}, we determine the corresponding abstract point sets of its boundary, interior, and exterior. For the region data type, we have already done this for Definition 5.6. For F point, we define F =, F = P(F), and F = R 2 P(F). For F line, we define F = {p R 2 card({ f H(F) p = dp( f )}) = 1}, F = f H(F) pts( f.s) F, and F = R 2 F F. As we will see, each characterization can be performed in constant time, and its correctness can be shown by a simple proof. In this subsection, we present the characterizations for all type combinations except for the more complicated case of two region objects; this case is dealt with in the next subsection. The central idea in the proofs of the lemmas below is to accomplish a correspondence between a matrix predicate based on the point sets F, 141

142 F, F, G, G, and G and an equivalent Boolean expression based on finite representations like P(F),H(F), B(F), P(G),H(G), and B(G). In case of two point objects, the 3 3-matrix is reduced to a 2 2-matrix since the boundary of a point object is defined to be empty [59]. We obtain the following statement: Lemma 5.1 : Let F,G point. Then the characterization of the matrix predicates of the (reduced) 9-intersection matrix is as follows: (i) F G v F [poi shared] (ii) F G v F [poi dis joint] (iii) F G v G [poi dis joint] (iv) F G true Proof. In (i), the intersection of the interiors of F and G is non-empty if, and only if, both objects share a point. That is, f P(F) g P(G) : equal( f, g). This matches directly the definition of v F [poi shared] in Definition 5.1(i). In (ii), a point of F can only be part of the exterior of G if it does not belong to G. That is, f P(F) g P(G) : equal( f,g). This fits directly to the definition of v F [poi dis joint] in Definition 5.1(ii). Case (iii) is symmetric to (ii). Case (iv) follows from Lemma in [59]. In case of a point object and a line object, the 3 3-matrix is reduced to a 2 3-matrix since the boundary of a point object is defined to be empty. We obtain the following statement: Lemma 5.2 : Let F point and G line. Then the characterization of the matrix predicates of the (reduced) 9-intersection matrix is as follows: (i) F G v F [poi on interior] (ii) F G v F [poi on bound] (iii) F G v F [poi dis joint] (iv) F G true (v) F G v G [bound poi dis joint] (vi) F G true 142

143 Proof. In (i), the intersection of the interiors of F and G is non-empty if, and only if, a point of F is located on G but is not a boundary point of G. That is, f P(F) g H(G) b B(G) : on( f,g.s) f b. This corresponds directly to the definition of v F [poi on interior] in Definition 5.2(ii). In (ii), the intersection of the interior of F and the boundary of G is non-empty if, and only if, a point of F coincides with a boundary point of G. That is, f P(F) g B(G) : f = g. But this matches the definition of v F [poi on bound] in Definition 5.2(iii). Statement (iii) is satisfied if, and only if, a point of F is outside of G. That is, f P(F) g H(G) : on( f,g.s). But this is just the definition of v F [poi dis joint] in Definition 5.2(i). Statement (iv) always holds according to Lemma in [59]. To be fulfilled, statement (v) requires that a boundary point of G lies outside of F. That is, g B(G) f P(F) : f g. This corresponds to the definition of v G [bound poi disjoint] in Definition 5.2(iv). The last statement follows from Lemma in [59]. In case of a point object and a region object, we also obtain a reduction of the 3 3-matrix to a 2 3-matrix. We obtain the following statement: Lemma 5.3 : Let F point and G region. Then the characterization of the matrix predicates of the (reduced) 9-intersection matrix is as follows: (i) F G v F [poi inside] (ii) F G v F [poi on bound] (iii) F G v F [poi outside] (iv) F G true (v) F G true (vi) F G true Proof. Statement (i) requires that a point of F is located inside G but not on the boundary of G. That is, f P(F) : poiinregion( f,g) (where poiinregion is the predicate which checks whether a single point lies inside a region object). This corresponds directly to the definition of v F [poi inside] in Definition 5.3(i). In (ii), the intersection of F and the boundary of G is non-empty if, and only if, a point of F lies on one of the boundary segments of G. That is, 143

144 f P(F) (g,ia) H(G) : on( f,g.s). This matches the definition of v F [poi on bound] in Definition 5.3(ii). Statement (iii) is satisfied if, and only if, a point of F is outside of G. That is, f P(F) (g, ia) H(G) : poiinregion( f, G) on( f, g.s). This corresponds to the definition of v F [poi outside] in Definition 5.3(iii). Statements (iv) and (v) follow from Lemma in [59]. The last statement follows from Lemma in [59]. In case of two line objects, we obtain the following statement: Lemma 5.4 : Let F,G line. Then the characterization of the matrix predicates of the 9-intersection matrix is as follows: (i) F G v F [seg shared] v F [interior poi shared] (ii) F G v G [bound on interior] (iii) F G v F [seg unshared] (iv) F G v F [bound on interior] (v) F G v F [bound shared] (vi) F G v F [bound dis joint] (vii) F G v G [seg unshared] (viii) F G v G [bound dis joint] (ix) F G true Proof. In (i), the interiors of two line objects intersect if, and only if, any two segments partially or completely coincide or if two segments share a single point that does not belong to the boundaries of F and G. That is, f H(F) g H(G) : segintersect( f.s,g.s) f H(F) g H(G) p B(F) B(G) : poiintersect( f.s, g.s) poiintersection( f.s, g.s) p. The first expression corresponds to the definition of v F [seg shared] in Definition 5.4(i). The second expression is the definition of v F [interior poi shared] in Definition 5.4(ii). Statement (ii) requires that an intersection point p of F and G exists such that p is a boundary point of G but not a boundary point of F. That is, f H(F) g H(G) p B(G) \ B(F) : poiintersection( f.s,g.s) = p. This matches the definition of v G [bound on interior] in Definition 5.4(viii). Statement (iii) is satisfied if, and only if, there is a segment of F that is outside of 144

145 G. That is, f H(F) g H(G) : segintersect( f.s, g.s). This corresponds to the definition of v F [seg unshared] in Definition 5.4(iii). Statement (iv) is symmetric to statement (ii) and based on Definition 5.4(iv). In (v), the boundaries of F and G intersect if, and only if, they share a boundary point. That is, p B(F) q B(G) : p = q. This matches the definition of v F [bound shared] in Definition 5.4(v). Statement (vi) requires the existence of a boundary point of F that is not located on any segment of G. That is, p B(F) g H(G) : on(p,g.s). This corresponds to the definition of v F [bound disjoint] in Definition 5.4(vi). Statement (vii) is symmetric to statement (iii) and based on Definition 5.4(vii). Statement (viii) is symmetric to statement (vi) and based on Definition 5.4(ix). The last statement follows from Lemma in [59]. In case of a line object and a region object, we obtain the following statement: Lemma 5.5 : Let F line and G region. Then the characterization of the matrix predicates of the 9-intersection matrix is as follows: (i) F G v F [seg inside] (ii) F G v F [seg shared] v F [poi shared] (iii) F G v F [seg outside] (iv) F G v F [bound inside] (v) F G v F [bound shared] (vi) F G v F [bound dis joint] (vii) F G true (viii) F G v G [seg unshared] (ix) F G true Proof. In (i), the interiors of F and G intersect if, and only if, a segment of F is located in G but does not coincide with a boundary segment of G. That is, f H(F) g H(G) : segintersect( f.s, g.s) seginregion( f.s, G). This corresponds to the definition of v F [seg inside] in Definition 5.5(i). Statement (ii) requires that either F and G share a segment, or they share an intersection point that is not a boundary point of F. That is, f H(F) g H(G) : segintersect( f.s,g.s) f H(F) g H(G) : poiintersect( f.s,g.s) 145

146 poiintersection( f.s,g.s) / B(F). The first argument of the disjunction matches the definition of v F [seg shared] in Definition 5.5(ii). The second argument matches the definition of v F [poi shared] in Definition 5.5(iv). Statement (iii) is satisfied if, and only if, a segment of F is located outside of G. That is, f H(F) g H(G) : segintersect( f.s, g.s) seginregion( f.s,g). This corresponds to the definition of v F [seg outside] in Definition 5.5(iii). Statement (iv) holds if, and only if, a segment of F lies inside G and one of the end points of the segment is a boundary point. That is, f H(F) : poiinregion(dp( f ), G) dp( f ) B(F). This corresponds to the definition of v F [bound inside] in Definition 5.5(v). In (v), we must find a segment of F and a segment of G which intersect in a point that is a boundary point of F. That is, f H(F) g H(G) : poiintersect( f.s,g.s) poiintersection( f.s,g.s) B(F). This matches the definition of v F [bound shared] in Definition 5.5(vi). Statement (vi) requires the existence of an endpoint of a segment of F that is a boundary point and not located inside or on any segment of G. That is, f H(F) g H(G) : poiinregion(dp( f ),G) dp( f ) B(F) on(dp( f ),g.s). This corresponds to the definition of v F [bound disjoint] in Definition 5.5(vii). Statement (vii) always holds according to Lemma in [59]. Statement (viii) is satisfied if, and only if, a segment of G does not coincide with any segment of F. That is, g H(G) f H(F) : segintersect( f.s,g.s). This fits to the definition of v F [seg unshared] in Definition 5.5(viii). The last statement follows from Lemma in [59] The 9-intersection matrix characterization for region/region case As shown in Section , exploring the region/region case is quite different from exploring the other type combinations and requires another kind of exploration algorithm. It has to take into account the areal extent of both objects and has resulted in the concepts of overlap number, segment classes, and segment classification vector. In this subsection, we deal with the 9IMC based on two segment classification vectors. The goal of the following lemmas is to prepare the unique characterization of all matrix predicates by means of segment classes. The first lemma provides a translation of each segment class into a Boolean matrix predicate expression. 146

147 Lemma 5.6 : Let F,G region and v F and v G be their segment classification vectors. Then we can infer the following implications and equivalences between segment classes and matrix predicates: (i) v F [(0/1)] v F [(1/0)] F G (ii) v G [(0/1)] v G [(1/0)] F G (iii) v F [(1/2)] v F [(2/1)] F G (iv) v G [(1/2)] v G [(2/1)] F G (v) v F [(0/2)] v F [(2/0)] F G F G (vi) v F [(1/1)] F G F G F G Proof. According to Definition 5.6(i) and (ii), the left side of (i) is equivalent to the expression f H(F) : pts( f.s) G. This is equivalent to F G. The proof of (iii) is similar and based on Definition 5.6(iii) and (iv); only the term G has to be replaced by G. The proof of (ii) can be obtained by swapping the roles of F and G in (i). Similarly, the proof of (iv) requires a swapping of F and G in (iii). According to Definition 5.6(v) and (vi), the left side of (v) is equivalent to the expression f H(F) g H(G) : f.s = g.s ((f.ia g.ia) ( f.ia g.ia)). From the first element of the conjunction, we can (only) conclude that F G. Equivalence does not hold since two boundaries can also intersect if they only share single intersection or meeting points but not (half)segments. The second element of the conjunction requires that the interiors of both region objects are located on the same side. Hence, F G must hold. Also this is only an implication since an intersection of both interiors is possible without having any (0/2)- or (2/0)-segments. According to Definition 5.6(vii), the left side of (vi) is equivalent to the expression f H(F) g H(G) : f.s = g.s ((f.ia g.ia) ( f.ia g.ia)). The first element of the conjunction implies that F G. The second element of the conjunction requires that the interiors of both region objects are located on different sides. Since the definition of type region disallows (1/1)- segments for single objects, the interior of F must intersect the exterior of G, and vice versa. This 147

148 is only an implication since an intersection of the interior of one region object with the exterior of another region object is possible without having (1/1)-segments. The second lemma provides a translation of some matrix predicates into segment classes. Lemma 5.7 : Let F,G region and v F and v G be their segment classification vectors. Then we can infer the following implications between matrix predicates and segment classes: (i) F G v F [(0/2)] v F [(2/0)] v F [(1/2)] v F [(2/1)] v G [(1/2)] v G [(2/1)] (ii) F G v F [(0/1)] v F [(1/0)] v F [(1/1)] v G [(1/2)] v G [(2/1)] (iii) F G v F [(1/2)] v F [(2/1) v F [(1/1)] v G [(0/1)] v G [(1/0)] Proof. In (i), the intersection of the interiors of F and G implies that both objects share a common area. Consequently, this area must have overlap number 2 so that at least one of the two objects must have a (a/2)- or (2/a)-segment with a {0,1}. In (ii), the fact that F intersects G means that F contains an area which it does not share with G. That is, the overlap number of this area is 1, and F must have a (a/1)- or a (1/a)-segment with a {0,1}. The fact that a part of the interior of F is located outside of G implies two possible topological situations for G: either both objects share a common segment and their interiors are on different sides, i.e., G has a (1/1)-segment (covered by v F [(1/1)]), or the interior of F is intersected by the boundary and the interior of G so that G has a (1/2)- or (2/1)-segment. We prove (iii) by swapping F and G in (ii). The third lemma states some implications between matrix predicates. Lemma 5.8 : Let F,G region. Then we can infer the following implications between matrix predicates: 148

149 (i) v F [bound poi shared] F G (ii) F G F G F G (iii) F G F G F G (iv) F G F G F G (v) F G F G F G Proof. Statement (i) can be shown by considering the definition of bound poi shared. This flag is true if any two halfsegments of F and G share a single meeting or intersection point. Hence, the intersection of both boundaries is non-empty. The proofs for (ii) to (v) require point set topological concepts. Statements (ii) and (iii) follow from Lemma in [59]. Statements (iv) and (v) result from Lemma in [59]. The following theorem collects the results we have already obtained so far and proves the lacking parts of the nine matrix predicate characterizations. Theorem 5.1 : Let F,G region and v F and v G be their segment classification vectors. Then the matrix predicates of the 9-intersection matrix are equivalent to the following segment class characterizations: (i) F G v F [(0/2)] v F [(2/0)] v F [(1/2)] v F [(2/1)] v G [(1/2)] v G [(2/1)] (ii) F G v G [(1/2)] v G [(2/1)] (iii) F G v F [(0/1)] v F [(1/0)] v F [(1/1)] v G [(1/2)] v G [(2/1)] (iv) F G v F [(1/2)] v F [(2/1)] (v) F G v F [(0/2)] v F [(2/0)] v F [(1/1)] v F [bound poi shared] (vi) F G v F [(0/1)] v F [(1/0)] (vii) F G v F [(1/2)] v F [(2/1)] v F [(1/1)] v G [(0/1)] v G [(1/0)] (viii) F G v G [(0/1)] v G [(1/0)] (ix) F G true Proof. For (i), the forward implication corresponds to Lemma 5.7(i). The backward implication can be derived from Lemma 5.6(v) for (0/2)- and (2/0)-segments of F (and G). For 149

150 (1/2)- and (2/1)-segments, Lemma 5.6(iii) and 5.6(iv) imply F G and F G, respectively. From these two implications, by using Lemma 5.8(iv) and 5.8(v), we can derive in both cases F G. Statements (ii) and (iv) correspond to Lemma 5.6(iv) and 5.6(iii), respectively. For (iii) [(vii)], the forward implication corresponds to Lemma 5.7(ii) [5.7(iii)]. The backward implication for (iii) [(vii)] requires Lemma 5.6(i) [5.6(ii)] and Lemma 5.8(ii) [5.8(iii)] for the (0/1)- and (1/0)-segments of F [G], Lemma 5.6(vi) [5.6(vi)] for the (1/1)-segments of F (and hence G), as well as Lemma 5.6(iv) [5.6(iii)] and Lemma 5.8(v) [5.8(iv)] for the (1/2)- and (2/1)-segments of G [F]. For (v), the forward implication can be shown as follows: if the boundaries of F and G intersect, then either they share a common meeting or intersection point, that is, the flag v F [bound poi shared] is set, or there are two halfsegments of F and G whose segment components are equal. No other alternative is possible due to our splitting strategy for halfsegments during the plane sweep. As we know, equal segments of F and G must have the segment classes (0/2), (2/0), or (1/1). The backward implication requires Lemma 5.6(v) for (0/2)- and (2/0)-segments of F (and hence G), Lemma 5.6(vi) for (1/1)-segments of F (and hence G), and Lemma 5.8(i) for single meeting and intersection points. Statement (vi) [(viii)] corresponds to Lemma 5.6(i) [5.6(ii)]. Statement (ix) turns out to be always true since our assumption in an implementation is that our universe of discourse U is always properly larger than the union of spatial objects contained in it. This means for F and G that always F G U holds. We can conclude that U (F G). According to DeMorgan s Laws, this is equivalent to (U F) (U G). But this leads us to the statement that F G. Summarizing our results from the last two subsections, we see that Lemmas 5.1 to 5.5, and Theorem 5.1 provide us with a unique characterization of each individual matrix predicate of the 9-intersection matrix for each type combination. This approach has several benefits. First, it is a systematically developed and not an ad hoc approach. Second, it has a formal and sound foundation. Hence, we can be sure about the correctness of topological feature flags and segment classes assigned to matrix predicates, and vice versa. Third, this evaluation method is independent of the number of topological predicates and only requires a constant 150

151 number of evaluations for matrix predicate characterizations. Instead of nine, even only eight matrix predicates have to be checked since the predicate F G yields true for all type combinations. Fourth, we have proved the correctness of our provided implementation. Based on this result, we accomplish the predicate verification of a topological predicate p with respect to a particular spatial data type combination on the basis of p s 9-intersection matrix (as an example, see the complete matrices of the 33 topological predicates of the region/region case in Figure 5-20 and the complete matrices for the remaining cases in [50]) and the topological feature vectors v F and v G as follows: Depending on the spatial data type combination, we evaluate the logical expression (given in terms of v F and v G ) on the right side of the first 9IMC according to Lemma 5.1, 5.2, 5.3, 5.4, 5.5, or Theorem 5.1, respectively. We then match the Boolean result with the Boolean value at the respective position in p s intersection matrix. If both Boolean values are equal, we proceed with the next matrix predicate in the 9-intersection matrix; otherwise p is false, and the algorithm terminates. Predicate p yields true if the Boolean results of the evaluated logical expressions of all 9IMCs coincide with the corresponding Boolean values in p s intersection matrix. This requires constant time. Predicate determination also depends on a particular combination of spatial data types and leverages 9-intersection matrices and topological feature vectors. In a first step, depending on the spatial data type combination and by means of v F and v G, we evaluate the logical expressions on all right sides of the 9IMCs according to Lemma 5.1, 5.2, 5.3, 5.4, 5.5, or Theorem 5.1, respectively. This yields a Boolean 9-intersection matrix. In a second step, this Boolean matrix is checked consecutively for equality against all 9-intersection matrices of the topological predicates of the particular type combination. If n α,β with α,β {point,line,region} is the number of topological predicates between the types α and β, this requires n α,β tests in the worst case Optimized Evaluation Methods Based on the exploration phase and leveraging the 9-intersection matrix characterization, we have found a universal, correct, complete, and effective method for both predicate verification 151

152 and predicate determination of topological predicates. So far, we have focused on the general applicability and universality of our overall approach. In this section, we show that it is even possible to fine-tune and thus improve our 9IMC approach with respect to efficiency if we look at predicate verification and predicate determination separately. Section delineates a novel method called matrix thinning for speeding up predicate verification. Section describes a fine-tuned method called minimum cost decision tree for accelerating predicate determination Matrix thinning for predicate verification The approach of matrix thinning (MT) described in this subsection is based on the observation that for predicate verification only a subset of the nine matrix predicates has to be evaluated in order to determine the validity of a given topological relationship between two spatial objects F and G. For example, for the predicate 1 (disjoint) of the region/region case, the combination that F G = F G = holds (indicated by two 0 s) is unique among the 33 predicates. Consequently, only these two matrix predicates have to be tested in order to decide about true or false of this topological predicate. The question arises how the 9-intersection matrices can be systematically thinned out and nevertheless remain unique among the n α,β topological predicates between two spatial data types α and β. We use a brute-force algorithm (Figure 5-16) that is applicable to all type combinations and that determines the thinned out version of each intersection matrix associated with one of the n α,β topological predicates. Since this algorithm only has to be executed once for each type combination, runtime performance and space efficiency are not so important here. In a first step (lines 8 to 10), we create a matrix pos of so-called position matrices corresponding to all possible 9-intersection matrices, that is, to the binary versions of the decimal numbers 1 to 511 if we read the 9-intersection matrix (9IM) entries row by row. Each 1 in a position matrix indicates a position or entry that is later used for checking two intersection matrices against each other. A 0 in a position matrix means that the corresponding entries in two compared intersection matrices are not compared and hence ignored. 152

153 01 algorithm MatrixThinning 02 input: Three-dimensional 9IM im. im[i, l, m] {0, 1} 03 denotes entry (l,m) (1 l,m 3) of the ith 04 9IM (1 i n α,β ). 05 output: Three-dimensional thinned out 9IM tim. 06 tim[i, l, m] {0, 1, }. is don t care symbol. 07 begin 08 Create three-dimensional matrix pos of position 09 matrices where pos[ j, l, m] {0, 1} denotes entry 10 (l,m) of the jth possible 9IM (1 j 511); 11 Sort pos increasingly with respect to the number of 12 ones in a matrix; 13 Initialize all entries of matrices of tim with ; r := 1; 14 // Compute thinned out matrices 15 for each i in 1...n α,β do 16 j := 1; stop := false; 17 while j 511 and not stop do 18 k := 1; unequal := true; 19 while 1 k n α,β and i k and unequal do 20 equal := im[i] and im[k] have the same values 21 at all positions (l, m) where pos[ j, l, m] = 1; 22 unequal := unequal and not equal; inc(k); 23 endwhile; 24 if unequal then // Thin out im[i] by pos[ j]. 25 for each l,m in do 26 if pos[ j,l,m] = 1 27 then tim[r, l, m] := im[i, l, m] endif 28 endfor; 29 inc(r); stop := true; 30 else inc( j); 31 endif 32 endwhile 33 endfor 34 end MatrixThinning. Figure Algorithm for computing the thinned out versions of the n α,β intersection matrices associated with the topological predicates between two spatial data types α and β 153

154 Because our goal is to minimize the number of matrix predicates that have to be evaluated, in a second step, we sort the position matrices with respect to the number of ones in increasing order (lines 11 to 12). That is, the list of position matrices will first contain all matrices with a single 1, then the matrices with two ones, etc., until we reach the matrix with nine ones. At the latest here, it is guaranteed that an intersection matrix is different to all the other n α,β 1 intersection matrices. Hence, our algorithm terminates. In a third step, we initialize the entries of all n α,β thinned out intersection matrices with the don t care symbol. The fourth and final step computes the thinned out matrices (lines 15 to 33). The idea is to find for each intersection matrix (line 15) a minimal number of entries that together uniquely differ from the corresponding entries of all the other n α,β 1 intersection matrices. Therefore, we start traversing the 511 position matrices (line 17). For all 1 -positions of a position matrix we find out whether for the intersection matrix under consideration another intersection matrix exists that has the same matrix values at these positions (lines 20 to 21). As long as no equality has been found, the intersection matrix under consideration is compared to the next intersection matrix (lines 19 to 23). If an equality is found, the next position matrix is taken (line 30). Otherwise, we have found a minimal number of matrix predicates that are sufficient and unique for evaluation (line 24). It remains to copy the corresponding values of the 9-intersection matrix into the thinned out matrix (lines 25 to 28) : : : : : Figure Complete and thinned out matrices for the 5 topological predicates of the point/point case. Note that for the same intersection matrix it may be possible to find several thinned out matrices with the same number of matrix predicates to be checked such that each of them represents the intersection matrix uniquely among the n α,β intersection matrices. Our algorithm always computes the thinned out matrix with the lowest numerical value. The complete and 154

155 : : : : : : : : : : : : : : Figure Complete and thinned out matrices for the 14 topological predicates of the point/line case : : : : : : : Figure Complete and thinned out matrices for the 7 topological predicates of the point/region case. thinned out matrices for the point/point case are shown in Figure 5-17, for the point/line case in Figure 5-18, for the point/region case in Figure 5-19, and for the region/region case in Figure The complete and thinned out matrices for the line/line case and the line/region case can be found in [50]. Definition 5.7 defines the measures we use to summarize and interpret these results : : : : : : : : : : : : : : : : : 18: 23: 28: 33: : : : 19: 24: 29: : : : 20: 25: 30: Figure Complete and thinned out matrices for the 33 topological predicates of the region/region case

156 Definition 5.7 : Let IM MT be a thinned out 9IM, and cnt be a function that counts the number of relevant matrix predicates of IM MT. Let n α,β with α,β {point,line,region} be the number of (thinned out) 9IMs of the topological predicates between the types α and β, and n k α,β be the number of thinned out 9IMs for which k (with 1 k 9) matrix predicates have to be evaluated. Let the cost, that is, the total number of matrix predicates to be evaluated for α and β, be C α,β without matrix thinning and Cα,β MT with matrix thinning. We then denote with RACMT α,β the reduced average cost in percent when using matrix thinning. We obtain: (i) cnt(im MT ) = {(l,m) 1 l,m 3,IM MT [l,m] {0,1}} (ii) n k α,β = {IM MT i (iii) n α,β = 9 k=1 nk α,β (iv) C α,β = 8 n α,β (v) AC α,β = C α,β /n α,β = 8 (vi) (vii) (viii) C MT α,β = 9 k=1 k nk α,β AC MT α,β = C MT α,β /n α,β 1 i n α,β,1 k 9,cnt(IM MT i ) = k} RAC MT α,β = 100 AC MT α,β /AC α,β = 100 C MT α,β /C α,β AC MT α,β denotes the average number of matrix predicates to be evaluated. Table 5-3 shows a summary of the results and in the last two columns the considerable performance enhancement of matrix thinning. The reduction of matrix predicate computations ranges from 27% for the line/line case to 75% for the point/point case. Table 5-3. Summary of complete and thinned out 9IMs for the topological predicates of all type combinations. n k α,β with k = Type combination n α,β C α,β AC α,β Cα,β MT α,β RACMT α,β point / point line / line region / region point / line point / region line / region

157 Minimum cost decision tree for predicate determination In Section 5.2.3, we have seen that, in the worst case, n α,β matching tests are needed to determine the topological relationship between any two spatial objects. For each test, Boolean expressions have to be evaluated that are equivalent to the eight matrix predicates and based on topological feature vectors. We propose two methods to improve the performance. The first method reduces the number of matrix predicates to be evaluated. This goal can be directly achieved by applying the method of matrix thinning described in Section That is, the number n α,β of tests remains the same but for each test we can reduce the number of matrix predicates that have to be evaluated by taking the thinned out instead of the complete 9-intersection matrices. The second method, which will be our focus in this subsection, aims at reducing the number n α,β of tests. This method is based on the complete 9-intersection matrices but also manages to reduce the number of matrix predicates that have to be evaluated. We propose a global concept called minimum cost decision tree (MCDT) for this purpose. The term global means that we do not look at each intersection matrix individually but consider all n α,β intersection matrices together. The idea is to construct a full binary decision tree whose inner nodes represent all matrix predicates, whose edges represent the Boolean values true or false, and whose leaf nodes are the n α,β topological predicates. Note that, in a full binary tree, each node has exactly zero or two children. For searching, we employ a depth-first search procedure that starts at the root of the tree and proceeds down to one of the leaves which represents the matching topological predicate. The performance gain through the use of a decision tree is significant since the tree partitions the search space at each node and gradually excludes more and more topological predicates. In the best case, at each node of the decision tree, the search space, which comprises the remaining topological predicates to be assigned to the remaining leaves of the node s subtree, is partitioned into two halves so that we obtain a perfectly balanced tree. This would guarantee a search time of O(logn α,β ). But in general, we cannot expect to obtain a bisection of topological predicates at each node since the number of topological predicates yielding true for the node s 157

158 matrix predicate will be different from the number of topological predicates yielding false for that matrix predicate. An upper bound is the number 8, since at most eight matrix predicates have to be checked to identify a topological predicate uniquely; the ninth matrix predicate yields always true. Hence, our goal is to determine a nearly balanced, cost-optimal, full binary decision tree for each collection of n α,β intersection matrices. If we do not have specific knowledge about the probability distribution of topological predicates in an application (area), we can only assume that they occur with equal distribution. But sometimes we have more detailed information. For example, in cadastral map applications, an adequate estimate is that 95% (or even more) of all topological relationships between regions are disjoint and the remaining 5% are meet. Our algorithm for constructing MCDTs considers these frequency distributions. It is based on the following cost model: Definition 5.8 : Let M α,β be an MCDT for the spatial data types α,β {point,line,region}, w i be the weight of the topological predicate p i with 1 i n α,β and 0 < w i < 1, and d i with 1 d i 8 be the depth of a node in M α,β at which p i is identified. We define the total cost C MCDT α,β of M α,β as Cα,β MCDT n α,β = w i d i i=1 with n α,β w i = 1 i=1 That is, our cost model is to sum up all the weighted path lengths from each leaf node representing a topological predicate to the root of the MCDT. If all topological predicates occur with equal probability, we set w i = 1 n α,β. The issue now is how to find and build an optimal MCDT with minimal total cost C MCDT α,β on the basis of a given probability distribution (weighting) for the topological predicates. If all topological predicates occur with equal probability, this problem corresponds to finding an optimal MCDT that requires the minimal average number of matrix predicate evaluations to arrive at an answer. Figure 5-21 shows our recursive algorithm MCDT for computing a minimum cost decision tree for a set im of n α,β 9-intersection matrices that are annotated with a weight representing the corresponding predicates s probability of occurrence, as it is characteristic in a particular 158

159 01 algorithm MCDT 02 input: list im = (im 1,w 1 ),...,(im nα,β,w nα,β ) of 9IMs 03 with weights, list mp of the eight matrix predicates 04 output: MCDT M α,β 05 begin 06 best node := new node(); stop := false; 07 discriminator := select first(mp); 08 while not eol(mp) and not stop do 09 node := new node(); 10 node.discr := discriminator; node.im := im; 11 if no of elem(im) = 1 then /* leaf node */ 12 best node := node; best node.cost := 0; 13 stop := true; 14 else 15 /* Let im = (im k1,w k1 ),...,(im kn,w kn ) 16 with 1 k 1... k n n α,β. */ 17 partition(im, discriminator, im l, im r ); 18 if no of elem(im l ) 0 and 19 no of elem(im r ) 0 then 20 copy(mp, new mp); del(new mp, discriminator); 21 node.lchild := MCDT(im l, new mp); 22 node.rchild := MCDT(im r, new mp); 23 node.cost := node.lchild.cost + node.rchild.cost 24 + k n i=k 1 w i ; 25 if node.cost < best node.cost 26 then best node := node; endif; 27 endif; 28 discriminator := select next(mp); 29 endif 30 endwhile; 31 return best node; 32 end MCDT. Figure Minimum cost decision tree algorithm application (line 2). Later these matrices become the leaves of the decision tree. In addition, the algorithm takes as an input the list mp of eight matrix predicates (we remember that the exterior/exterior intersection yields always true) that serve as discriminators and are attached to the inner nodes (line 3). This list is necessary to ensure that a matrix predicate is not used more than once as a discriminator in a search path. During the recursion, the while-loop (lines 8 to 30) terminates if either the list mp of matrix predicates to be processed is empty or the list 159

160 im of 9-intersection matrices contains only a single element. For each matrix predicate used as a discriminator, the operation new node creates a new tree node node (line 9). The matrix predicate discriminator as well as the list im annotate the tree node node (line 10). If im has only one element (line 11), we know that node is a leaf node representing the topological predicate pertaining to the single element in im. The cost for this leaf node is 0 since its current depth is 0 (line 12). Otherwise, if im consists of more than one element, we partition it into two lists im l and im r (line 17). The partitioning is based on the values of each 9-intersection matrix in im with respect to the matrix predicate serving as the discriminator. If such a value is 0 (false), the corresponding 9-intersection matrix is added to the list im l ; otherwise, it is added to the list im r. A special case now is that im has not been partitioned so that either im l or im r is empty (condition in lines 18 to 19 yields false). In this case, the discriminator does not contribute to a decision and is skipped; the next discriminator is selected (line 28). If both lists im l and im r are nonempty (lines 18 to 19), we remove the discriminator from a new copy new mp of the list mp (line 20) and recursively find the minimum cost decision trees for the 9-intersection matrices in im l (line 21) and in im r (line 22). Eventually, all recursions will reach all leaf nodes and begin returning while recursively calculating the cost of each subtree found. The cost of a leaf node is 0. The cost of an inner node node can be expressed in terms of the cost of its two nonempty subtrees node.lchild and node.rchild processing the lists im l and im r respectively. The depth of each leaf node with respect to node is exactly one larger than the depth of the same leaf node with respect to either node.lchild or node.rchild. Therefore, besides the costs of these two subtrees, for each leaf node of the subtree with root node, we have to add the leaf node s cost (weight) one time (lines 23 to 24). These weights are stored in node.im. The cost of node is then compared with the best cost determined so far, and the minimum will be the new best option (lines 25 to 26). Eventually, when all the matrix predicates have been considered, we obtain the best choice and return the corresponding minimum cost decision tree (line 31). Table 5-4 shows the results of this algorithm by giving a textual pre-order (depth-first search) encoding of all MCDTs for all type combinations on the basis of equal probability 160

161 Table 5-4. MCDT pre-order representations for all type combinations on the basis of equal probability of occurrence of all topological predicates. Type combination MCDT pre-order representation point / point line / line region / region point / line point / region line / region of occurrence of all topological predicates. The encodings allow an easy construction of the MCDTs. Since MCDTs are full binary trees, each node has exactly zero or two child nodes. We leverage this feature by representing an MCDT as the result of a pre-order tree traversal. The preorder sequence of nodes is unique in this case for constructing the decision tree since inner nodes with only one child node cannot occur. Each inner node in the pre-order sequence is described as a term XY where X,Y {,, }. Such a term represents a matrix predicate AX BY serving as a discriminator. For example, the term XY = denotes the matrix predicate A B (prefix notation for boundary). Each leaf node represents the 9-intersection matrix number of a topological predicate. The matrix numbers are specified in the Figures 5-17, 5-18, 5-19 and 5-20 as well as in [50, 59]. Figures 5-22 shows a visualization of the MCDTs of three spatial data type combinations on the assumption that all topological predicates occur with equal probability. The MCDTs for the other type combinations have been omitted due to their very large size. Each inner node is 161

162 annotated with a label XY where X {A, A,A } and Y {B, B,B }. A label represents a matrix predicate X Y serving as a discriminator. For example, the label XY = A B denotes the matrix predicate A B. If the evaluation of a matrix predicate yields false, we move to the left child; otherwise, we move to the right child. Each leaf node represents the 9-intersection matrix number of a topological predicate. The following definition specifies measures that we use to summarize and interpret these results. We are especially interested in the average number of matrix predicates to be evaluated. A B A B A B 2 3 A B 1 A B 4 5 A B 1 A B 2 3 A B A B A B A A B B A B A B A B 1 2 A B A B A B A B A B A B A B A B A B C Figure Minimum cost decision trees. A) For the 5 topological predicates of the point/point case. B) For the 7 topological predicates of the point/region case. C) For the 14 topological predicates of the point/line case under the assumption that all topological predicates occur with equal probability. Definition 5.9 : Let C MCDT α,β denote the total cost of an MCDT M α,β according to Definition 5.8. Let n α,β with α,β {point2d,line2d,region2d} be the number of 9IMs of the topological predicates between the types α and β, IM i with 1 i n α,β be a 9IM, and dα,β k be the 162

163 number of topological predicates associated with leaf nodes in M α,β of depth k (with 1 k 9). Further, let C α,β be the cost without using an MCDT, AC α,β be the average cost without using an MCDT, AC MCDT α,β be the average cost when using an MCDT, and RAC MCDT α,β average cost in percent when using an MCDT. The measures are defined as: be the reduced (i) d k α,β = {IM i 1 i n α,β,1 k 9,depth(IM i,m α,β ) = k} (ii) n α,β = 9 k=1 dk α,β (iii) C α,β = 8 n α,β (iv) AC α,β = 4 (n α,β + 1) (v) (vi) AC MCDT α,β = C MCDT RAC MCDT α,β /n α,β α,β = 100 AC MCDT α,β /AC α,β To determine the average cost AC α,β without using an MCDT in (iv), we observe that the best case is to check 8 matrix predicates, the second best case is to check 16 matrix predicates, etc., and the worst case is to check all 8 n α,β matrix predicates. The average number of matrix predicates that has to be checked without using an MCDT is therefore 8 ( n α,β )/n α,β = 4 (n α,β + 1). AC MCDT α,β in (v) yields the average number of matrix predicates to be evaluated. Table 5-5 shows a summary of the results and in the last two columns the considerable performance enhancement of minimum cost decision trees. The reduction of matrix predicate computations ranges from 90% for the point/point case to 98% for the line/line case. The MCDT approach is similar to a technique introduced in [10] for topological predicates between simple regions. However, their method of determining a binary decision tree rests on the thinned out 9-intersection matrices and results in a near optimal algorithm and solution. The reason why optimality is not achieved is that a topological predicate can have multiple, equipollent thinned out matrices, that is, thinned out matrices are not unique. Therefore, using a specific set of thinned out matrices as the basis for partitioning the search space can only lead to an optimal decision tree for this set of thinned out matrices and may not be optimal in the general case. Our algorithm rests on the complete 9-intersection matrices. It produces an optimal 163

164 Table 5-5. Summary of the MCDTs for all type combinations on the basis of equal probability of occurrence of all topological predicates. dα,β k with k = Type combination n α,β C α,β AC α,β Cα,β MCDT AC MCDT α,β RAC MCDT α,β point / point line / line region / region point / line point / region line / region decision tree (several optimal trees with the same total cost may exist) for the specified set of 9-intersection matrices and the given probability distribution. One can verify this by applying our algorithm to the eight 9-intersection matrices for two simple regions and the same probability distribution as specified in [10]. Our algorithm produces an optimal tree with the total cost of 2.13 while the so-called refined cost method in [10], which uses thinned out matrices, produces a tree with the total cost of We can observe the following relationship between MCDTs and thinned out matrices: Lemma 5.9 : For each combination of spatial data types α and β, the total cost of its minimum cost decision tree (given in Table 5-5) is greater than or equal to the total cost of all its thinned out matrices (given in Table 5-3), that is, C MCDT α,β C MT α,β Proof. The proof is given by contradiction. Assume that for a spatial data type combination the total cost of its MCDT is less than the total cost of all its thinned out matrices. Consequently, there must be at least one path from the root to a leaf in the MCDT that contains a smaller number of matrix predicates than the number of matrix predicates in the thinned out matrix for the topological predicate associated with that leaf. This implies that we can identify this topological predicate with a smaller number of matrix predicate decisions than the number of matrix predicates in its thinned out matrix. But this contradicts the definition of a thinned out matrix. 164

165 5.2.5 Interface Methods for Topological Predicates To verify the feasibility, practicality, correctness, and efficiency of the concepts presented, we have implemented and tested our approach. Details of our topological predicate implementation is provided later in Section 5.5. A qualitative assessment, performance study and analysis of this implementation is presented in Section 6.1. Here, we specify a set of function interfaces for our topological predicate implementation so that they can be used to support our spatiotemporal predicate implementation to be described in the next section. The topological predicate implementation provides three specific interface methods TopPredExploration, TopPredVerification, and TopPredDetermination and one universal interface method TopPred for providing the functionality of the exploration phase and the evaluation phase as well as the combined effect of both phases. The method TopPredExploration explores the topological data of interest for two interacting spatial objects. This interface is overloaded to accept two spatial objects of any type combination as input. Depending on the input object types, it executes one of the six plane sweep based exploration algorithms from Section The output consists of two topological feature vectors which hold the relevant topological information for both argument objects. The methods TopPredVerification and TopPredDetermination handle predicate verification and predicate determination queries respectively. Both interfaces are overloaded and take two topological feature vectors as input. Both methods leverage the general evaluation method of 9-intersection matrix characterization from Section The interface method TopPredVerification takes a predicate identification number as an additional input parameter. It corresponds to the matrix number (specified in [59] and used in Figures 5-17 to 5-19 and 5-20) of the topological predicate to be evaluated. The method implements the optimized evaluation technique of matrix thinning from Section The output is the Boolean value true if the topological relationship between the two spatial objects corresponds to the specified predicate; otherwise, the value is false. The interface method TopPredDetermination implements the optimized evaluation technique of minimum cost decision trees from Section and outputs the matrix number of 165

166 the topological predicate corresponding to the topological relationship between the two spatial objects. The universal interface method TopPred is overloaded to accept two spatial objects of any type combination and an optional predicate identification number as input. If the optional argument is specified, it triggers a predicate verification process by invoking TopPredExploration followed by TopPredVerification and returns a Boolean value as a result. Otherwise, a predicate determination process is to be executed, and thus it invokes TopPredExploration followed by TopPredDetermination and returns a predicate identification number corresponding to the topological relationship between the two spatial objects. This universal interface will be used in the next section to leverage the support for our spatiotemporal predicate implementation. 5.3 Algorithms for Spatiotemporal Predicates Spatiotemporal predicates between moving objects are not limited in their number since more elementary predicates can always be combined to more complex predicates and thus describe more complicated developments through specific construction operators like temporal composition, temporal alternative, and others (Section 2.2 and [22]). To formulate a specific algorithm for each newly constructed predicate would thus be very inefficient and troublesome. Hence, the idea is to devise a generic algorithmic scheme that can be leveraged for query evaluation and that is applicable also to developments which have so far not been defined The Algorithmic Scheme For the evaluation of a spatiotemporal predicate describing a development of topological relationship, it is helpful to conceptually consider moving objects as entities in the threedimensional (3D) space. A moving region is then considered as a volume, a moving line as a surface, and a moving point as a (3D) curve 4. A first, coarse approach to a generic algorithmic 4 Note that volumes, surfaces, and curves do not have an arbitrary structure in our case. That is, each moving region, moving line, or moving point can be mapped to a volume, surface, or curve respectively, but not vice versa. For a discussion, see [22]. 166

167 scheme works as follows: Taking the 3D counterparts of two moving objects being the operands of a spatiotemporal predicate, we compute their 3D geometric intersection. We do this in a way so that we obtain a sequence of time intervals together with the information about the corresponding parts of the two moving objects (each of which might be undefined), of their intersection, and of their topological relationship for each time interval. For example, in the moving point/moving region case, in a specific time interval (that can degenerate to a time instant), either the curve is inside the volume, or the curve runs along the volume border, or the curve is outside the volume, or one or even both objects are undefined. The essential point is that for each change in the topological relationship a new time interval is reported. The intersection procedures for other combinations of volumes, surfaces, and curves are analogous. This means that in principle we could compute the evolution of topological relationships between two spatial objects over time by using algorithms from computational geometry and from constructive solid geometry. We aim at avoiding their, though logarithmic, still considerable complexity and to find a more efficient solution. In any case, the validity of a spatiotemporal predicate can then be checked by matching the predicate against the computed evolution. Due to our sliced representation of moving objects as a sequence of units, from a 3D perspective a uregion value corresponds to a unit volume, a uline value to a unit surface, and a upoint value to a unit curve. Together with some optimizations, a spatiotemporal query predicate can be evaluated by a refined algorithmic scheme including the following steps: 1. Time-synchronized interval refinement: Since the unit intervals of both operand objects are usually incompatible, meaning that the start and end points of the intervals of the first operand often do not coincide with any start and end points of the intervals of the second operand, an interval refinement has to be computed covering all start and end points of unit intervals of both operands. An optimization is based on the fact that a spatiotemporal predicate is only defined at time instants and during periods in which both operand objects are defined. Hence, those time intervals can be skipped in which only one of the operands is defined 5. Finally, both operand objects are synchronized in the sense that for each unit 5 The case that both objects are undefined cannot occur because these time intervals are not explicitly stored in the object representations. 167

168 in the first object there exists a matching unit in the second object with the same, possibly reduced unit interval, and vice versa. 2. Function-valued interval refinement: Each pair of matching units in both objects has possibly to be further refined depending on the evolutions represented by the two unit functions. This is the case if both 3D unit objects intersect or touch each other and thus change their topological relationship. As a result, we will have computed the finest interval granularity needed for the determination of the topological relationship between two matching units. 3. Development determination: For each pair of matching units we now determine the unique, basic spatiotemporal predicate (period predicate) or topological relationship (instant predicate). We then sequentially collect the topological relationships of all matching units and in total obtain the development of the two operand objects of the spatiotemporal query predicate. 4. Pattern matching with query predicate: This step includes a pattern matching process between the development computed and the query predicate asking for evaluation. It results in one of the Boolean values true or false. Note that this step is not required for a query to determine the development. To enhance the comprehensibility of the algorithmic scheme, we have deliberately delineated its steps in a consecutive and separated manner. For example, steps 2 and 3 can easily be combined because during the computation of the intersection of two 3D unit objects (step 2) the spatiotemporal predicates can be directly derived (step 3). Even a completely interleaved execution of the algorithmic steps is possible since steps 1 to 4 can be nested. This leads to a slight increase in the algorithmic complexity but is a little faster by a constant factor, although it does not change the runtime complexity, as we will see later. The algorithmic scheme is independent of the predicate sequence of the development induced by the operand objects of the query predicate, and it also does not depend on the query predicate itself. Steps 1 and 4 are generic in the sense that they do not depend on the types of the operand objects. For steps 2 and 3, type combination-specific intersection detection algorithms and type combination-specific topological predicate determination are needed respectively. The fact that we employ a single algorithmic scheme for computing all spatiotemporal predicates necessitates and implies that their evaluation procedure during query processing is different 168

169 from other, built-in or user-defined predicates. At the descriptive level, both spatiotemporal predicates (like Disjoint, Cross) and other predicates (like the comparison operators <,, >, ) are used in selection and join conditions of SQL queries and are syntactically represented as boolean functions. At the physical level, other predicates are usually implemented by executable boolean functions, i.e., program code fragments, which explicitly calculate the predicates. However, spatiotemporal predicates describing developments represent topological patterns and are mapped to string patterns. We assume that the query string pattern of a spatiotemporal predicate being asked is a sequence of basic spatiotemporal predicates and topological predicates in development normal form (see [22]). In step 4, such a query string pattern is then matched against the actual development of two moving objects under consideration, which is also represented by a string. In the following, we describe a version of the algorithmic scheme, called STPredEvaluator (Figure 5-23), where first step 1, then steps 2 and 3 together, and finally step 4 are executed consecutively. The starting point is a given spatiotemporal query predicate Q(mo 1,mo 2 ) applied to two moving objects mo k {mapping(upoint),mapping(uline),mapping(uregion)} with k {1,2}. We assume that the DBMS first checks and keeps in the flag qwc whether Q contains either the instant predicate true or period predicate True. These predicates are defined as a kind of wildcard predicates to express don t care parts of developments in case that a development is only partially defined. First we perform a prechecking on the input objects. In case that one of the operand objects is empty, or their lifespans do not intersect (operation TIntersects), we return false as the result. All checks can be done in constant time, except for the lifespan check which takes O(d 1 + d 2 ) time if d 1 and d 2 denote the numbers of intervals of ls 1 and ls 2. Note that checking their projection bounding boxes for disjointedness is not sufficient to return a f alse value here if they are disjoint. This is because the predicates disjoint and Disjoint are also relationships that can be asked to be evaluated. Furthermore, there are also different types of disjoint relationships between complex objects as identified in [59]. 169

170 algorithm STPredEvaluator(mo 1,mo 2,Q,qwc) input: two moving objects mo 1 = n,ls 1,ob j pbb 1,... and mo 2 = n,ls 2,ob j pbb 2,..., topological string pattern Q that has to be checked with respect to mo 1 and mo 2, flag qwc indicating whether Q includes wildcards true or True output: true if Q matches actual development; false, otherwise begin if n = 0 or m = 0 or not T Intersects(ls 1,ls 2 ) then return false else RefinedIntervals := TimeSynchronizeIntervals(mo 1,mo 2 ); (ObjectsDevelopment,owc) := FunctionValuedRefinement(RefinedIntervals); return PatternMatching(Q,qwc,ObjectsDevelopment,owc) endif end STPredEvaluator. Figure Spatiotemporal predicate evaluator algorithm. The algorithm TimeSynchronizeIntervals yields a sequence of matching units with concordant, possibly reduced unit intervals. As we will see in Section 5.3.2, its runtime complexity is O(n + m + b) where n and m are the numbers of unit intervals of mo 1 and mo 2, respectively, and b is the number of matching unit intervals. The algorithm FunctionValuedRefinement further refines this sequence depending on the unit functions; it returns the so-called object development and a boolean flag indicating the existence of the wildcards true or True in the unit development. In Section 5.3.3, we will show that this takes O(bn max (z 2 max + logn max )) where z max is the maximum number of moving unit segments or moving unit single points (both also known as unit elements) in a unit of mo 1 and mo 2 and n max is the maximum number of changes in the topological relationships between unit elements of matching units. The algorithm PatternMatching checks the query string and the actual object development string for matching pattern. The flags qwc and owc indicate whether the corresponding strings contain wildcards. In Section 5.3.4, we will show that for the case that both strings do not comprise wildcards this requires O(v + w) time where v and w are the lengths of the strings. Finally, the runtime complexity of the algorithm STPredEvaluator is the sum of the runtime complexities of its subalgorithms. 170

171 5.3.2 Time-Synchronized Interval Refinement It is obvious that the computation of the time-synchronized interval refinement requires a parallel scan through the unit sequences and hence unit interval sequences of both object representations. During the traversal, intersections of unit intervals of both moving objects have to be detected. The effect is that temporally overlapping and thus matching units of both objects are reduced to their common time interval and that some intervals of both objects are totally or partially dropped (Figure5-24). But due to reasons of efficiency, we will not copy matching parts and construct two reduced moving objects. Instead, we will take an additional interval sequence data structure and only store common intervals with pointers to the matching units of the two moving objects for later use. time Figure Time-synchronized refinement of two unit interval sequences: two sets of time intervals on the left side, and their refinement partition for development evaluation on the right side. The implementation of the parallel scan through the unit interval sequences of both moving objects turns out to be not so trivial as it seems at first glance. For example, the deployment of Allen s thirteen different temporal predicates [1], which uniquely characterize the possible topological relationships between two intervals, is feasible but leads to a large number of case distinctions and predicate evaluations that make a complete treatment error-prone and lengthy. Our approach leads to shorter, faster (by a constant factor), and more comprehensible code and is able to handle closed, half-open, and open intervals. It collects the start and end points of the intervals of both objects in temporal order and then determines the intersection intervals. In the following algorithm (Figure 5-25), the notation denotes the empty sequence, sequence concatenation, the function eos tests whether the end of a sequence has been reached, the 171

172 algorithm TimeSynchronizeIntervals(mo 1,mo 2 ) input: two moving objects mo 1 = n,..., (...,i 1,...),...,(...,i n,...) and mo 2 = m,..., (...,i 1,...),...,(...,i m,...) output: a list RefinedIntervals containing all intersection intervals of matching units of both objects together with pointers (i.e., unit numbers) to these units begin // Step 1: Create the temporally ordered list of all interval left and right endpoints TList := ; // Let k i be the current unit number of object i with i {1,2}, left i be a flag indicating // whether the left or right interval endpoint is considered, t i be the start or end time of the // interval, and cl i be a flag indicating whether the interval is left-closed or right-closed. (k 1,left 1,t 1,cl 1 ) := (1,true,mo 1.i 1.l,mo 1.i 1.lc); (k 2,left 2,t 2,cl 2 ) := (1,true,mo 2.i 1.l,mo 2.i 1.lc); while k 1 n and k 2 m do if t 1 < t 2 then TList := TList (1,k 1,left 1,t 1,cl 1 ) ; next(1,k 1,left 1,t 1,cl 1 ) else if t 1 > t 2 then TList := TList (2,k 2,left 2,t 2,cl 2 ) ; next(2,k 2,left 2,t 2,cl 2 ) else // t 1 = t 2 if (left 1 and cl 1 and not ( not left 2 and not cl 2 )) or (not left 1 and cl 1 and left 2 and not cl 2 ) or (not left 1 and not cl 1 ) then TList := TList (1,k 1,left 1,t 1,cl 1 ) ; TList := TList (2,k 2,left 2,t 2,cl 2 ) ; else TList := TList (2,k 2,left 2,t 2,cl 2 ) ; TList := TList (1,k 1,left 1,t 1,cl 1 ) ; endif next(1,k 1,left 1,t 1,cl 1 ); next(2,k 2,left 2,t 2,cl 2 ) endif endwhile; // Step 2: Compute the intersection intervals of the matching units of both moving objects RefinedIntervals := ; OverlapNo := 0; while not eos(tlist) do (id, k, left,t, cl) := GetNextElem(TList); if left then Incr(OverlapNo); if OverlapNo = 1 then if id = 1 then k 1 := k else k 2 := k endif else //OverlapNo = 2 if id = 1 then (l, p,q,cl l ) := (t,k,k 2,cl) else (l, p,q,cl l ) := (t,k 1,k,cl) endif endif else Decr(OverlapNo); if OverlapNo = 1 then (r,cl r ) := (t,cl); RefinedIntervals := RefinedIntervals (l,r,cl l,cl r, p,q) endif endif endwhile; return RefinedIntervals end TimeSynchronizeIntervals. Figure Time-synchronized interval refinement algorithm. 172

173 operation GetNextElem yields the next element of a sequence, the term (a 1,...,a n ) := (b 1,...,b n ) stands for the statement list a 1 := b 1 ;...;a n := b n, and the operations Incr and Decr increment and decrement an integer value respectively. The operation next positions on the next time instant of an ordered interval sequence and is discussed in more detail below. In step 1 of the algorithm, in the case where t 1 and t 2 coincide, each of both time instants may indicate a left-closed ( [ ), left-open ( ( ), right-closed ( ] ), or right-open ( ) ) interval. This results in 16 possible combinations for both time instants. For each combination we have to decide the order of the two time instants in the list TList of interval endpoints. This is needed in step 2 of the algorithm to determine the refined intervals and, in particular, to detect time intervals which have degenerated to time instants. The decision process is illustrated in Table 5-6 which in the first two lines lists all combinations of closed and open, left and right interval endpoints and which in the third line determines their order. The notation 1, 2 means t 1 must precede t 2, 2, 1 means the inverse, and 1 2 means that the order is arbitrary. Table 5-6. Interval endpoint ordering. t 1 [ [ [ [ ] ] ] ] ( ( ( ( ) ) ) ) t 2 [ ] ( ) [ ] ( ) [ ] ( ) [ ] ( ) order 1,2 1,2 1,2 2,1 2, ,2 2,1 2,1 2, ,1 1,2 1,2 1,2 1 2 Due to at most 2 (n + m) different interval endpoints, the runtime complexity for step 1 is O(n + m) where n and m are the numbers of intervals of mo 1 and mo 2, respectively. We now present the algorithm Next for the next operation (Figure 5-26) which positions on the next time instant of the unit interval sequence of one of both moving objects and which needs O(1) time. In step 2 of the algorithm, the temporally ordered list of all interval left and right endpoints is traversed for determining the intersection intervals. This is done by computing overlap numbers (see Section , here applied to the one-dimensional case) indicating the number of intervals covering a time instant. Only time instants and intervals with overlap number 2 belong to the result. The runtime complexity for step 2 and also for the whole algorithm TimeSynchronizeIntervals is O(n + m + b)(= O(n + m) since bn + m) where b is the ascertained number of matching unit intervals. 173

174 algorithm Next(id, k, left,t, cl) input: id {1,2} indicating moving object mo 1 or mo 2, current unit number k output: updated unit number k, left or right end time t of an interval, flag left indicating whether t is the left boundary of an interval, flag cl indicating whether the interval is closed at t begin if left then left = false; if id = 1 then t := mo 1.i k.r; cl := mo 1.i k.rc else t := mo 2.i k.r; cl := mo 2.i k.rc endif else left = true; k := k + 1; if id = 1 and k n then t := mo 1.i k.l; cl := mo 1.i k.lc else if id = 2 and k m then t := mo 2.i k.l; cl := mo 2.i k.lc endif endif end Next. Figure Next Algorithm Function-Valued Interval Refinement and Development Determination So far, we have identified b matching units of mo 1 and mo 2 together with their common time intervals. But each pair of matching units has possibly to be further refined due to intersecting or touching 3D unit objects. These situations imply a change of their topological relationships and have thus to be taken into account for the computation of the development (Figure 5-27). We do not store this further refinement explicitly but only make our conclusions with respect to the development in the respective unit. time y Figure Intersecting unit segments of two moving points representing the development Disjoint meet Disjoint and thus requiring a further interval refinement. x We also have to take into account that parts of the whole development to be computed may be undefined. Hence, two consecutive time intervals may be separated by temporal gaps. In 174

175 this case, we have to use the wildcard period predicate True or the wildcard instant predicate true for expressing this. The algorithmic schema can be formulated as shown in Figure algorithm FunctionValuedRefinement(RefinedIntervals) input: RefinedIntervals = (l 1,r 1,lc 1,rc 1, p 1,q 1 ),...,(l b,r b,lc b,rc b, p b,q b ) where l i and r i denote the left and right endpoints of the possibly reduced intervals of matching units, lc i and rc i whether the intervals are left-closed and right-closed respectively, and p i and q i are pointers (unit numbers) to the matching units of mo 1 or mo 2 respectively output: ObjectDevelopment as a string containing the development of mo 1 and mo 2 begin ObjectDevelopment := ; for each j in 1...b do UnitDevelopment := UnitIntersect(l j,r j,lc j,rc j, p j,q j ) if j > 1 then if r j 1 = l j and not rc j 1 and not lc j then ObjectDevelopment := ObjectDevelopment true else if r j 1 < l j then ObjectDevelopment := ObjectDevelopment True endif endif; ObjectDevelopment := ObjectDevelopment UnitDevelopment; endfor; (ObjectDevelopment,owc) := NormalizeDev(UnitDevelopment); return (ObjectDevelopment,owc); end FunctionValuedRefinement. Figure Function-valued interval refinement algorithm. For each refined interval, we determine the unit development of the corresponding units of the two moving objects by calling the UnitIntersect algorithm. This algorithm returns the unit development specified by the two 3D unit objects. The algorithm are described in Figure It, in particular, have to take care of the degenerate case that the unit interval is a time instant. The function NormalizeDev transforms the computed development into development normal form (see [22]) and simultaneously checks whether the development contains the wildcards true or True. In the algorithm UnitIntersect, the term eval(v j,t) denotes an evaluation function that is applied to the unit function v j for unit j at time t. This function yields a 2D spatial object. The function InstantPred and PeriodPred annotates a topological predicate identification number 175

176 algorithm UnitIntersect(l, r, lc, rc, p, q) input: left endpoint l and right endpoint r of the common time interval of two matching units, flags lc and rc whether the interval is left-closed and right-closed respectively, and pointers p and q to the matching units output: a string representing the unit development of the two matching units begin o l p := eval(v p,l); o r p := eval(v p,r); o l q := eval(v q,l); o r q := eval(v q,r); if l = r then // lc and rc must be true return InstantPred(TopRel(o l p,o l q)) else if not BBIntersects(unit pbb p,unit pbb q ) then //Take a sample at half way of the interval to determine the type of disjoint return PeriodPred(TopRel(eval(v p,(l + r)/2),eval(v q,(l + r)/2))) else // Step 1: Compute contacts between any pair of moving unit segments and/or // moving unit single points (unit elements) TList := l, r ; for each i in 1...z 1 do // z 1 is the number of unit elements of the first unit for each j in 1...z 2 do // z 2 is the number of unit elements of the second unit (c,t 1,t 2 ) := Contact(v p,i,v q, j); // i th resp. j th unit element of v p resp. v q if c then TList := TList t 1 ; TList := TList t 2 endif endfor endfor; // Step 2: Sort list of time instants (events) and remove duplicates TList := sort(tlist); TList := rdup(tlist); // Step 3: Evaluate TList (we assume it has n elements) and determine development UnitDevelopment := ; if lc then UnitDevelopment := InstantPred(TopRel(o l p,o l q)) endif for each j in 2...n do // Take a sample at a time between t j 1 and t j t p := TopRel(eval(v p,(t j 1 +t j )/2),eval(v q,(t j 1 +t j )/2)); UnitDevelopment := UnitDevelopment PeriodPred(tp); // Determine the topological relationship at t j if t j < r or (t j = r and rc) then t p := TopRel(eval(v p,t j ),eval(v q,t j )); UnitDevelopment := UnitDevelopment InstantPred(tp) endif endfor; return UnitDevelopment; endif end UnitIntersect. Figure Unit intersection algorithm. 176

177 (returned by TopRel) to indicate an instant predicate or a period predicate respectively and returns its string value. In the first step, for each unit element of v p, we scan the unit elements of v q to find time intervals when such two unit elements intersect or meet each other. The time instants when two unit elements start and stop to intersect or meet each other represent topological events since they indicate possible changes of topological relationships between the two units. That is, a local change of the topological relationship between two unit elements does not necessarily imply a global change in the topological relationship of the two units of the moving objects. This depends on the definition of the topological predicates (Section and [39, 42]). For example, if two components of two uregion values overlap for some period within the common unit interval, a local change of the topological relationship of two other components from Disjoint to meet in the same period will not have a global effect on the topological relationship of the two uregion values; it is still Overlap. The topological relationship of two unit elements does not change between the start time and end time of their contact. For all pairs of unit elements, the function Contact returns a triple (c,t 1,t 2 ) where c is a flag which indicates whether both unit elements intersect or touch or meet, i.e., contact, each other. The values t 1 and t 2 are the start and end times of a contact which are stored in a list for further processing. The exact nature of the contact is not relevant here, because it is only a local event and has to be globally evaluated anyway. In a second step, the list of time instants obtained from the first step is sorted (function sort), and duplicates are removed (function rdup). In a third step, the list TList of topological events is evaluated and the unit development is determined. Since a temporal unit value can consist of several components, the components of two unit values may be spatially arranged in many different ways and thus lead to many different unit developments. Therefore, we employ the following global algorithmic strategy: We apply the algorithm TopRel to all time instants of TList and hence obtain the topological relationships at these times. We know that the topological behavior between two consecutive time instants t 1 and t 2 in TList is constant because a topological change would otherwise entail a contact situation at 177

178 a time between t 1 and t 2. However, we do not know and also cannot uniquely infer what kind of basic spatiotemporal relationship exists between t 1 and t 2. As an example, let us assume that at both times t 1 and t 2 we find the topological relationship meet between two uregion values. What can have happened in between? Three alternatives are possible leading to either the development meet Disjoint meet or the development meet Overlap meet or the development meet Meet meet, which is equal to Meet. To solve this problem, we take a sample and compute the topological relationship at time (t 1 + t 2 )/2. Then we determine the corresponding period predicate by means of the function PeriodPred. This is done for all consecutive pairs of time instants in TList. The computation of the spatial object at times l and r at the beginning of the algorithm takes time O(z 1 logz 1 ) and O(z 2 logz 2 ), respectively, where z 1 and z 2 denote the number of unit elements of the two units. Hence, the algorithm TopRel requires time O((z 1 + z 2 )log(z 1 + z 2 )). Step 1 includes two nested loops executing the function Contact, which runs in constant time. In total, this step requires O(z 1 z 2 ) time. Step 2 needs O(nlogn) time for sorting the n elements of TList and removing the duplicates. Step 3 computes approximately n times the function TopRel, which requires O(n (z 1 + z 2 )log(z 1 + z 2 )) time. Hence, the algorithm UnitIntersect needs time O(z 1 z 2 + nlogn + n (z 1 + z 2 )log(z 1 + z 2 )). With z = max(z1,z2), this is equal to O(z 2 + nlogn + n zlogz) = O(n (z 2 + logn)). In this case, this leads to a runtime complexity of O(bn max (z 2 max + logn max )) for the algorithm FunctionValuedRefinement where b is the number of matching unit intervals, z max is the maximum number of unit elements in a unit of both moving objects, and n max is the maximum number of changes in the topological relationships between unit elements of matching units Pattern Matching with Query Predicate At this stage, the actual temporal topological behavior, i.e., the development, of the two moving objects under consideration is known and represented as a string, called the development string. The reason for this kind of representation is to reduce the problem of evaluating a 178

179 spatiotemporal predicate finally to a string matching problem between the development string and the query string. The string matching problem can arise in four variants with different algorithmic and runtime complexities depending on the existence of the wildcards true (t) and True (T ) in the development string and/or the query string. First, both the development string and the query string do not contain wildcards. Second, the development string but not the query string includes wildcards. Third, the query string but not the development string includes wildcards. Fourth, both strings contain wildcards. This leads to the algorithm PatternMatching shown in Figure algorithm PatternMatching(Q, qwc, D, dwc) input: a query string Q which is checked against a development string D, flags qwc and dwc indicating whether Q and D, respectively, contain wildcards output: a boolean value indicating whether the query string matches the development string begin if not qwc and not dwc then // case 1 return (Q = D) else if not qwc and dwc then // case 2 return REPM(Q,D) else if qwc and not dwc then // case 3 return REPM(D,Q) else if qwc and dwc then // case 4 return EqualRegExpr(Q,D) endif end PatternMatching. Figure Pattern matching algorithm. In the first case, the string matching problem can be solved by a string equality test and needs time O(v + w) where v is the length of Q and w is the length of D. All other cases incorporate the wildcards true and True. We can therefore consider strings containing these wildcards as (simplified) regular expressions. The cases 2 and 3 are special instances of exact regular expression pattern matching problems where exactly one of the argument strings, either the query string or the development string, includes wildcards. The problem here is to find out whether the string without wildcards matches one of the strings specified by the regular expression. This is computed by a predicate REPM (see [28] for detail) and requires O(vw) time 179

180 if v is the length of the string and w is the number of symbols contained in the regular expression. The fourth case takes two regular expressions and determines whether they are equal. Two regular expression are equal if and only if they produce the same language. An algorithm for this problem, EqualRegExpr, is given in [27] (unfortunately without runtime complexity analysis). 5.4 Algorithms for Balloon Predicates Balloon predicates between balloon objects are defined as a sequence of certain and uncertain spatiotemporal predicates. Certain spatiotemporal predicates denote developments of relationship between historical movements of balloon objects whereas uncertain spatiotemporal predicates represent developments of relationship that involves predicted movements. Therefore, the evaluation of a balloon predicate between two balloon objects rests heavily on the determination of spatiotemporal predicates. In any case, the development between two balloon objects can be obtained by determining the developments between their historical and predicted components. An algorithm for evaluating a balloon predicate essentially consists of two steps: 1. Development determination: First, we determine the development between the historical movements of the two balloon objects and mark it as certain development. Then, we determine the development between the historical movement of the first balloon object and the predicted movement of the second balloon object, or vice versa, and mark it as uncertain development. Finally, the uncertain development between the predicted movements are determined. The temporal composition of these developments produces the development of the balloon objects. 2. Pattern matching with query predicate: This step consists of a pattern matching process between the development computed and the query predicate asking for evaluation. It results in one of the Boolean values true or false. Note that this step is not required for a query to determine the development. Figure 5-31 shows an algorithm BPredEvaluator for evaluating a balloon predicate. In the first step, we determine the development between the historical movements by calling the operation STDevDetermination. This operation works the same way as the algorithm STPredEvaluator presented in Section with the exception that it does not employ the pattern matching process at the end. Thus, it returns the development between the two argument objects. The function CertainDev and UncertainDev annotate the development as a certain and 180

181 algorithm BPredEvaluator(bo 1,bo 2,Q,qwc) input: two balloon objects bo 1 = t 1,ls 1,ob j pbb 1,h 1, p 1 and bo 2 = t 2,ls 2,ob j pbb 2,h 2, p 2, topological string pattern Q that has to be checked with respect to bo 1 and bo 2, flag qwc indicating whether Q includes wildcards true or True output: true if Q matches actual development; false, otherwise begin if not T Intersects(ls 1,ls 2 ) then return false else ObjectDevelopment := CertainDev(STDevDetermination(h 1,h 2 )); dev := ; if t 1 < t 2 then dev := UncertainDev(STDevDetermination(p 1,h 2 )); else if t 1 > t 2 then dev := UncertainDev(STDevDetermination(h 1,p 2 )); endif;objectdevelopment := ObjectDevelopment dev; ObjectDevelopment := ObjectDevelopment UncertainDev(STDevDetermination(p 1,p 2 )); (ObjectDevelopment,owc) := NormalizeDev(ObjectDevelopment); return PatternMatching(Q,qwc,ObjectDevelopment,owc) endif end BPredEvaluator. Figure Balloon predicate evaluator algorithm. uncertain development respectively and then returns the corresponding string value. Depending on the relative comparison between t 1 and t 2 (local present instants that separate the historical and predicted movements), the corresponding development between the historical movement of an object and a predicted movement of the other object is determined and appended to the object development. Next, we append the development between the predicted movements of both balloon objects and normalize the object development. The final step is to employ the pattern matching process by calling PatternMatching and return the final result. With an implementation of this algorithm, one can pose a query consisting of both temporally certain and uncertain developments. For example, assume that the prefixes c and u denote certain and uncertain development respectively. A query string cdisjoint udisjoint asked to verify whether the development has always been and will always be disjoint. A query string True uinside True asked whether the development Inside exists sometimes in the future. 181

182 These are just a few simple examples. Many more elaborated and complex query strings can be constructed to express more complex scenarios. 5.5 Database Integration It is one of our main objectives that our implementation of the Moving Balloon Algebra would be available as an extension package to any extensible DBMS. The benefit of this feature is not only to broaden the availability and usability of the algebra but also to show a way for other algebra to be database system independent as well. This requirement entails a number of design criteria that need to be taken into account when developing such an algebra. First, one should design and develop an algebra, its data types and operations from an abstract data types point of view. This allows a clear and comprehensible design of the data types and operations as well as a seamless transformation of the design into implementable classes and methods. Second, one should consider a number of requirements pertaining to the extensibility option of DBMSs of interest. These includes the ability to create user-defined types (UDT) and user-defined functions (UDF), large object (LOB) management, external procedure invocations, programming language and type library compatibility, and storage or object size limitations. Third, the mechanism and the environment in which operations are executed should be taken into account. Some criteria includes whether operations will be internally executed in memory by requiring all argument objects to be entirely loaded in main memory (memory execution) or externally executed by loading only required parts of argument objects from a database at a time (database execution). Both alternatives have advantages and disadvantages depending on other factors such as the nature of the operations, the amount of available main memory, the size of argument objects, the speed of the database communication link, etc. With these criteria in mind, our approach has been to develop the algebra in three abstraction levels (abstract, discrete, and implementation levels) to allow for a clear and comprehensible specification of the data types and operations. Our specific implementation of the Moving Balloon Algebra, which results in a software library package called MBA, is done by using an 182

183 object-oriented approach. As far as DBMS extensibility mechanism is concerned, most of today s popular commercial DBMSs satisfy most of our extensibility requirements. For example, Oracle DBMS allows users to create and register UDTs and UDFs which can be implemented externally in a type library system. It also provides an application programming interface called Oracle Call Interface (OCI) to facilitate such implementation. In Figure 5-32, we show how we can register one of our moving balloon data types mballoonpp and an operation getfunctioncount (returns the number of unit functions in a moving balloon object) in Oracle. CREATE OR REPLACE LIBRARY MBA_lib AS libmbaora.so ; CREATE OR REPLACE PACKAGE MBA_pkg AS function mballoonpp_getfunctioncount(b blob) return pls_integer; END; CREATE OR REPLACE PACKAGE BODY MBA_pkg AS function mballoonpp_getfunctioncount(b blob) return pls_integer as external language C WITH CONTEXT name "mballoonpp_getfunctioncount" library MBA_lib parameters(context, b OCILobLocator); END; CREATE OR REPLACE TYPE mballoonpp AS Object ( stdata blob, member function getfunctioncount return pls_integer ); CREATE OR REPLACE TYPE BODY mballoonpp is member function getfunctioncount return pls_integer is num pls_integer := MBA_pkg.mballoonpp_getFunctionCount(stData); BEGIN return num; END; END; Figure Registration of a data type and an operation in Oracle. In this case, our moving balloon objects are stored in binary large objects (blob). An invocation of the getfunctioncount operation requires a locator (a pointer to a blob) to be passed 183

184 as an argument. Since only a locator to a blob is passed instead of the entire blob, this allows for a flexible execution of the operation in either memory execution or database execution mode. To take advantage of this, our algebra implementation allows both types of execution for operations on objects stored in a database. The type of execution, specifically how an object is loaded to perform an operation, is dictated by the choice of storage option for the object at construction. Our implementation offers three different storage options for our moving balloon objects namely memory, blob, and mslob options. In the memory storage option, objects are not persistent in that they only exist in memory for the duration of the program execution. This option is also required for memory execution mode of database objects where objects are loaded entirely into memory. The blob storage option allows objects to be stored persistently and directly in database blobs. This option facilitates memory execution mode since each blob needs to be loaded completely into memory to construct a memory based object through a deserialization process. This option is preferable for smallsized objects that do not require frequent update (update operations require writing back to database blobs through a serialization process). To enable database execution mode, our mslob storage option makes use of an intermediate layer called mslob for storage management. mslob is our implementation of a multi-structured large object management concept for database blobs [40]. mslob provides component-based read and write access to structured and multi-structured objects stored in blobs. Thus, it allows us to read and write any component of our objects on demand without the need to load the entire objects into main memory. Therefore, the mslob storage option is preferable for large objects and frequently updated objects. Figure 5-33 illustrates the application system architecture in which a number of algebra can be integrated in a DBMS with or without mslob. With our algebra integrated in a DBMS and our UDTs and UDFs registered, we can now create tables using our registered types, populate data, and pose query using our registered functions. For example, we can create a simple table to store our mballoonpp objects as shown in Figure

185 Figure The integration of algebra in extensible DBMSs CREATE TABLE mbpptable( id integer primary key, description varchar2(64), mbpp mballoonpp ); Figure Creating a table using a user-defined type. Assuming that we have populated this table with a few moving balloon objects. We can then pose a query (Figure 5-35) on this table in SQL using our UDF getfunctioncount to get the number of unit functions in each object. SELECT id, description, mb.mbpp.getfunctioncount() FROM mbpptable mb; Figure Using a user-defined function in SQL query. 5.6 Case Study: Application to Hurricane Research So far, we have presented our Moving Balloon Algebra at all abstraction levels as well as its implementation in a software package MBA which is integrated into an Oracle DBMS. Thus, we have effectively made our algebra available for use in many real world applications. In this section, we show how our algebra can be used in the field of hurricane research and how it transforms the way we look at hurricane data. Hurricanes are some of the most powerful and deadliest forces of nature. According to the National Hurricane Center, 1385 tropical storms and hurricanes had been recorded between

186 and 2007 in the Atlantic region alone. One of the main objectives of hurricane research is to study the behavior of tropical cyclones (tropical storms and hurricanes) in order to anticipate their movements and provide necessary advisories (storm warnings and watches) to the general public. The research is a part of the efforts to reduce the effect of these deadly storms on humanity. Traditionally, storm data including its movements (also known as best track data) are collected and stored in a text file in a specific format called HURDAT. From this data, researchers employ sophisticated prediction models to predict the position of the storm at every 12-hour interval within up to 120 hours in the future. This is essentially a prediction which is used to produce a public advisory. This is done every 6 hours for which the best track information of the storm is available. Thus, for a storm that lasts for a week or so, there can be as many as 20 advisories or predictions. As one may have noticed, this type of data fits very well with our model of moving balloon objects. It is important to notice also that the limitations of currently existing moving object management technology have a big impact on the complexity of prediction data and their management. Due to the lack of a comprehensive moving object model with support for predicted movements and the lack of moving object management in database, so far, hurricane predictions have only been made in regards to the future positions of the center of a storm (the movement of which is a moving point), and these data are generally stored in normal files. This effectively limits richness of representation as well as limits the querying possibility for the predicted data. With the use of our Moving Balloon Algebra in a database system, a more complex representation of hurricane predictions can be supported, managed, and offered for querying purposes. For example, instead of providing a prediction as a series of positions, researchers can now provide a prediction as a moving region. Therefore, the movement of the eye of a hurricane can be represented as a moving balloon object based on a moving point history and moving region predictions. So far, this has not been available in hurricane research, and thus researchers frequently use the average errors between their predictions in the past and the best 186

187 track information to visualize their current prediction of a storm and show the area of uncertainty around their predicted positions (which would otherwise be modeled as regions of uncertainty in our algebra). By using this approach, we can construct a moving balloon object with moving region predictions for each storm data available. A B C D Figure Visualization of hurricane Katrina using the Moving Balloon Algebra. 187

188 Using our visualization program to view hurricane data represented using our algebra in an Oracle DBMS, we can obtain at least two different perspectives which allow for a detail analysis of the data. For example, in an object-based perspective, Figure 5-36A and 5-36B show hurricane Katrina as a balloon object on August 26, 2005 at 00:00 GMT and August 29, 2005 at 00:00 GMT respectively. Figure 5-36C shows Katrina as a moving balloon object consisting of her track and all 28 of her predictions over the course of her lifetime drawn on top of one another. We can switch the visualization to a temporal analysis perspective mode where we can analyze, at any specific instant, the position of the eye as well as the state of the predictions. Figure 5-36D shows Katrina s eye position when making landfall in New Orleans on August 29, 2005 at 11:00 GMT and the state of all of its available predictions at the time. In this particular figure, we take a snapshot of the movement and all available predictions at the instant of the landfall. Each ring represents a predicted uncertainty region with respect to a specific prediction. As one may notice, here we see that the position of Katrina s eye is in the intersection of all the rings meaning that all of these previous predictions are valid and accurate to some degree at this instant. If at any instant the eye s position is outside of a ring, this means that the previous prediction corresponding to the ring is not accurate. As part of our algebra, we provide an operation has bad prediction to check for inaccurate predictions within a moving balloon object. This operation makes use of our spatiotemporal predicate implementation to determine whether the eye s position ever leaves any of the predicted regions. In the case of hurricane Katrina, prediction #7, #8, and #9 has been found to be inaccurate. Figure 5-37A shows an object-based perspective of the complete track and prediction #7 which was produced on August 25, 2005 at 12:00 GMT. Figure 5-37B illustrates a temporal analysis perspective of the eye s position and the uncertainty region of prediction #7 on August 27, 2005 at 12:00 GMT when the actual position of the eye starts to stray outside of the predicted region. By performing this kind of analysis for all of the North Atlantic storms over the past 5 years ( for which prediction data are available), we can determine for each storm the number of accurate and inaccurate predictions as shown in Figure 5-38A. In total, 82 storms 188

189 A B Figure Visualizing hurricane Katrina. A) Katrina s prediction #7 in object-based perspectives. B) Temporal analysis perspective on August 27, 2005 at 12:00 GMT. have been recorded, and 1863 predictions have been produced of which 655 (or about 35%) have been found to be inaccurate. We have also discovered that most of the storms that have high percentage of inaccurate predictions often experience certain behaviors such as making 90 degree turns and u-turns (e.g., hurricane Kate (#1312) as shown in Figure 5-38B), or forming a loop (e.g., hurricane Lisa (#1329) as shown in Figure 5-38C). It is clear that this type of information would be useful for researchers to study such behaviors and make necessary adjustments to their prediction model. 189

190 A B C Figure Hurricane analysis. A) Hurricane prediction analysis between 2003 and B) Hurricane Kate (#1312). C) Hurricane Lisa (#1329). 190

Modeling Historical and Future Spatio-Temporal Relationships of Moving Objects in Databases

Modeling Historical and Future Spatio-Temporal Relationships of Moving Objects in Databases Modeling Historical and Future Spatio-Temporal Relationships of Moving Objects in Databases Reasey Praing & Markus Schneider University of Florida, Department of Computer & Information Science & Engineering,

More information

Efficient Implementation Techniques for Topological Predicates on Complex Spatial Objects: The Evaluation Phase

Efficient Implementation Techniques for Topological Predicates on Complex Spatial Objects: The Evaluation Phase Efficient Implementation Techniques for Topological Predicates on Complex Spatial Objects: The Evaluation Phase Reasey Praing & Markus Schneider University of Florida Department of Computer & Information

More information

Topological Relationships between Complex Spatial Objects

Topological Relationships between Complex Spatial Objects Topological Relationships between Complex Spatial Objects Markus Schneider University of Florida Department of Computer & Information Science & Engineering Gainesville, FL 32611, USA mschneid@cise.ufl.edu

More information

Efficient Implementation Techniques for Topological Predicates on Complex Spatial Objects: The Exploration Phase

Efficient Implementation Techniques for Topological Predicates on Complex Spatial Objects: The Exploration Phase Efficient mplementation Techniques for Topological Predicates on Complex Spatial Objects: The Exploration Phase Markus Schneider & Reasey Praing University of Florida Department of Computer & nformation

More information

Computing the Topological Relationship of Complex Regions

Computing the Topological Relationship of Complex Regions Computing the Topological Relationship of Complex Regions Markus Schneider University of Florida epartment of Computer & Information Science & Engineering Gainesville, FL 32611, USA mschneid@cise.ufl.edu

More information

Implementing Topological Predicates for Complex Regions Introduction

Implementing Topological Predicates for Complex Regions Introduction Implementing Topological Predicates for Complex Regions Markus Schneider University of Florida Department of Computer and Information Science and Engineering Gainesville, FL 326, USA mschneid@cise.ufl.edu

More information

A Visual Language for the Evolution of Spatial Relationships and its Translation into a Spatio-Temporal Calculus

A Visual Language for the Evolution of Spatial Relationships and its Translation into a Spatio-Temporal Calculus A Visual Language for the Evolution of Spatial Relationships and its Translation into a Spatio-Temporal Calculus Martin Erwig Oregon State University Department of Computer Science Corvallis, OR 97331,

More information

DERIVING TOPOLOGICAL RELATIONSHIPS BETWEEN SIMPLE REGIONS WITH HOLES

DERIVING TOPOLOGICAL RELATIONSHIPS BETWEEN SIMPLE REGIONS WITH HOLES DERIVING TOPOLOGICAL RELATIONSHIPS BETWEEN SIMPLE REGIONS WITH HOLES Mark McKenney, Reasey Praing, and Markus Schneider Department of Computer and Information Science & Engineering, University of Florida

More information

M. Andrea Rodríguez-Tastets. I Semester 2008

M. Andrea Rodríguez-Tastets. I Semester 2008 M. -Tastets Universidad de Concepción,Chile andrea@udec.cl I Semester 2008 Outline refers to data with a location on the Earth s surface. Examples Census data Administrative boundaries of a country, state

More information

TOWARDS A 3D SPATIAL QUERY LANGUAGE FOR BUILDING INFORMATION MODELS

TOWARDS A 3D SPATIAL QUERY LANGUAGE FOR BUILDING INFORMATION MODELS TOWARDS A D SPATIAL QUERY LANGUAGE FOR BUILDING INFORMATION MODELS André Borrmann 1, Christoph van Treeck 1, and Ernst Rank 1 ABSTRACT The paper introduces the concept of a spatial query language for building

More information

Geometric and Thematic Integration of Spatial Data into Maps

Geometric and Thematic Integration of Spatial Data into Maps Geometric and Thematic Integration of Spatial Data into Maps Mark McKenney Department of Computer Science, Texas State University mckenney@txstate.edu Abstract The map construction problem (MCP) is defined

More information

Topological Relationships Between Map Geometries

Topological Relationships Between Map Geometries Topological Relationships Between Map Geometries Mark McKenney and Markus Schneider University of Florida, Department of Computer and Information Sciences {mm7,mschneid}@cise.ufl.edu Abstract. The importance

More information

Topological feature vectors for exploring topological relationships

Topological feature vectors for exploring topological relationships International Journal of Geographical Information Science Vol. 23, No. 3, March 2009, 319 353 Research Article Topological feature vectors for exploring topological relationships REASEY PRAING and MARKUS

More information

Announcements. Data Sources a list of data files and their sources, an example of what I am looking for:

Announcements. Data Sources a list of data files and their sources, an example of what I am looking for: Data Announcements Data Sources a list of data files and their sources, an example of what I am looking for: Source Map of Bangor MEGIS NG911 road file for Bangor MEGIS Tax maps for Bangor City Hall, may

More information

Introduction to Spatial Database Systems

Introduction to Spatial Database Systems Introduction to Spatial Database Systems by Cyrus Shahabi from Ralf Hart Hartmut Guting s VLDB Journal v3, n4, October 1994 Data Structures & Algorithms 1. Implementation of spatial algebra in an integrated

More information

Introduction to Spatial Database Systems. Outline

Introduction to Spatial Database Systems. Outline Introduction to Spatial Database Systems by Cyrus Shahabi from Ralf Hart Hartmut Guting s VLDB Journal v3, n4, October 1994 1 Outline Introduction & definition Modeling Querying Data structures and algorithms

More information

Visual Specification of Spatio-Temporal Developments

Visual Specification of Spatio-Temporal Developments Visual Specification of Spatio-Temporal Developments Martin Erwig & Markus Schneider FernUniversität Hagen, Praktische Informatik IV 58084 Hagen, Germany {erwig, markus.schneider}@fernuni-hagen.de Abstract

More information

FINITE RESOLUTION CRISP AND FUZZY SPATIAL OBJECTS

FINITE RESOLUTION CRISP AND FUZZY SPATIAL OBJECTS FINITE RESOLUTION CRISP AND FUZZY SPATIAL OBJECTS Markus Schneider FernUniversität Hagen, Praktische Informatik IV 58084 Hagen, Germany markus.schneider@fernuni-hagen.de ABSTRACT Uncertainty management

More information

γ 2 γ 3 γ 1 R 2 (b) a bounded Yin set (a) an unbounded Yin set

γ 2 γ 3 γ 1 R 2 (b) a bounded Yin set (a) an unbounded Yin set γ 1 γ 3 γ γ 3 γ γ 1 R (a) an unbounded Yin set (b) a bounded Yin set Fig..1: Jordan curve representation of a connected Yin set M R. A shaded region represents M and the dashed curves its boundary M that

More information

Identifying Topological Predicates for Vague Spatial Objects

Identifying Topological Predicates for Vague Spatial Objects Identifying Topological Predicates for Vague Spatial Objects Alejandro Pauly & Markus Schneider University of Florida, Department of Computer & Information Science & Engineering Gainesville, FL 32611,

More information

Multidimensional (spatial) Data and Modelling (2)

Multidimensional (spatial) Data and Modelling (2) Multidimensional (spatial) Data and Modelling (2) 1 Representative operations on maps l l l l l are operations on layers used in maps (all 2-d). Synonyms f. map: layer, spatial partition Def. properties:

More information

Multidimensional Data and Modelling - DBMS

Multidimensional Data and Modelling - DBMS Multidimensional Data and Modelling - DBMS 1 DBMS-centric approach Summary: l Spatial data is considered as another type of data beside conventional data in a DBMS. l Enabling advantages of DBMS (data

More information

1. Introduction to Constructive Solid Geometry (CSG)

1. Introduction to Constructive Solid Geometry (CSG) opyright@010, YZU Optimal Design Laboratory. All rights reserved. Last updated: Yeh-Liang Hsu (010-1-10). Note: This is the course material for ME550 Geometric modeling and computer graphics, Yuan Ze University.

More information

Implementation Techniques

Implementation Techniques V Implementation Techniques 34 Efficient Evaluation of the Valid-Time Natural Join 35 Efficient Differential Timeslice Computation 36 R-Tree Based Indexing of Now-Relative Bitemporal Data 37 Light-Weight

More information

Lecturer 2: Spatial Concepts and Data Models

Lecturer 2: Spatial Concepts and Data Models Lecturer 2: Spatial Concepts and Data Models 2.1 Introduction 2.2 Models of Spatial Information 2.3 Three-Step Database Design 2.4 Extending ER with Spatial Concepts 2.5 Summary Learning Objectives Learning

More information

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13 Lecture 17: Solid Modeling... a cubit on the one side, and a cubit on the other side Exodus 26:13 Who is on the LORD's side? Exodus 32:26 1. Solid Representations A solid is a 3-dimensional shape with

More information

OPERATORS FOR CELL TUPLE-BASED SPATIOTEMPORAL DATA MODEL

OPERATORS FOR CELL TUPLE-BASED SPATIOTEMPORAL DATA MODEL OPERTORS FOR CELL TUPLE-BSED SPTIOTEMPORL DT MODEL le Raza ESRI 80 New York Street, Redlands, California 97-800, US Tel.: +-909-79-85 (ext. 009) Fax: +-909-07-067 araza@esri.com Commission IV, WG IV/ KEY

More information

Structural and Syntactic Pattern Recognition

Structural and Syntactic Pattern Recognition Structural and Syntactic Pattern Recognition Selim Aksoy Department of Computer Engineering Bilkent University saksoy@cs.bilkent.edu.tr CS 551, Fall 2017 CS 551, Fall 2017 c 2017, Selim Aksoy (Bilkent

More information

Geographic Information Fundamentals Overview

Geographic Information Fundamentals Overview CEN TC 287 Date: 1998-07 CR 287002:1998 CEN TC 287 Secretariat: AFNOR Geographic Information Fundamentals Overview Geoinformation Übersicht Information géographique Vue d'ensemble ICS: Descriptors: Document

More information

DEVELOPING A THREE-DIMENSIONAL TOPOLOGICAL DATA MODEL

DEVELOPING A THREE-DIMENSIONAL TOPOLOGICAL DATA MODEL DEVELOPING A THREE-DIMENSIONAL TOPOLOGICAL DATA MODEL Saadi MESGARI International Institute for Aerospace Survey and Earth Sciences (ITC) The Netherlands Mesgari@itc.nl Working Group IC/16 KEY WORDS: Data

More information

Chapter 9. Geographic Representation Models. Emmanuel Stefanakis

Chapter 9. Geographic Representation Models. Emmanuel Stefanakis Stefanakis, E., 2014. Geographic Databases and Information Systems. CreateSpace Independent Publ. [In English], pp.386. Get a copy from Amazon Chapter 9 Geographic Representation Models Emmanuel Stefanakis

More information

CHAPTER 1. Introduction

CHAPTER 1. Introduction ME 475: Computer-Aided Design of Structures 1-1 CHAPTER 1 Introduction 1.1 Analysis versus Design 1.2 Basic Steps in Analysis 1.3 What is the Finite Element Method? 1.4 Geometrical Representation, Discretization

More information

DESIGN, IMPLEMENTATION, AND INTEGRATION OF DATA TYPES FOR THREE-DIMENSIONAL SPATIAL DATA IN DATABASES

DESIGN, IMPLEMENTATION, AND INTEGRATION OF DATA TYPES FOR THREE-DIMENSIONAL SPATIAL DATA IN DATABASES DESIGN, IMPLEMENTATION, AND INTEGRATION OF DATA TYPES FOR THREE-DIMENSIONAL SPATIAL DATA IN DATABASES By TAO CHEN A DISSERTATION PRESENTED TO THE GRADUATE SCHOOL OF THE UNIVERSITY OF FLORIDA IN PARTIAL

More information

An Introduction to Spatial Databases

An Introduction to Spatial Databases An Introduction to Spatial Databases R. H. Guting VLDB Journal v3, n4, October 1994 Speaker: Giovanni Conforti Outline: a rather old (but quite complete) survey on Spatial DBMS Introduction & definition

More information

Generating Traffic Data

Generating Traffic Data Generating Traffic Data Thomas Brinkhoff Institute for Applied Photogrammetry and Geoinformatics FH Oldenburg/Ostfriesland/Wilhelmshaven (University of Applied Sciences) Ofener Str. 16/19, D-26121 Oldenburg,

More information

Dimension-Refined Topological Predicates

Dimension-Refined Topological Predicates Dimension-Refined Topological Predicates Mark McKenney, Alejandro Pauly, Reasey Praing & Markus Schneider University of Florida Department of Computer Science & Engineering Gainesville, FL 32611, USA {mm7,apauly,rpraing,mschneid}@cise.ufl.edu

More information

Multidimensional Data and Modelling

Multidimensional Data and Modelling Multidimensional Data and Modelling 1 Problems of multidimensional data structures l multidimensional (md-data or spatial) data and their implementation of operations between objects (spatial data practically

More information

Practical Database Design Methodology and Use of UML Diagrams Design & Analysis of Database Systems

Practical Database Design Methodology and Use of UML Diagrams Design & Analysis of Database Systems Practical Database Design Methodology and Use of UML Diagrams 406.426 Design & Analysis of Database Systems Jonghun Park jonghun@snu.ac.kr Dept. of Industrial Engineering Seoul National University chapter

More information

layers in a raster model

layers in a raster model layers in a raster model Layer 1 Layer 2 layers in an vector-based model (1) Layer 2 Layer 1 layers in an vector-based model (2) raster versus vector data model Raster model Vector model Simple data structure

More information

UNIT 1 GEOMETRY TEMPLATE CREATED BY REGION 1 ESA UNIT 1

UNIT 1 GEOMETRY TEMPLATE CREATED BY REGION 1 ESA UNIT 1 UNIT 1 GEOMETRY TEMPLATE CREATED BY REGION 1 ESA UNIT 1 Traditional Pathway: Geometry The fundamental purpose of the course in Geometry is to formalize and extend students geometric experiences from the

More information

DERIVING SPATIOTEMPORAL RELATIONS FROM SIMPLE DATA STRUCTURE

DERIVING SPATIOTEMPORAL RELATIONS FROM SIMPLE DATA STRUCTURE DERIVING SPATIOTEMPORAL RELATIONS FROM SIMPLE DATA STRUCTURE Ale Raza ESRI 380 New York Street, Redlands, California 9373-800, USA Tel.: +-909-793-853 (extension 009) Fax: +-909-307-3067 araza@esri.com

More information

Topological Predicates between Vague Spatial Objects

Topological Predicates between Vague Spatial Objects Topological Predicates between Vague Spatial Objects Alejandro Pauly & Markus Schneider University of Florida Department of Computer & Information Science & Engineering Gainesville, FL 32611, USA {apauly,

More information

Topology Homework 3. Section Section 3.3. Samuel Otten

Topology Homework 3. Section Section 3.3. Samuel Otten Topology Homework 3 Section 3.1 - Section 3.3 Samuel Otten 3.1 (1) Proposition. The intersection of finitely many open sets is open and the union of finitely many closed sets is closed. Proof. Note that

More information

CS 664 Segmentation. Daniel Huttenlocher

CS 664 Segmentation. Daniel Huttenlocher CS 664 Segmentation Daniel Huttenlocher Grouping Perceptual Organization Structural relationships between tokens Parallelism, symmetry, alignment Similarity of token properties Often strong psychophysical

More information

Topic: Orientation, Surfaces, and Euler characteristic

Topic: Orientation, Surfaces, and Euler characteristic Topic: Orientation, Surfaces, and Euler characteristic The material in these notes is motivated by Chapter 2 of Cromwell. A source I used for smooth manifolds is do Carmo s Riemannian Geometry. Ideas of

More information

DISCRETE DOMAIN REPRESENTATION FOR SHAPE CONCEPTUALIZATION

DISCRETE DOMAIN REPRESENTATION FOR SHAPE CONCEPTUALIZATION DISCRETE DOMAIN REPRESENTATION FOR SHAPE CONCEPTUALIZATION Zoltán Rusák, Imre Horváth, György Kuczogi, Joris S.M. Vergeest, Johan Jansson Department of Design Engineering Delft University of Technology

More information

Solid Modelling. Graphics Systems / Computer Graphics and Interfaces COLLEGE OF ENGINEERING UNIVERSITY OF PORTO

Solid Modelling. Graphics Systems / Computer Graphics and Interfaces COLLEGE OF ENGINEERING UNIVERSITY OF PORTO Solid Modelling Graphics Systems / Computer Graphics and Interfaces 1 Solid Modelling In 2D, one set 2D line segments or curves does not necessarily form a closed area. In 3D, a collection of surfaces

More information

City, University of London Institutional Repository

City, University of London Institutional Repository City Research Online City, University of London Institutional Repository Citation: Andrienko, N., Andrienko, G., Fuchs, G., Rinzivillo, S. & Betz, H-D. (2015). Real Time Detection and Tracking of Spatial

More information

2D Spline Curves. CS 4620 Lecture 18

2D Spline Curves. CS 4620 Lecture 18 2D Spline Curves CS 4620 Lecture 18 2014 Steve Marschner 1 Motivation: smoothness In many applications we need smooth shapes that is, without discontinuities So far we can make things with corners (lines,

More information

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY KARL L. STRATOS Abstract. The conventional method of describing a graph as a pair (V, E), where V and E repectively denote the sets of vertices and edges,

More information

Prof. Fanny Ficuciello Robotics for Bioengineering Visual Servoing

Prof. Fanny Ficuciello Robotics for Bioengineering Visual Servoing Visual servoing vision allows a robotic system to obtain geometrical and qualitative information on the surrounding environment high level control motion planning (look-and-move visual grasping) low level

More information

POINT SET TOPOLOGY. Introduction

POINT SET TOPOLOGY. Introduction POINT SET TOPOLOGY Introduction In order to establish a foundation for topological evolution, an introduction to topological ideas and definitions is presented in terms of point set methods for which the

More information

Conceptual Neighborhood Graphs for Topological Spatial Relations

Conceptual Neighborhood Graphs for Topological Spatial Relations roceedings of the World Congress on Engineering 9 Vol I WCE 9 July - 3 9 ondon U.K. Conceptual hood Graphs for Topological Spatial Relations aribel Yasmina Santos and Adriano oreira Abstract This paper

More information

A Decision-Theoretic Rough Set Model

A Decision-Theoretic Rough Set Model A Decision-Theoretic Rough Set Model Yiyu Yao and Jingtao Yao Department of Computer Science University of Regina Regina, Saskatchewan, Canada S4S 0A2 {yyao,jtyao}@cs.uregina.ca Special Thanks to Professor

More information

System Design for Visualizing Scientific Computations

System Design for Visualizing Scientific Computations 25 Chapter 2 System Design for Visualizing Scientific Computations In Section 1.1 we defined five broad goals for scientific visualization. Specifically, we seek visualization techniques that 1. Can be

More information

CHANGE-ONLY MODELING IN NAVIGATION GEO-DATABASES

CHANGE-ONLY MODELING IN NAVIGATION GEO-DATABASES CHANGE-ONLY MODELING IN NAVIGATION GEO-DATABASES YING Shen a, LI Lin a, LIU Xiaofei a, ZHAO Hu a, LI Dan b a School of Resource and Environment Science, Wuhan University.29 LUOYU Road, Wuhan 430079China.

More information

Implementation of Spatio-Temporal Data Types with Java Generics

Implementation of Spatio-Temporal Data Types with Java Generics Implementation of Spatio-Temporal Data Types with Java Generics KREŠIMIR KRIŽANOVIĆ, ZDRAVKO GALIĆ, MIRTA BARANOVIĆ University of Zagreb Faculty of Electrical Engineering and Computing Department of Applied

More information

4.12 Generalization. In back-propagation learning, as many training examples as possible are typically used.

4.12 Generalization. In back-propagation learning, as many training examples as possible are typically used. 1 4.12 Generalization In back-propagation learning, as many training examples as possible are typically used. It is hoped that the network so designed generalizes well. A network generalizes well when

More information

visual boundary (a) a vector format region (b) a raster format region region b region a Boundary Interior of region a Interior of region b

visual boundary (a) a vector format region (b) a raster format region region b region a Boundary Interior of region a Interior of region b A Spatial Algebra for Content-based Retrieval Mohan S. Kankanhalli Jiang Xunda Jiankang Wu Real World Computing Partnership, Novel Function ISS Laboratory Institute of Systems Science, National University

More information

SPATIOTEMPORAL INDEXING MECHANISM BASED ON SNAPSHOT-INCREMENT

SPATIOTEMPORAL INDEXING MECHANISM BASED ON SNAPSHOT-INCREMENT SPATIOTEMPORAL INDEXING MECHANISM BASED ON SNAPSHOT-INCREMENT L. Lin a, Y. Z. Cai a, b, Z. Xu a a School of Resource and Environment Science,Wuhan university, Wuhan China 430079, lilin@telecarto.com b

More information

Interactive Scientific Visualization of Polygonal Knots

Interactive Scientific Visualization of Polygonal Knots Interactive Scientific Visualization of Polygonal Knots Abstract Dr. Kenny Hunt Computer Science Department The University of Wisconsin La Crosse hunt@mail.uwlax.edu Eric Lunde Computer Science Department

More information

Image Segmentation. Shengnan Wang

Image Segmentation. Shengnan Wang Image Segmentation Shengnan Wang shengnan@cs.wisc.edu Contents I. Introduction to Segmentation II. Mean Shift Theory 1. What is Mean Shift? 2. Density Estimation Methods 3. Deriving the Mean Shift 4. Mean

More information

CHAPTER 5 PROPAGATION DELAY

CHAPTER 5 PROPAGATION DELAY 98 CHAPTER 5 PROPAGATION DELAY Underwater wireless sensor networks deployed of sensor nodes with sensing, forwarding and processing abilities that operate in underwater. In this environment brought challenges,

More information

SVENSK STANDARD SS-ISO :2004. Geografisk information Hantering av enklare objekt Del 1: Arkitektur (ISO :2004, IDT)

SVENSK STANDARD SS-ISO :2004. Geografisk information Hantering av enklare objekt Del 1: Arkitektur (ISO :2004, IDT) SVENSK STANDARD Fastställd 2004-09-24 Utgåva 1 Geografisk information Hantering av enklare objekt Del 1: Arkitektur (ISO 19125-1:2004, IDT) Geographic information Simple feature access Part 1: Common architecture

More information

Smallworld Core Spatial Technology 4 Spatial data is more than maps tracking the topology of complex network models

Smallworld Core Spatial Technology 4 Spatial data is more than maps tracking the topology of complex network models Smallworld Core Spatial Technology 4 Spatial data is more than maps tracking the topology of complex network models 2004 General Electric Company. All Rights Reserved GER-4230 (10/04) Abstract Spatial

More information

Dgp _ lecture 2. Curves

Dgp _ lecture 2. Curves Dgp _ lecture 2 Curves Questions? This lecture will be asking questions about curves, their Relationship to surfaces, and how they are used and controlled. Topics of discussion will be: Free form Curves

More information

Multidimensional Data and Modelling - Operations

Multidimensional Data and Modelling - Operations Multidimensional Data and Modelling - Operations 1 Problems of multidimensional data structures l multidimensional (md-data or spatial) data and their implementation of operations between objects (spatial

More information

Figure 1: Workflow of object-based classification

Figure 1: Workflow of object-based classification Technical Specifications Object Analyst Object Analyst is an add-on package for Geomatica that provides tools for segmentation, classification, and feature extraction. Object Analyst includes an all-in-one

More information

An Introduction to Dynamic Simulation Modeling

An Introduction to Dynamic Simulation Modeling Esri International User Conference San Diego, CA Technical Workshops ****************** An Introduction to Dynamic Simulation Modeling Kevin M. Johnston Shitij Mehta Outline Model types - Descriptive versus

More information

Spatial Data Management

Spatial Data Management Spatial Data Management [R&G] Chapter 28 CS432 1 Types of Spatial Data Point Data Points in a multidimensional space E.g., Raster data such as satellite imagery, where each pixel stores a measured value

More information

Metric Details of Topological Line-Line Relations

Metric Details of Topological Line-Line Relations Metric Details of Topological Line-Line Relations KONSTANTINOS A. NEDAS National Center for Geographic Information and Analysis Department of Spatial Information Science and Engineering Boardman Hall,

More information

Technische Universität München Zentrum Mathematik

Technische Universität München Zentrum Mathematik Technische Universität München Zentrum Mathematik Prof. Dr. Dr. Jürgen Richter-Gebert, Bernhard Werner Projective Geometry SS 208 https://www-m0.ma.tum.de/bin/view/lehre/ss8/pgss8/webhome Solutions for

More information

Semantic Representation of Moving Entities for Enhancing Geographical Information Systems

Semantic Representation of Moving Entities for Enhancing Geographical Information Systems International Journal of Innovation and Applied Studies ISSN 2028-9324 Vol. 4 No. 1 Sep. 2013, pp. 83-87 2013 Innovative Space of Scientific Research Journals http://www.issr-journals.org/ijias/ Semantic

More information

Relational Model: History

Relational Model: History Relational Model: History Objectives of Relational Model: 1. Promote high degree of data independence 2. Eliminate redundancy, consistency, etc. problems 3. Enable proliferation of non-procedural DML s

More information

Spatial Data Management

Spatial Data Management Spatial Data Management Chapter 28 Database management Systems, 3ed, R. Ramakrishnan and J. Gehrke 1 Types of Spatial Data Point Data Points in a multidimensional space E.g., Raster data such as satellite

More information

Orientation of manifolds - definition*

Orientation of manifolds - definition* Bulletin of the Manifold Atlas - definition (2013) Orientation of manifolds - definition* MATTHIAS KRECK 1. Zero dimensional manifolds For zero dimensional manifolds an orientation is a map from the manifold

More information

An Introduction to Content Based Image Retrieval

An Introduction to Content Based Image Retrieval CHAPTER -1 An Introduction to Content Based Image Retrieval 1.1 Introduction With the advancement in internet and multimedia technologies, a huge amount of multimedia data in the form of audio, video and

More information

Medical Image Segmentation using Level Sets

Medical Image Segmentation using Level Sets Medical Image Segmentation using Level Sets Technical Report #CS-8-1 Tenn Francis Chen Abstract Segmentation is a vital aspect of medical imaging. It aids in the visualization of medical data and diagnostics

More information

Motion Tracking and Event Understanding in Video Sequences

Motion Tracking and Event Understanding in Video Sequences Motion Tracking and Event Understanding in Video Sequences Isaac Cohen Elaine Kang, Jinman Kang Institute for Robotics and Intelligent Systems University of Southern California Los Angeles, CA Objectives!

More information

Abstract and Discrete Modeling of Spatio-Temporal Data Types*

Abstract and Discrete Modeling of Spatio-Temporal Data Types* Abstract and Discrete Modeling of Spatio-Temporal Data Types* Martin Erwig 1 Ralf Hartmut Güting 1 Markus Schneider 1 Michalis Vazirgiannis 2 1) Praktische Informatik IV Fernuniversität Hagen D-58084 Hagen

More information

Category Theory in Ontology Research: Concrete Gain from an Abstract Approach

Category Theory in Ontology Research: Concrete Gain from an Abstract Approach Category Theory in Ontology Research: Concrete Gain from an Abstract Approach Markus Krötzsch Pascal Hitzler Marc Ehrig York Sure Institute AIFB, University of Karlsruhe, Germany; {mak,hitzler,ehrig,sure}@aifb.uni-karlsruhe.de

More information

Dynamic Design of Cellular Wireless Networks via Self Organizing Mechanism

Dynamic Design of Cellular Wireless Networks via Self Organizing Mechanism Dynamic Design of Cellular Wireless Networks via Self Organizing Mechanism V.Narasimha Raghavan, M.Venkatesh, Divya Sridharabalan, T.Sabhanayagam, Nithin Bharath Abstract In our paper, we are utilizing

More information

What we have covered?

What we have covered? What we have covered? Indexing and Hashing Data warehouse and OLAP Data Mining Information Retrieval and Web Mining XML and XQuery Spatial Databases Transaction Management 1 Lecture 6: Spatial Data Management

More information

automatic digitization. In the context of ever increasing population worldwide and thereby

automatic digitization. In the context of ever increasing population worldwide and thereby Chapter 1 Introduction In the recent time, many researchers had thrust upon developing various improvised methods of automatic digitization. In the context of ever increasing population worldwide and thereby

More information

MA651 Topology. Lecture 4. Topological spaces 2

MA651 Topology. Lecture 4. Topological spaces 2 MA651 Topology. Lecture 4. Topological spaces 2 This text is based on the following books: Linear Algebra and Analysis by Marc Zamansky Topology by James Dugundgji Fundamental concepts of topology by Peter

More information

Topological and temporal modelling in GML

Topological and temporal modelling in GML Topological and temporal modelling in GML Wilko Quak, Marian de Vries Delft University of Technology Jaffalaan 9 2628 BX Delft The Netherlands w.quak@otb.tudelft.nl, m.d.vries@otb.tudelft.nl Abstract GML

More information

INCREASING CLASSIFICATION QUALITY BY USING FUZZY LOGIC

INCREASING CLASSIFICATION QUALITY BY USING FUZZY LOGIC JOURNAL OF APPLIED ENGINEERING SCIENCES VOL. 1(14), issue 4_2011 ISSN 2247-3769 ISSN-L 2247-3769 (Print) / e-issn:2284-7197 INCREASING CLASSIFICATION QUALITY BY USING FUZZY LOGIC DROJ Gabriela, University

More information

Simulation of In-Cylinder Flow Phenomena with ANSYS Piston Grid An Improved Meshing and Simulation Approach

Simulation of In-Cylinder Flow Phenomena with ANSYS Piston Grid An Improved Meshing and Simulation Approach Simulation of In-Cylinder Flow Phenomena with ANSYS Piston Grid An Improved Meshing and Simulation Approach Dipl.-Ing. (FH) Günther Lang, CFDnetwork Engineering Dipl.-Ing. Burkhard Lewerich, CFDnetwork

More information

CHAPTER 4 FREQUENCY STABILIZATION USING FUZZY LOGIC CONTROLLER

CHAPTER 4 FREQUENCY STABILIZATION USING FUZZY LOGIC CONTROLLER 60 CHAPTER 4 FREQUENCY STABILIZATION USING FUZZY LOGIC CONTROLLER 4.1 INTRODUCTION Problems in the real world quite often turn out to be complex owing to an element of uncertainty either in the parameters

More information

Chapter 9 Conclusions

Chapter 9 Conclusions Chapter 9 Conclusions This dissertation has described a new method for using local medial properties of shape to identify and measure anatomical structures. A bottom up approach based on image properties

More information

Data warehouse architecture consists of the following interconnected layers:

Data warehouse architecture consists of the following interconnected layers: Architecture, in the Data warehousing world, is the concept and design of the data base and technologies that are used to load the data. A good architecture will enable scalability, high performance and

More information

TiP: Analyzing Periodic Time Series Patterns

TiP: Analyzing Periodic Time Series Patterns ip: Analyzing Periodic ime eries Patterns homas Bernecker, Hans-Peter Kriegel, Peer Kröger, and Matthias Renz Institute for Informatics, Ludwig-Maximilians-Universität München Oettingenstr. 67, 80538 München,

More information

Extension as the background of substance a formal approach

Extension as the background of substance a formal approach Extension as the background of substance a formal approach Bart lomiej Skowron Wroc law University The Pontifical University of John Paul II, Kraków bartlomiej.skowron@gmail.com February 11, 2013 Presentation

More information

Laser speckle based background oriented schlieren measurements in a fire backlayering front

Laser speckle based background oriented schlieren measurements in a fire backlayering front Laser speckle based background oriented schlieren measurements in a fire backlayering front Philipp Bühlmann 1*, Alexander H. Meier 1, Martin Ehrensperger 1, Thomas Rösgen 1 1: ETH Zürich, Institute of

More information

Hexahedral Meshing of Non-Linear Volumes Using Voronoi Faces and Edges

Hexahedral Meshing of Non-Linear Volumes Using Voronoi Faces and Edges Hexahedral Meshing of Non-Linear Volumes Using Voronoi Faces and Edges Alla Sheffer and Michel Bercovier Institute of Computer Science, The Hebrew University, Jerusalem 91904, Israel. sheffa berco @cs.huji.ac.il.

More information

Uniform edge-c-colorings of the Archimedean Tilings

Uniform edge-c-colorings of the Archimedean Tilings Discrete & Computational Geometry manuscript No. (will be inserted by the editor) Uniform edge-c-colorings of the Archimedean Tilings Laura Asaro John Hyde Melanie Jensen Casey Mann Tyler Schroeder Received:

More information

ELEC Dr Reji Mathew Electrical Engineering UNSW

ELEC Dr Reji Mathew Electrical Engineering UNSW ELEC 4622 Dr Reji Mathew Electrical Engineering UNSW Review of Motion Modelling and Estimation Introduction to Motion Modelling & Estimation Forward Motion Backward Motion Block Motion Estimation Motion

More information

Geometric Modeling Mortenson Chapter 11. Complex Model Construction

Geometric Modeling Mortenson Chapter 11. Complex Model Construction Geometric Modeling 91.580.201 Mortenson Chapter 11 Complex Model Construction Topics Topology of Models Connectivity and other intrinsic properties Graph-Based Models Emphasize topological structure Boolean

More information

UML-Based Conceptual Modeling of Pattern-Bases

UML-Based Conceptual Modeling of Pattern-Bases UML-Based Conceptual Modeling of Pattern-Bases Stefano Rizzi DEIS - University of Bologna Viale Risorgimento, 2 40136 Bologna - Italy srizzi@deis.unibo.it Abstract. The concept of pattern, meant as an

More information

MONIKA HEINER.

MONIKA HEINER. LESSON 1 testing, intro 1 / 25 SOFTWARE TESTING - STATE OF THE ART, METHODS, AND LIMITATIONS MONIKA HEINER monika.heiner@b-tu.de http://www.informatik.tu-cottbus.de PRELIMINARIES testing, intro 2 / 25

More information