Study on Spatial Geometric Similarity Based on Conformal Geometric Algebra

The study of spatial geometric similarity plays a significant role in spatial data retrieval. Many researchers have examined spatial geometric similarity, which is useful for spatial analysis and data retrieval. However, the majority of them focused on objects of the same type. Methods to support the spatial geometric similarity computation for different types of objects are rare, a systematic theory index has not been developed yet, and there has not been a comprehensive computational model of spatial geometric similarity. In this study, we conducted an analysis of the spatial geometric similarity computation based on conformal geometric algebra (CGA), which has certain advantages in the quantitative computation of the measurement information of spatial objects and the qualitative judgment of the topological relations of spatial objects. First, we developed a unified expression model for spatial geometric scenes, integrating shapes of objects and spatial relations between them. Then, we established a model for the spatial geometric similarity computation under various geographical circumstances to provide a novel approach for spatial geometric similarity research. Finally, the computation model was verified through a case study. The study of spatial geometric similarity sheds light on spatial data retrieval, which has scientific significance and practical value.


Introduction
With the diversification of Earth observation technology and the popularization of mobile devices, the amount and types of data related to geospatial positions are increasing rapidly. Determining how to locate spatial geometric scenes in which users are interested from massive spatial geometric scene data is a major issue for spatial data retrieval in urban scenarios. Computing the geometric similarity between a database scene and a query scene in a spatial database is a key point in solving the problem of spatial scene retrieval. The traditional spatial geometric similarity indices are the shape similarity of spatial objects, topological relation similarity, direction relation similarity, and distance relation similarity between spatial objects, and the computation methods are not uniform. The existing spatial data retrieval methods that were developed without comprehensive consideration of the above similarity indices cannot satisfy the demand for spatial geometric scene retrieval.
In 2001, Chinese mathematician Li Hongbo proposed the theory of conformal geometric algebra (CGA), and it was introduced to the geoscience field. This theory can realize the unified expression of different types and dimensions of geographic objects and has certain advantages in the quantitative computation of the measurement information of spatial objects and the qualitative judgment of the topological relations of spatial objects [1].
In this study, we focused on the problem of spatial geometric similarity. Based on CGA theory, a discussion is presented from the perspective of the shape expressions of spatial objects and similarity computation, the expression of the spatial relations and similarity computation, and the computation of the geometric similarity of a spatial scene. Finally, a set of relatively complete spatial geometric similarity retrieval models is proposed, which can satisfy the demand of qualitative spatial data retrieval to a certain degree.
The main contributions of the present study are as follows.
(1) Based on CGA, we realize a unified representation of spatial geometric scenes with objects of different types. The spatial geometric scene we consider is composed of different types of geometric objects and is not restricted to polygons. (2) We perform geometric similarity computations between two spatial geometric scenes, taking the shape, topology, direction, and distance into consideration to attempt to implement spatial geometric retrieval in a comprehensive manner.

Literature Review
A spatial scene comprises a collection of spatial objects and their particular spatial arrangement. People construe such spatial geometric scenes in terms of objects and relations [2,3]. Many scholars have explored this topic [4][5][6][7]. Spatial scene similarity is the similarity of two regions in terms of particular object sizes and contents [5][6][7][8]. The spatial geometric similarity in our study involves spatial geometric features, including the shape of spatial objects and the spatial relationship between objects. The existing spatial similarity research is mainly divided into two parts. One is based on the geometric characteristics of spatial objects, and the similarity of spatial objects is studied. Kuijpers et al. [9] and Gottfried [10] used a double cross model and bipartite arrangements, respectively, to obtain qualitative shape expressions and proposed concrete qualitative shape similarity computation algorithms from the perspective of shape description operations. Shapiro et al. [11] proposed a theoretical relational modeling technique to separate objects into thin pieces (e.g., sticks, plates, and blobs). Richards et al. [12] used a codon as the basic unit to describe closed two-dimensional (2D) shapes.
The other approach uses the relations between spatial objects to study the similarity of the spatial relations [13][14][15]. Spatial relation similarity mainly includes spatial topological relation similarity, direction relation similarity, and distance relation similarity. Many scholars have performed some research on the combination of topology and direction, the combination of direction and distance, and the combination of the three and developed similarity evaluation methods, such as feature matching, derivation from equivalence, case reasoning, and fuzzy functions [16][17][18][19][20][21]. The semantic similarity plays an important role in spatial scene retrieval. Many researchers have made some contributions in this area [22][23][24][25].
Li et al. [1] first presented the concept of CGA in the book Geometric Computing with Clifford Algebras, which has been highly praised by the international academic community. Zong [47] obtained a formal expression of the spatial topological relations based on algebraic geometry and the quantitative computation of topological relations by using a meet operator, which was able to distinguish more detailed spatial topological relations, and applied it to the intersection of the 3D surface model of an Antarctic ice sheet. Chen [48] obtained a unified expression of different types of multi-dimensional geographic objects using CGA properties, based on which formal expressions of the spatial topological relations and temporal topological relations were obtained. Furthermore, spatiotemporal topological relations were obtained. These relations were applied to the computation of spatiotemporal topological relations. This approach has value for various applications, such as checking the spatiotemporal topological rules of current land use and the historical backtracking of spatiotemporal objects.

