An approach to computing direction relations between separated object groups

. Direction relations between object groups play an important role in qualitative spatial reasoning, spatial computation and spatial recognition. However, none of existing models can be used to compute direction relations between object groups. To ﬁll this gap, an approach to computing direction relations between separated object groups is proposed in this paper, which is theoretically based on gestalt principles and the idea of multi-directions. The approach ﬁrstly tri-angulates the two object groups, and then it constructs the Voronoi diagram between the two groups using the triangular network. After this, the normal of each Voronoi edge is calculated, and the quantitative expression of the direction relations is constructed. Finally, the quantitative direction relations are transformed into qualitative ones. The psychological experiments show that the proposed approach can obtain direction relations both between two single objects and be-tween two object groups, and the results are correct from the point of view of spatial cognition.

A number of models for describing and/or computing direction relations have been proposed, including the conebased model (Peuquet and Zhan, 1987;Abdelmoty and Williams, 1994;Shekhar and Liu, 1998), the 2-D projection model (Frank, 1992;Nabil et al., 1995;Safar and Shahabi, 1999), the direction-relation matrix model (Goyal, 2000), and the Voronoi-based model (Yan et al., 2006).These models can compute direction relations between two single objects, but can not compute direction relations between two object groups.Nevertheless, objects on maps may be viewed as groups in many cases in light of gestalt principles, such as proximity, similarity, common orientation/direction, connectedness, closure, and common region (Palmer, 1992;Weibel, 1996;Yan et al., 2008).In other words, objects close to each other, with similar shape and/or size, arranged in a similar direction, topologically and/or visually connected, with a closed tendency, and/or in the same region have Explanation: the objects enclosed by a dash-lined rectangle are viewed as a group.a tendency to be viewed as a group (Fig. 1).Four categories of object groups can be differentiated according to the geometric ingredients of the single objects: point, linear, areal/polygonal, and complex object groups.Figure 2 shows a number of pairs of object groups.Thus, it is of great importance to find methods to obtain direction relations between object groups.
Because none of the models for computing direction relations between object groups has been proposed, this paper will focus on filling this gap.After the introduction (Sect.1), existing models for computing direction relations will be discussed (Sect.2).Then the theoretical foundations of the new approach will be presented (Sect.3), and a Voronoi-based model for computing directions between object groups will be proposed (Sect.4).After that, a number of experiments will be shown to demonstrate the validity of the proposed approach (Sect.5).Finally, some conclusions will be made (Sect.6).

Analysis of existing models
To propose a model for computing direction relations between object groups, it is pertinent to summarize and analyze previously existing ones to show their advantages and disadvantages.
To facilitate the discussion in the following sections, it is designated that 1.A is the reference object (or object group), and B is the target object (or object group); 2. Dir(A, B) is the qualitative description of direction relations from A to B; 3. D(A, B) is the quantitative description of direction relations from A to B ; and 4. only extrinsic reference frame is employed for direction relations.
-The cone-based model (Peuquet and Zhan, 1987) partitions the 2-dimensional space around the centroid of the reference object into four direction regions corresponding to the four cardinal directions (i.e., N, E, S, W).The direction of the target object with respect to the reference object is determined by the target object's presence in a direction partition for the reference object.
If the target object coincides with the reference object, the direction between them is called "same".
This model is developed primarily to detect whether a target object exists in a given direction or not.If the distance between the two objects is much larger than their size, the model works well; otherwise a special method must be used to adjust the area of acceptance.If objects are overlapping, intertwined, or horseshoe-shaped, this model uses centroids to determine directions (Peuquet and Zhan, 1987), and the results are misleading sometimes.In addition, if a target object is in multiple directions, such as {N, NE, E}, this model does not provide a knowledge structure to represent multiple directions (Goyal, 2000).
-The 2-D projection model (Frank, 1992;Nabil et al., 1995;Safar and Shahabi, 1999) represents spatial relations between objects using MBRs (minimum bounding rectangles).Reasoning between projections of MBRs on the x and y axes is performed using 1-D interval relations.Using this method, one can characterize relations between MBRs of objects uniquely.There are 13 possible relations on an axis (Allen, 1983;Nabil et al., 1995) in 1-D space; therefore, this model distinguishes 13 × 13 = 169 relations in 2-D space.
The 2-D projection model approximates objects by their MBRs; therefore, the spatial relation may not necessarily be the same as the relation between exact representations of the objects, because the model can not capture the details of objects in direction descriptions (Goyal, 2000).So this model can be only used for the qualitative description of direction relations.
-The direction-relation matrix model (Goyal, 2000) partitions space around the MBR of the reference object into nine direction tilts: N, NE, E, SE, S, SW, W, NW, and O (same direction).A direction-relation matrix is constructed to record if a section of the target object falls into a specific tilt.Further, to improve the reliability of the model, a detailed direction-relation matrix capturing more details by recording the area ratio of the target object in each tilt is employed.
The direction-relation matrix model provides a knowledge structure to record multilevel directions.However, it can not obtain D(A, B)/Dir(A, B) from D(B, A)/Dir(B, A)and vice versa (Yan et al., 2006).-The Voronoi-based model (Yan et al., 2006) uses "direction group" because people describe directions between two objects using multiple directions.A direction group consists of multiple directions, and each direction includes two components: the azimuths of the normals of direction Voronoi edges between two objects and the corresponding weights of the azimuths (Fig. 3).
The Voronoi-based model can describe direction relations quantitatively and qualitatively, and can obtain D(B, A) by D(A, B).Direction relations are recorded in 2-dimensional tables.
The above four models may be compared using the following five criteria (Goyal, 2000;Yan et al., 2006).1. simplicity: computation of the direction relations between arbitrary two objects is not time-consuming, and the model is easy to be understood; Table 1 shows the advantages and disadvantages of the above models.Obviously, none of the existing models meets the five criteria.And, particularly, none of them can be used to compute direction relations between object groups.