Methodology
In this paper, we introduce a multidimensional unified expression and geometric computation based on CGA. The unified expression of multidimensional geometric objects is realized based on the multivector. By using the geometric product, the similarity relationship of spatial objects, spatial topology, direction, and distance can be conveniently computed, which provides a new solution for the spatial geometric similarity retrieval.
According to Figure 1, first, we resolve the central objects that satisfy a specified shape similarity threshold. Second, the Voronoi graph is built to obtain the spatial neighborhood objects. From this, we can obtain a certain number of scenes. Third, according to the spatial constraints for the query scene, the variable ordering is set, and the forward checking algorithm is used to match the query scene with the sub-scenes from the database scene. If no such sub-scene meets the condition, we can relax the condition and compute the similarity between the query scene and the retrieved scene until we achieve our goal. The main theories covered in this paper are described in this section as follows.

Conformal Geometric Algebra
CGA is a new geometric representation and computing system that provides a unified and simple homogeneous algebraic framework for classical geometry and has notable advantages in geometric data processing and geometric computation [49]. The inner product, outer product, and geometric product are core operations in the geometric object representation and algorithm construction. CGA is the most common geometric algebra (GA) space. Based on the traditional Euclidean space, two extra base vectors, e 0 and e i , are used to represent basic geometric objects. A hierarchical geometric structure corresponds to the hierarchical Grassmann structure for the outer product in CGA. The inner product in CGA can describe basic metric information, such as the distance and angle.

Shape Similarity Computation
Falomir et al. [50] conducted similarity measurements of spatial objects based on qualitative shape descriptions. The complete description of the shape of a 2D object is given from a set of qualitative features as follows: where n is the total number of relevant points of the object, EC i describes the edge connection that occurs at the point P i , A i |TC i describes the angle or the type of curvature at P i , L i describes the compared length of the edges connected at P i , and finally, C i describes the convexity at P i .
In this study, the qualitative shape representation model (QSDM) of spatial objects is established on the basis of their research. The spatial objects are edge-connected, so we employ the other three features.
As shown in Figure 2, it is assumed that P 2 , P 3 , and P 4 are three points of the spatial object S, which are connected in turn. At point P 3 , a three-tuple is defined to represent the relevant point, where A P denotes the angle between line segments P 2 P 3 and P 3 P 4 , L P denotes the ratio of the length of the line segments, and C P denotes the concavity and convexity of point P 3 .

Angle Computation
The angle between two adjacent line segments of the polygon is computed at relevant points by using the inner product. For one-dimensional vectors a and b, which are constructed by connecting a relevant point P 3 to its previous point P 2 and its next point P 4 , respectively, the angle is computed by GA, which encodes the inner and the outer product; the inner product is proportional to the cosine, and the outer product is the sine. Thus, the value of the angle can be computed by the arctan2 function. At first, we partition the angle into five intervals, {[0, 40], (40,85], (85, 95], (95, 140], (140, 180]}, and the corresponding semantic expressions of the five intervals are {very_acute, acute, right, obtuse, very_obtuse}. In this work, we use an open ball B r (c) (Borelian notation) where c = (a + b)/2(center) and r = (b − a)/2(radius). Given two internals, I 1 = (a 1 , b 1 ) = B r1 (c 1 ) and I 2 = (a 2 , b 2 ) = B r2 (c 2 ), a family of distances between intervals was defined [51], which depends on three parameters as follows: where ∆c = c 2 − c 1 , ∆r = r 2 − r 1 , and A is a symmetrical 2 × 2 matrix of weights. Here, we use the most natural choice for the A matrix, which is the identity matrix that provides the next distance: (3) Using Borelian notation and the interval distance, for example, for the two intervals [0, 40] and [40,85], I 1 = (0, 40) = B 20 (20) and I 2 = (40, 85) = B 22.5 (62.5), d 2 (I 1 , I 2 ) = (62.5 − 20) 2 + (22.5 − 20) 2 = 42.6, which is the distance between the very acute and acute. Using the same process, we obtain all the angle relation distances, as shown in Table 1.