Theoretical foundations of multi-directions
Direction relations between object groups need to be described using multiple directions in many cases.The examples of multiple directions are very common in the geographic space.Especially if two object groups are intertwined, enclosed, or overlapping with each other, description of direction relations with multiple directions becomes unavoidable.

Examples of multi-directions
-Example 1: UniRoad composed of three roads passes through University A composed of many buildings (Fig. 4).The direction relations between the road and the university can not be simply described by a single cardinal direction.
-Example 2: as a very common case, a road runs approximately parallel with a river.In Fig. 5, a man may say "the road is to the northeast of the river" when he is at P ; and he may say "the road is to the north of the river"  when he is at Q; however, if he walks to R, he may say: "the road is to the east of the river".Nevertheless, all three answers are intuitively partial and unacceptable.
To give a whole description, it is reasonable to combine the three answers.
-Example 3: in Fig. 6, village A (a group of buildings) is half-enclosed by river R (a group of river branches).
A single cardinal direction obtained by the cone-based model (e.g., A is at the south of R) can not describe their direction relations clearly.

Cognitive explanation of multi-directions
From the point of view of perception, in any case, the following two principles remain unquestionable in direction judgments.
-Relations between the sum of the whole and its parts: "the sum of the whole is greater than its parts" (Wertheimer, 1923;Clifford, 2002) is the idea behind 1 2 3 4 5 6 Fig. 6 If an object group is half-enclosed by another gr a single direction is not enough to describe their direc relations.
Village V River basin R Fig. 6.If an object group is half-enclosed by another group, a single direction is not enough to describe their direction relations.
the principle of gestalt.It is the perception of a composition as a whole.Human's perception of the piece is based on their understanding of all the bits and pieces working in unison.People usually ignore the trivial of spatial objects but get the sketches of the whole before they judge directions.Their judgments are based on the sketches but not on details.This process implies the idea of cartographic generalization.The generalization methods in direction judgments are a little bit different from those used in traditional map generalization (Weibel, 1996).The generalization scale depends on the size of the field formed by the two object groups.The larger the distance between the two groups, the larger the objects are generalized.
-Proximity: the principle of proximity or contiguity states that nearby objects can be regarded as a group and more correlated (Alberto and Charles, 2011).
Such examples exist almost everywhere in daily life.In Fig. 6, the three directions are obtained by the three pairs of proximal sections of the road and the river.Hence, "judging directions by proximal sections" will be one of the most important principles in the new model.

Expression of multi-directions
In our daily life, when a man says "the hospital is to the east of the school", he generally has an imaginary ray (here, ray is directly borrowed from its mathematical concept) in his brain, pointing from the hospital to the school indicating the direction.Hence, it is a natural thought to express direction relations using such rays.If multi-directions exist between two object groups, a combination of multiple rays can be utilized to denote their direction relations, each ray corresponding to a cardinal direction (Yan et al., 2006).For example, in Fig. 5, the directions from the river (A) to the road (B) may be expressed using a direction set Dir(A, B) = {NE, N, E}.