Ratio of Length Computation
The lengths of two adjacent line segments of polygon feature points are computed using the inner product. The Euclidean distance between two points is directly embedded in the inner product computation with the expression , and the ratio of the lengths is the ratio of the lengths of two adjacent line segments.

Concavity and Convexity Judgment
The concavity and convexity of the angle between two adjacent line segments of the polygon are judged using the inner product. For example, for point P 2 , its concavity and convexity can be determined by the relation between a one-dimensional vector a = P 1 P 2 and the point P 3 . If the point P 3 is on the left of vector a, the point P 2 is concave; otherwise, P 2 is convex. The concrete computation can construct a one-dimensional vector c = P 1 P 3 and a one-dimensional vector m that is perpendicular to P 1 P 2 on the right, and then the sign of the inner product c·m is examined. If c·m > 0, point P 3 is on the right of vector a. If c·m < 0, point P 3 is on the left of vector a. For concavity relation distance, it equals 0 if they are the same; otherwise, it equals 1. For two concave or convex relations, the distance is 0, and for one concave and the other convex, the distance is 1.
The computations of the three parameters above are the components of the shape computation, which mainly rely on inner product computation. An inner product contains the information of the angle and distance, which can obtain the three-tuple quantitative values of the shape expression model concisely and intuitively and lay the foundation for the computation of the shape similarity.
For two objects, we adopt the following formula to compute the shape similarity between them: where RP A and RP B denote the relevant points of objects A and B, respectively; ds(i) denotes the distance between two relations; Ds(i) denotes the maximum distance; and w i denotes weights for each relation.

Topological Relations Similarity Computation
Zong [47] performed research on spatial topological relations based on geometric algebra and discussed the topological relations between a point, line segment, and triangle. Chen [48] sought the topological relations between two polygons by decomposing a polygon into triangles. In this article, we do not distinguish the topological relations as Chen did, but rather, we take the polygon as a whole.
The spatial topological relations are determined based on the research of Zong and Chen. We divide the object into the interior, boundary, and exterior (the point can be divided into the interior and the exterior, without the boundary), use the geometric product, and construct different discriminants. Thus, topological relations between objects of different types can be obtained.

Point and Other Objects
(1) Topological relations between two points For two points A and B, the discriminant is constructed as follows: If t = 0, A intersects B, and the topological relation is pp-equal. If t <> 0, A does not intersect B, and the topological relation is pp-disjoint. The topological relations are shown in Figure 3. Using the topological relation operation between two points, we obtain two relations: pp-disjoint and pp-equal. Figure 4 shows the corresponding conceptual neighborhood diagram. For two points, when the topological relation is the same as the other two, the relation distance is 0; otherwise, the relation distance is 1. (2) Topological relations between point and line segment A line segment is a straight line with a boundary constraint. For a straight line L passing through points A and B, the judgment expression is L = AˆBˆe i . The topological relations between point P and line segment AB can be determined by the two following expressions: If t 1 > 0 and t 2 > 0, P is within AB, and the topological relation between them is pl-inside. If t 1 = 0 or t 2 = 0, P coincides with the edges of AB, and the topological relation between them is pl-touch. If t 1 < 0 or t 2 < 0, P does not intersect with AB, and the topological relation between them is pl-disjoint. The topological relations are shown in Figure 5. Using the topological relation operation between a point and a line segment, we obtain three relations: pl-disjoint, pl-touch, and pl-inside. Figure 6 shows the corresponding conceptual neighborhood diagram. The topological relation distances which are decided according to the conceptual neighborhood diagram are shown in Table 3.  Table 3. Topological relation distances between a point and a line segment.

) Topological relations between point and polygon
The relations can be computed using the following judgment expression: where P is the point, L is the boundary of the polygon, and Φ is the plane that contains the polygon M. Φ = C ∧ e i , C is the boundary circle, e i denotes infinity, and L denotes the straight line at which the boundary of the polygon M is located. If t < 0 for all judgment expressions, P is inside M. The topological relation between them is ps-inside. If t = 0, P is in the boundary of M. The topological relation between them is ps-touch. In other situations, P is outside M. The topological relation between them is ps-disjoint. The topological relations are shown in Figure 7. Using the topological relation operation between a point and a polygon, we obtain three relations: ps-disjoint, ps-touch, and ps-inside. Figure 8 shows the corresponding conceptual neighborhood diagram. The topological relation distances which are decided according to the conceptual neighborhood diagram are shown in Table 4.

Two Line Segments
Using the operation between a point and a line segment, we can construct a computing strategy to determine the topological relations between two line segments. For two line segments L 1 and L 2 , the relation between the two edge points of L 1 and the line segment L 2 is computed. When one of the edge points of L 1 is within L 2 or coincident with the edge points of L 2 , the topological relation is ll-touch. When the two edges of L 1 coincide with two edges of L 2 , the topological relation is ll-equal. When the two edge points of L 1 are inside L 2 and the two edge points of L 2 are outside L 1 , the topological relation is ll-inside. When the two edge points of L 2 are inside L 1 and the two edge points of L 1 are outside L 2 , the topological relation is ll-contains. When the interior of L 2 intersects with that of L 1 , the topological relation is ll-overlap. When both the interior and the two edge points of L 2 do not intersect with the interior and the two edge points of L 1 , the topological relation is ll-disjoint. The topological relations are shown in Figure 9. Using the topological relation operation between two line segments, we obtain six relations: ll-disjoint, ll-touch, ll-overlap, ll-equal, ll-contains, and ll-inside. Figure 10 shows the corresponding conceptual neighborhood diagram. The topological relation distances which are decided according to the conceptual neighborhood diagram are shown in Table 5.

Line Segment and Polygon
Using the operation between a point and a polygon and the operation between two line segments, we compute the topological relations as follows. For the two edge points of L, if both are inside polygon S, the topological relation between L and S is ls-inside1. If one edge point of L is inside polygon S and the other edge point is on the boundary of S, the topological relation between L and S is ls-inside2. If the two edge points of L are on the boundary of S, the topological relation between L and S is ls-inside3. If one edge point of L is on the boundary of S and the other is outside S, the topological relation between L and S is ls-touch. If one edge point of L is inside S and the other is outside S, the topological relation between L and S is ls-overlap1.
If the two edge points of L are outside S, the relation between the line segment L and the boundary of S is judged. If L does not intersect with the boundary of S, the topological relation between L and S is ls-disjoint. If L intersects with the boundary of S, the topological relation between L and S is ls-overlap2.
In summary, we can distinguish four topological relations: ls-disjoint, ls-overlap, lsinside, and ls-touch. The relations ls-inside1, ls-inside2, and ls-inside3 can be recognized as ls-inside, and the relations ls-overlap1 and ls-overlap2 can be recognized as ls-overlap. The topological relations are shown in Figure 11. Using the topological relation operation between a line segment and a polygon, we obtain four relations: ls-disjoint, ls-touch, ls-overlap, and ls-inside. Figure 12 shows the corresponding conceptual neighborhood diagram. The topological relation distances which are decided according to the conceptual neighborhood diagram are shown in Table 6.