Reasonability of using Voronoi diagram to express directions
It is difficult to get a certain ray pointing from one object to another; however, the normals of the ray (i.e., the Voronoi diagram of the two objects) can be obtained.Because a ray and its normal are perpendicular to each other, the ray can be obtained easily by its normals.Figure 7 presents the Voronoi diagrams and the ray between two point objects and between a point object and a linear object, respectively.Obviously, each of the rays (normal of the Voronoi diagram) denotes the direction relations.

A Voronoi-based model
To simplify the following discussion, the two object groups in Fig. 6 will be used as an example.Here, river basin R is the reference object group; the village V is the target object group.The eight-direction system (i.e., eight directions E, NE, N, NW, W, SW, S, and SE are discerned) will be employed.Because both quantitative and qualitative direction relations are widely used in daily life, the proposed model will express direction relations in quantitative and qualitative ways.

Framework of the model
The new model for computing quantitative and direction relations consists of four procedures: 1. cartographic generalization of the two object groups;

construction of the Voronoi diagram;
3. computation of quantitative direction relations; and 4. construction of qualitative direction relations.

Cartographic generalization of the two object groups
According to "the relations between the sum of the whole and its parts", cartographic generalization is a first necessary step in human's direction judgments.This procedure aims at simplifying object groups so that direction computation can be done in a simple way.Suppose that the diameter of convex hull of the two object groups is d; Eq. ( 1) is used to simplify spatial objects.
where S is the generalization scale of the objects (i.e., the details whose sizes are less than S will be simplified), and ε is an angle.It equals 90 • in the four-direction system and 45 • in the eight-direction system.The generalized result of Fig. 6 is shown in Fig. 8a, which can be used for computing direction relations in the eightdirection system.

Construction of the Voronoi diagram
It is well known that Delaunay triangulation is a useful and efficient tool in spatial adjacency/proximity analysis (Li et al., 2002); hence, it is used to get proximal sections of the two object groups.On the other hand, the Delaunay triangular network and the Voronoi diagram are dual of each other (Arias et al., 2011); thus the Voronoi diagram of the two object groups can be easily obtained by their Delaunay triangular network.The Voronoi diagram can be obtained by following steps.
First, construct a point set consisting of all of the vertices of the two object groups.
Second, construct the Delaunay triangular network (Fig. 8b) of the point set.If the three vertices of a triangle belong to one object group, it is called a "first-type triangle"; otherwise, it is called a "second-type triangle".Next, delete all of the first-type triangles.The remaining triangles compose the proximal area (Fig. 8c) of the two groups.
Finally, generate the Voronoi diagram (Fig. 8d) using the remaining triangles.

Computation of quantitative direction relations
The Voronoi diagram of two object groups generally consists of n ≥ 1 Voronoi edges (e.g., the Voronoi diagram in Fig. 8d has 15 edges); each Voronoi edge has a normal.Hence, a total of n normals can be obtained to denote the direction pointing from the reference object group to the target object group.In other words, there are n directions between the two object groups.
To describe direction relations quantitatively with the n directions, the following three strategies are employed.
-A single direction can be described using the azimuth of the normal of the Voronoi edge.
An azimuth of a ray is the angle measured clockwise from the positive end of the vertical axis of the Cartesian coordinate system to the ray. Figure 9 shows the azimuth (α) of ray O-A.
-To differentiate the importance of each direction, each direction is assigned a weight value, which is the percentage of the length of each corresponding Voronoi edge.
Because each Voronoi edge corresponds to a single direction, the Voronoi diagram may be generalized using Eq.(1) as the criterion to simplify the final expression of the direction relations.
-To facilitate saving direction relations in databases, all of the azimuths and their corresponding weights are listed in a 2-dimensional table.

Construction of qualitative direction relations
To qualify the quantitative direction relations, the following two steps are needed.
-Change the azimuths into qualitative directions.
In the eight-direction system, north means an azimuth in [337.5 -Combine the same cardinal directions, and add up their corresponding weights.
Table 3 shows the qualitative description of direction relations from R to V in Fig. 8.The directions of edge 4 and  11 % of V is to the north of R, 20 % of V to the east of R, 26 % of V to the southeast of R, and 43 % of V to the southwest of R.

Experiments and discussions
Whether the proposed approach is correct and valid should be tested by psychological experiments, because judgments of directions are rooted in human's spatial cognition (Egenhofer and Shariff, 1998;Gayal, 2000).For this purpose, the direction relations of 40 pairs of object groups were computed using a C# program implemented by the authors.They were drawn in a table and distributed to 33 testees (all testees are graduates of Lanzhou Jiaotong University, China).The natural language description of direction relations was attached to each pair of object groups.The testees were required to answer if they "totally agree", "agree", are "unsure", or "do not agree" with each answer.Figure 11 and  First, Dir(B, A) can be obtained from Dir(A, B) by the proposed approach.Taking Fig. 11a as an example, a simple inversion of the three cardinal directions in Dir(Q, P ) = {< N, 73.67 >, < NW, 11.48 >, < NE, 14.85 >} can generate Dir(P , Q) = {< S, 73.67 >, < SE, 11.48 >, < SW, 14.85 >}.
Second, the mean of the confidence values from the test is 88.1 % (including "totally agree" and "agree"); the least is 64 %; the greatest is 94 %.Hence, this approach is acceptable and valid from the point of view of spatial cognition.
Third, the proposed approach can be used to compute direction relations both between single objects and between object groups (Fig. 11).
Fourth, the results obtained by the approach are both quantitative (Table 4) and qualitative (Table 5).Moreover, the results are saved in 2-dimensional tables, facilitating the construction of databases for direction relations.
And finally, if two object groups are intersected, contained and/or covered with each other (i.e., they have common parts), the approach can not work well and needs to be improved.

Conclusions
This paper proposed an approach to computing direction relations between two separated object groups in 2dimensional space.The approach is supported by two principles in gestalt theory.One is the principle of "the sum of the whole and its parts", and the other one is the principle of proximity.Its validity and soundness has been proved by psychological experiments.The main advantages of this approach can be summarized as follows: (1) it can compute direction relations between object groups, which the other models can not; (2) it can obtain Dir(A, B) from Dir(B, A) without complex computation; (3) initial quantitative direction relations can be transformed into qualitative ones easily; and (4) quantitative and qualitative direction relations can be recorded in 2-dimensional tables, which is useful in spatial database construction and spatial reasoning.Our further research will focus on improving this approach so that it can be used to process topologically intersected and/or contained object groups.
Fig.1 Objects on maps are viewed as a group in light of the Gestalt principles: (a)proximity; (b)similarity; (c)similar direction; (d)connectedness; (e)closed tendency; and (f)same region.

Fig. 1 .
Fig. 1.Objects on maps are viewed as a group in light of the gestalt principles: (a) proximity; (b) similarity; (c) similar direction; (d) connectedness; (e) closed tendency; and (f) same region.

Fig. 3 .
Fig.3 Principle of the Voronoi-based model used to describe direction relations between single objects.
2. inversion: Dir(B, A)/D(B, A) can be obtained by Dir(A, B)/D(A, B); 3. correctness: results obtained are consistent with human's spatial cognition; 4. quantification: the model can give quantitative representations of direction relations; and 5. qualification: the model can give qualitative representations of direction relations.

Fig. 5 .
Fig.4Multi-directions are needed when two object groups are intertwined.

Fig. 7 Fig. 7 .
Fig.7 Normals of the Voronoi edges used to denote directions.

Fig. 8 Fig. 8 .
Fig.8 Procedures of computing direction relations between two object groups: (a) generalized object groups; (b) triangulation of the object groups; (c) proximal sections of the object groups; and (d) Voronoi Diagram.

Fig. 11 .
Fig.11 Examples of pairs of object groups used in the experiment: (a) point point group; (b) linepoint group; (c) polygonpoint group; (d) lineline network; (e) linelinear arranged polygon group; (f) polygon groupline network; (g) polygon clusterlinear arranged polygon group; (h) polygon complex group with polygons, lines and points.

Table 1 .
Comparison of the existing models.

Table 2 .
Quantitative description of direction relations from R to V in Fig.8.

Table 3 .
Qualitative description of direction relations from R to V in Fig.8.

Table 4 .
Qualitative direction relations of the pairs of object groups (the percentages are the weights of the directions).

2013 1598 H. Yan et al.: An approach to computing direction relations between separated object groups
Table 4 give eight typical examples of our experiment.The result of the psychological test is listed in Table 5.Some insights can be gained from the experiments.

Table 5 .
Statistical results of the psychological test (%).