Two Polygons
Based on the operation between a point and a line segment, between a point and a polygon, and between two line segments, we compute the topological relations as follows.
For all vertices {U 1 , U 2 , . . . , U m } of S 1 , if all are inside S 2 , the operation between a point and a polygon is used, and the condition is recorded as C 1 . If all the vertices are outside S 2 , the condition is recorded as C 2 . If they are all on the boundary of S 2 , the condition is recorded as C 3 . If some of the vertices are inside S 2 and some are outside S 2 , the condition is recorded as C 4 . If some of the vertices are inside S 2 and some are on the boundary of S 2 , the condition is recorded as C 5 . If some of the vertices are outside S 2 and some are on the boundary of S 2 , the condition is recorded as C 6 . Likewise, we obtain the conditions D 1 , D 2 , D 3 , D 4 , D 5 , and D 6 .
If C 1 is satisfied but D 1 is not, the topological relation between S 1 and S 2 is ss-contains. If D 1 is satisfied but C 1 is not, the topological relation between S 1 and S 2 is ss-inside. If both C 2 and D 2 are satisfied, the topological relation between S 1 and S 2 is ss-disjoint. If both C 3 and D 3 are satisfied, the topological relation between S 1 and S 2 is ss-equal. If C 4 or D 4 is satisfied or both are, the topological relation between S 1 and S 2 is ss-overlap. If D 5 is satisfied, the topological relation between S 1 and S 2 is ss-covers. If C 5 is satisfied, the topological relation between S 1 and S 2 is ss-covered-by. If both C 6 and D 6 are satisfied, the topological relation between S 1 and S 2 is ss-touch. The topological relations are shown in Figure 13. Using the topological relation operation between two polygons, we obtain eight relations: ss-disjoint, ss-touch, ss-overlap, ss-covers, ss-covered-by, ss-contains, ss-inside, and ss-equal. Figure 14 shows the corresponding conceptual neighborhood diagram. The topological relation distances which are decided according to the conceptual neighborhood diagram are shown in Table 7. The topological relations between two polygons can be distinguished using the same topological relations with the RCC8 model.  Table 7. Topological relation distances between a line segment and a polygon.

Topological Relation Similarity Computation Strategy
m spatial objects in query scene V are denoted as v 1 , v 2 , . . . , v m . n spatial objects in the query database U are denoted as u 1 , u 2 , . . . , u n . We adopt the following strategy to compute the topological relations between two scenes. First, the topological relation operation is used to resolve the relation between two objects in the query scene, which is denoted as T 1 . Furthermore, we obtain the relation between two objects in the database scene, which is denoted as T 2 . By utilizing the corresponding conceptual neighborhood diagram, the relation distance is computed. Furthermore, the similarity S Ri between T 1 and T 2 is computed.
We compute all topological relation similarities between objects in the query scene and corresponding objects in the database scene as follows: where W Ri denotes the weight values of the topological relations. In this paper, the weight values are the same; however, for future work, the weight values can be different according to the actual scene. For example, the topological relation inside may be more important than disjoint. S Ri denotes the similarity between two relations, and t denotes the number of matched objects.

Direction Relation Similarity Computation
The outer product realizes the dimensional and geometric operations, while the inner product provides the angle and distance information. For two geometric objects O 1 and O 2 of arbitrary dimensions, the metric information between two basic objects is as follows: For example, as shown in Figure 15a, for two vectors O 1 and O 2 , the inner product is the distance that O 1 projects onto O 2 . In Figure 15b, for the vector O 1 and the plane O 2 , the inner product is the vector that is in O 2 and perpendicular to O 1 . Owing to highdimensional scalability, the operation is conferrable to arbitrary dimensions, not limited to vectors [52]. If P 1 (0,1) and P 2 (1,0) belong to a 2D Euclidean space, by converting them into the conformal space, we obtain C2ga_P 1 = e 2 + 0.5e ∞ + e 0 and C2ga_P 2 = e 1 + 0.5e ∞ + e 0 . The origin point is C2ga_O = e 0 . The outer product between two points and infinity can be used to construct a line. Thus, the line P 1 P 2 can be represented as C2ga_P 1ˆC 2ga_P 2ˆe∞ . The magnitude of P 1 P 2 is |P 1 P 2 | = √ 2, and the magnitude of the unit base vector is |OE| = 1. Thus, the inner product P 1 P 2 ·OE = |P 1 P 2 ||OE|cos θ, and the computation result is The angle value can be mapped to the corresponding angle interval, and the corresponding semantic expression can be acquired. Figure 16 illustrates the relation between the direction relation semantic expression and the angle value.  (3), we find all r = 22.5, and the distance d = 45 between two adjacent directions. Hence, we simplify the distance, which is similar to the conceptual neighborhood diagram.
The direction relation is reflexive. When the direction relation distance surpasses 4, the format Dir Max − Dir Cal is used to compute the relation distance. The final direction relation distances are shown in Table 8. We employ the direction relation operation to compute the angle value between two objects, map the angle value to an angle interval, obtain the semantic expression, and compute the distance and similarity of the direction relations. The similarity computation formula of the direction relation is as follows: where dr denotes the direction relation distance and Dr denotes the maximal distance.

Distance Relation Similarity Computation
As discussed in Section 3.4, the inner product contains the angle and distance information. In this section, we compute the distance information. The inner product is C2ga_P 1 ·C2ga_P 2 = (e 2 + 0.5e ∞ + e 0 )(e 1 + 0.5e ∞ + e 0 ). Based on the equations e 2 0 = e 2 ∞ = 0 and e 0 ·e ∞ = −1, the value of the inner product is −1. The Euclidean distance is embedded in the inner product based on the expression a·b = − 1 2 d 2 E (a, b), and thus, the Euclidean distance is (−2) * (−1) = √ 2. For two geometric objects A and B, the distance relation operation is implemented as follows. (1) The center points O A and O B of the minimum bounding circles are computed for A and B, respectively. (2) The inner product between O A and O B is computed, and then the distance value can be computed.
In CGA, the distance relation operation is used to compute the distance between two objects. We determine the relation between the quantitative distance value and the distance interval and obtain the semantic distance expression. Using the distance relation table, we can compute the distance relation similarity.
In an actual scene, the distance value range is uncertain. We use the ratio of the specific value and maximal value to represent the distance relation. In this study, we define the distance relation semantics expression as {very close (vc), close (cl), a bit close (abc), commensurate (co), a bit far (abf), far ( Table 9. The similarity computation formula for the distance relation is as follows: Sim(Dis 0 , where ds denotes the relation distance and Ds denotes the maximal distance.

Spatial Geometric Similarity Computation
Based on the whole process shown in Figure 1, we designed a retrieval method taking the shape and spatial relations (including topological, direction, and distance relation) into account. During the whole process, we assume that the weights are equivalent for the objects and the spatial relations between them. The topology, direction, and distance relations have the same effect on the spatial relation.
The scenes in Figure 17 are considered as an example. We apply the object shape and spatial relation similarity computation model to analyze the example. For the query scene (a), using the multivector and corresponding relation operations, we obtain the following integrating representation [46] form: The shape and spatial relation information are implied in the representation. The related operations including topological relation, direction relation, and distance relation can be called to compute the corresponding relations directly. The topological, direction, and distance relations in the query scene are listed in Tables 10-12, respectively.  Table 10. Topological relations in the query scene (a) in Figure 17.
ss-touch ss-equal ss-disjoint ss-disjoint ss-disjoint C 1 ss-disjoint ss-disjoint ss-equal ss-disjoint ss-disjoint D 1 ss-disjoint ss-disjoint ss-disjoint ss-equal ss-touch E 1 ss-disjoint ss-disjoint ss-disjoint ss-touch ss-equal Table 11. Direction relations in the query scene (a) in Figure 17. Table 12. Distance relations in the query scene (a) in Figure 17.
For the database scene (b), following the same computation strategy, we obtain the topological, direction, and distance relations, as shown in Tables 13-15, respectively. Table 13. Topological relations in the database scene (b) in Figure 17.
ss-equal ss-touch ss-disjoint ss-disjoint ss-disjoint B 2 ss-touch ss-equal ss-disjoint ss-disjoint ss-disjoint C 2 ss-disjoint ss-disjoint ss-equal ss-disjoint ss-disjoint D 2 ss-disjoint ss-disjoint ss-disjoint ss-equal ss-disjoint E 2 ss-disjoint ss-disjoint ss-disjoint ss-disjoint ss-equal Table 14. Direction relations in the database scene (b) in Figure 17. Table 15. Distance relations in the database scene (b) in Figure 17. In the database scene (c), the different colors represent different attributes, and only object B was different. When taking the shape and spatial relations into consideration, the similarities between (c) and (a) are equal, and both are 1. For the database scene (d), we obtain the spatial relation tables shown in Tables 16-18.   Table 16. Topological relations in the database scene (d) in Figure 17.

A 4 B 4 C 4 D 4 E 4
A 4 ss-equal ss-touch ss-disjoint ss-disjoint ss-disjoint B 4 ss-touch ss-equal ss-disjoint ss-disjoint ss-disjoint C 4 ss-disjoint ss-disjoint ss-equal ss-disjoint ss-disjoint D 4 ss-disjoint ss-disjoint ss-disjoint ss-equal ss-touch E 4 ss-disjoint ss-disjoint ss-disjoint ss-touch ss-equal Table 17. Direction relations in the database scene (d) in Figure 17. Based on the spatial relations computed by corresponding operations, the topological, direction, and distance relation similarities between The attributes and shapes of the two scenes are the same, so the shape similarity is 1. Hence, the spatial similarity is Sim (a, d) = 1/2 + (S Top + S Dir + S Dis )/6 = 0.933. According to the computation results, the spatial similarity between (b) and (a) is bigger than that between (d) and (a), so the scene (b) is more similar than (d) to (a).
For the database scene (e), the spatial relations are the same as in the query scene (a). The shape of the object C is different: it is a triangle in (a) and a square in (e). The shape similarity operation is used first to construct a three-tuple representation for the relevant points. For scene (a), the relevant point representations of object C 1 are <acute, sl, convex>, <acute, sl, convex>, and <acute, sl, convex>. Similarly, the point representations of object C 5 are <right, sl, convex>, <right, sl, convex>, <right, sl, convex>, and <right, sl, convex>. Thus, the shape similarity between C 1 and C 5 is Sim = ((1 − 32.6/(140.0 × 3)) × 3)/4 = 0.69. Thus, the spatial similarity between scenes (a) and (e) is Sae = 0.5 + ((0.69 + 4)/5)/2 = 0.969. The similarity values between each scene and the query scene are shown in Table 19.

Related Background
For resident areas in a city, public transportation stations are common facilities along the roads. Public transportation stations are simplified as point objects, roads as polyline objects, and resident buildings as polygons. The resident areas are spatial geometric scenes with objects of different types. The traditional methods cannot satisfy the retrieval demands for these scenes very well. In this section, we attempt to obtain a unified representation and computation for spatial geometric scenes to overcome the disunity of the representation and complexity of the spatial relation computation.

Retrieval Process
(1) An integrating representation model of geographical objects and geographical scenes is developed based on CGA. The model contains the geometric and spatial relation information for the scene. We can call related operations to resolve the information. For example, one query scene is shown in Figure 18. The database scene is shown in Figure 19.  (2) Objects that satisfy the specified similarity threshold with the scene's central objects are resolved. Three parameters, i.e., closeness, perimeter, and area, are employed to compute the central objects. The closeness computation formula is as follows: The normalization formula is as follows: Reasonable weights for each normalized parameter are assigned, and their weighted sum is calculated as follows: (3) The Voronoi graph and corresponding sub-scenes based on the neighborhood relations are constructed. (4) The spatial geometric similarity computation method is used, and then the similarity between each sub-scene and the query scene is obtained. The retrieval results are shown in Figure 20. The method proposed in this study can be used to retrieve spatial scenes with objects of different types. The retrieval results will be helpful for real estate developers and civilians to retrieve similar spatial geometric scenes. It is of great scientific significance and practical value to conduct spatial scene retrieval.

Conclusions
The amount of spatial geometric data in urban scenarios is increasing. In this study, we propose a method of computing the spatial geometric similarity in urban spatial patterns based on CGA. Operations for the shape and spatial relations are constructed using the inner, outer, and geometric products in CGA, and the relation distance tables are developed by means of conceptual neighborhood diagrams and interval distances. Then, the process of spatial geometric similarity computation is designed and realized based on the expression and computation of the object shape and spatial relations between two objects. From the aspects of the spatial object shape, spatial topology, direction, and distance between two objects, the spatial geometric similarity is evaluated more completely, which is important in the field of spatial data retrieval. In further research, on the one hand, semantic similarity should be taken into consideration for spatial similarity computation. The relations between the topology, direction, and distance can be deduced before the spatial similarity computation to improve the retrieval efficiency. On the other hand, we will adopt some computation strategies, such as parallel computing using MapReduce, to improve the efficiency. The method proposed in this paper can carry out comprehensive quantitative calculation by integrating spatial topology, direction, distance, and spatial object, which has important reference significance for urban planning and city site selection, providing a new perspective for spatial planning.

Data Availability Statement:
The data is not available due to legal restrictions. The authors of this study did not agree for their data to be shared publicly, so supporting data is not available.

Conflicts of Interest:
The authors declare no conflict of interest.