Recognizing Linear Building Patterns in Topographic Data by Using Two New Indices Based on Delaunay Triangulation

: Building pattern recognition is fundamental to a wide range of downstream applications, such as urban landscape evaluation, social analyses, and map generalization. Although many studies have been conducted, there is still a lack of satisfactory results, due to the imprecision of the relative direction model of any two adjacent buildings and the ineffective extraction methods. This study aims to provide an alternative for quantifying the direction and the spatial continuity of any two buildings on the basis of the Delaunay triangulation for the recognition of linear building patterns. First, constrained Delaunay triangulations (CDTs) are created for all buildings within each block and every two adjacent buildings. Then, the spatial continuity index (SCI), the direction index (DI), and other spatial relations (e.g., distance) of every two adjacent buildings are derived using the CDT. Finally, the building block is modelled as a graph based on derived matrices, and a graph segmentation approach is proposed to extract linear building patterns. In the segmentation process, the edges of the graph are removed first, according to the global thresholds of the SCI and distance, and are subsequently subdivided into subgraphs on direction rules. The proposed method is tested using three datasets. The experimental results suggest that the proposed method can recognize both collinear and curvilinear building patterns, given that the correctness values are all above 92% for the three study areas. The results also demonstrate that the novel SCI can effectively filter many insignificant neighbor relationships in the graph segmentation process. It is noteworthy that the proposed DI is capable of measuring building relative directions accurately and works efficiently in linear building pattern extraction.


Introduction
As the most common geographical entities in urban areas, buildings are important directional objects for users when using maps for navigation. The linear pattern formed by buildings refers to the arrangement and the form exhibited by a collection of buildings at a certain scale in the mapping space [1,2]. The pattern looks like a line, and its elements, i.e., buildings, are homogeneous in terms of spatial properties (e.g., spacing, orientation, shape, and density) [3]. Typically, linear building patterns can be categorized into collinear alignments and curvilinear alignments [1,3]. As landscape configuration, building patterns are crucial components of urban structures, which have to be preserved when spatial scales decrease during the process of map generalization [4][5][6][7]. In addition, linear building patterns in topographic maps are important for understanding geographic space, such as exploring the semantic classification of urban structures and functions based on extracted linear building patterns [8][9][10].
The detection of linear building patterns is the process by which building elements are organized into distinct linear clusters. Automatic identification of building patterns is challenging because they are often scale-dependent and vary with building distributions (e.g., the distances, orientations, area and shape among buildings), which results in an enormous number of candidates [11]. However, a variety of approaches and measures have been reported for the detection of linear building patterns. Graph-based grouping methods are the most common approaches, which in general, first model the building block as a graph in which nodes represent buildings and edges denote the adjacent relationships between buildings [12][13][14][15]. The graph is then segmented to obtain homogeneous groups by means of segmentation methods [1,16,17]. Some tracking methods can be integrated into the segmentation process to obtain linear building patterns [3,18]. Graph-based methods often suffer from many traversals. This entails the investigation of alternative algorithms that can significantly reduce the traversals. In this context, the minimum spanning tree (MST) has become the most widely used graph-based grouping method. This algorithm links each object with its nearest neighbor instead of all surrounding objects [19]. However, the MST is sensitive to small changes in the weights of edges. When modelling buildings to a graph, the index values derived from adjacent buildings are used to weight the edges of the graph. These indices are mostly derived from Gestalt principles, which consist of proximity, similarity, continuity, and common fate [20]. These Gestalt principles have been applied to the recognition of spatial distribution patterns for many years. Proximity is indicated by various distances of adjacent buildings, including centric point distance, the minimum distance of building boundaries, mean distance, adjacent distance, and synthesized index [21][22][23]. The mean distance is closer to human cognition, which is measured by the triangles between two adjacent buildings. Practice has proven that the mean distance metric proposed by [22] can more accurately measure the distance between neighboring objects than other distance metrics and has been widely used in many applications [1,6,12]. Similarity, including shape similarity and size similarity, is often used to develop rigid rules for detecting building patterns [1,3,24]. However, some objects with large differences in area and shape are still recognized as a whole, such as linear patterns. The common direction ensures that the deviation of a path angle formed by any two buildings on both sides does not exceed the set tolerance value. Many studies have been conducted to quantify the direction of objects. The models of direction include the cone-based model [25], the 2D projection model [26], and the direction Voronoi diagram (DVD) model [27]. The previous two are useful and work efficiently in qualitative spatial reasoning. The DVD model is a quantitative model for describing the spatial direction of two objects using multiple directions instead of a single direction. However, our experiences showed that a single direction may be more appropriate for quantitatively describing the path angles of a linear building pattern. Continuity is used to reflect the human perception of curved or undulated paths formed by adjacent visual stimuli [28]. However, this principle is rarely used in current research.
Since it is difficult to automatically detect the best building pattern from a large number of candidates, we can first delete the edges that do not meet the conditions from the graph and then choose the best pattern from the remainder. On the basis of the above idea, this paper first proposes an alternative to quantify the direction and spatial continuity of any two buildings on the basis of the Delaunay triangulation. Then, we propose a framework to automatically recognize linear building patterns from topographic data.
The remainder of this article is organized as follows. Data pre-processing, the measures for deriving index values, tracking algorithms, and assessment methods are described in Section 2. Section 3 presents three experimental datasets. Experiments consisting of software, implementation, results, and discussion sections are presented in Section 4. Finally, the conclusion is given.

Methodology
The proposed methodology follows a series of steps represented in Table 1 and is described below.

Main steps
Detailed description

Pre-processing
Step 1 Partition the topographical map of buildings into a series of building blocks Step 2 Create constrained Delaunay triangulation Step 3 Compute the index values of spatial relations based on constrained Delaunay triangulation Graph creation and segmentation Step 4 Create the graph and weight its edges with index values Step 5 Remove the insignificant and global edges of the graph Step 6 Segment the graph using direction rules Assessment and method comparisons Step 7 Assess the accuracy with reference patterns Compare with the MST algorithm Step 1. The first step is to partition the topographical buildings map into a series of building blocks. A road network is used to separate buildings into different blocks [6,12]. The main purpose of this step is to improve processing efficiency, as several building blocks can be processed in parallel.
Step 2. There are two kinds of constrained Delaunay triangulation (CDT) created in this step ( Figure 1). The first kind of CDT is computed for all buildings within each individual block ( Figure  1a). Triangles of the first kind are used to derive the proximity relationship (Equation (1)), the length of skeleton lines (Equation (2)), the mean distance (Equation (3)), and the direction of adjacent buildings. Another kind of constrained Delaunay triangulation, namely, the original triangle, is computed only for every two adjacent buildings (Figure 1b). Along with the first kind of CDT, these triangles are used to derive the spatial continuity index (SCI) of adjacent buildings. More discussion about the SCI is presented in the next step. Before creating the CDT, it is better to add extra points on the line segments of building polygons and roads at an interval to avoid producing narrow triangles [29]. Step 3. Six metrics, including the proximity relationship (Equation (1)), the length of the skeleton line (Equation (2)), the mean distance of adjacent buildings (Equation (3)), the SCI, the direction of two adjacent buildings, and the path angle in a tracing process, are defined on the basis of the CDT and original triangles. All these metrics except for path angles are stored in matrices.
The matrix of the proximity relationship is indicative of whether buildings are topologically adjacent and is derived on the basis of whether buildings have shared triangles in the CDT: where i = 1: n and j = 1: n denote the buildings within a block, and R , is a Boolean variable: R , = 1 indicates that i and j are adjacent, and R , = 0 indicates that i and j are not adjacent. A skeleton line is formed by the middle points of triangle sides that link two adjacent buildings ( Figure 2) [30]. The length of a skeleton line is derived as follows: where l , , denotes the distance between the two middle points of the sides of triangle k that link two adjacent buildings, L , = ∑l , , denotes the sum length of the skeleton line between two adjacent buildings, and L , = 0 if two buildings i and j are not adjacent, as obtained in Equation (1). The mean distance of adjacent buildings is derived on the basis of the skeleton line as follows [22]: where h , , denotes the height of triangle k with a base that falls in either adjacent building polygon, l , , denotes the distance between the two middle points of the sides of triangle k that link two adjacent buildings, as obtained from Equation (2), and d , = ∞ if two buildings i and j are not adjacent, as obtained in Equation (1). If the triangle is acute or right, h , , is the height from the side shared with buildings; if the triangle is obtuse, h , , is the shortest side of the triangle linking the two buildings ( Figure 2). Now, we discuss the continuity of linear building patterns. Visually, triangles within the first type of CDT look like "bridges", which join adjacent buildings to form linear patterns ( Figure 1a). Moreover, triangles between each pair of adjacent buildings of a linear pattern are very similar in terms of area, direction, and count. When comparing the above two types of triangulations, we find that the area of the original triangles between two adjacent buildings is larger than that of the first type of triangulation, especially for buildings with irregular arrangements or differences in shape and size (e.g., buildings 10-11, 11-14 in Figure 1). More specifically, in a linear pattern, the area ratio of these triangles to the original triangles is higher than that of most pairs of adjacent buildings from nonlinear patterns. Accordingly, we hold that the spatial relationship of two adjacent buildings is influenced by their surrounding buildings. In this paper, we use this ratio as the SCI of adjacent buildings to reflect our perception of the continuity of linear building patterns.
where SCI , is the spatial continuity between buildings i and j, A denotes the area of triangles that belong to the two buildings in the CDT, and A denotes the area of the original triangles connecting the two buildings. Not fewer than three buildings constitute a linear pattern. Visually, buildings from a linear pattern exhibit a linear path, which is controlled by path angles. A path angle is formed by the azimuths of two objects on both sides of the middle building. Specifically, the path angle at the middle building i is the angle formed by building direction (building , building ) and building direction (building , building ) in path ( Figure 3). There are two methods for obtaining the path angles of linear patterns based on the CDT. The difference between them is whether the triangles connecting the two buildings on both sides have intersections. The first type of path angle, named the direct path angle, is formed by two connected triangles (e.g., angle  in Figure 3). The closer to π this angle is, the better the linear pattern. It is easy to compute this angle with two connected triangles. First, determine the intersection and all triangles that connect to each building. Then, derive all included angles of these triangles. Finally, select the smallest angle as the direct path angle of the two adjacent buildings on both sides of the middle building.
Another type of path angle, namely, the indirect path angle, is formed by the azimuth angles of the buildings (e.g., building i-1 and building i+1 in Figure 3) on the two sides of the middle building (e.g., building i in Figure 3). Triangles connecting to the two buildings on both sides have no intersection. The median vectors of these triangles determine the azimuth angles of the two adjacent buildings (e.g., red dashed arrow in Figure 3). There are three steps for calculating this type of azimuth angle (Figure 4). First, determine the midpoint on the baseline (i.e., the shortest side) of a triangle and the point corresponding to the base. Use the two points to derive the azimuth angle of the triangle, which is measured counterclockwise from the positive direction of the X-axis ( Figure  4a). Clearly, all azimuth angles of the triangles are in the range of 0 to 360 degrees. Second, since all the directions of the centerline vector of the triangles point to one side of an axis, these azimuth angles can also be measured counterclockwise from one direction of the axis (Figure 4b). Thus, all of them are transformed into the range of 0 to 180 degrees, and Equation (5) is used to compute the mean azimuth angle with these azimuth angles. Finally, the mean azimuth angle is transformed to the final angle that is measured counterclockwise from the positive direction of the X-axis ( Figure  4c). In this paper, we use the final angle as the DI of two adjacent buildings. Thus, an indirect path angle is equal to the absolute value of the angular difference between two final angles (e.g., angle  in Figure 3). The closer the angle is to 0, the better the linear patterns are.
where α , , denotes the azimuth angle of a triangle k with a base that falls in either adjacent building, l , , denotes the distance between the two middle points of the two sides of triangle k that link two adjacent buildings, as obtained from Equation (2).  Step 4. This step consists of graph creation and weighting graph edges with index values. First, a building block is modelled as a graph, where nodes represent buildings, and the edges of the graph denote the adjacent relationships between buildings (Figure 5a). Then, we weight each edge of the graph with index values derived from step 3. Step 5. Our fifth step removes the insignificant and global edges of the graph, which may lead to multiple disconnected graphs (Figure 5b). At a local level, there are many insignificant edges on the graph (e.g., blue dashed line in Figure 5b), which increase the traversal time of the graph and may generate error patterns. This type of edge is removed first. At a global level, however, only close objects are visually perceived as clusters by individuals according to the Gestalt proximity principle, such as regions I and II in Figure 5b. That is, if the edges are weighted with unduly long distances (e.g., red dashed line in Figure 5b), they are removed from the graph. Thus, two cut-off values, including the SCI (Equation (4)) and d (Equation (3)), are utilized to identify the edges with unduly long index values. The cut-off value of the SCI is set empirically (e.g., 0.5) and is used for removing edges first. Subsequently, edges weighted with significantly long distances are deleted. For each point P , the cut-off value of d, denoted by Cut_Value(P ), can be represented as Equation (6).

Cut_Value(P ) = Mean(P ) + n • Variation(P )
where Mean(P ) is the mean length of the edges formed by the points connecting P . n is a controlling factor that is used to adjust the sensitiveness of Cut_Value(P ).
Step 6. The sixth action aims at subdividing the disconnected graph into connected subgraphs, as shown in Figure 5c,d. Each connected subgraph represents a linear building pattern (Figure 5d). This process is controlled by the path angle formed by the buildings on both sides and consists of several steps ( Figure 6). First, we select an unprocessed node and determine all its adjacent nodes. Then, its linear building pairs are identified from adjacent buildings on the basis of their path angles. That is, if the path angle of two adjacent buildings on both sides is lower than the given threshold, they are considered an adjacent building linear pair (Figure 5c). Third, the adjacent buildings of the adjacent buildings are determined. This process is repeated until there is no adjacent building meeting the set conditions. Thus, we can extract multiple linear building patterns of one node. Finally, the pattern with the best assessment value I is selected as the best pattern. The best assessment value I is computed for each linear pattern as follows.
where l denotes the i-th linear pattern, N is the number of edges in the i-th linear pattern, and Mean(l ) is the mean distance of the linear pattern l . Step 7. Our final step consists of an accuracy assessment and method comparisons. To validate the quality of the recognition results, an expert evaluation was conducted. That is, the reference linear building patterns were recognized manually. Five cartographic professionals participated in manual pattern recognition separately, whereas conflicts among professionals were solved via majority votes. In this survey, the three datasets were printed out in pictures at a given scale. The invited expert used a pencil to draw the determined linear patterns. For example, a linear pattern was marked with a line. When assessing the results of pattern recognition, there were four different cases, including the correct patterns (i.e., the modelled patterns and the reference patterns were consistent), the inclusion patterns (i.e., one modelled pattern contained multiple reference patterns), the within patterns (i.e., one reference pattern contained multiple modelled patterns), and the overlap pattern (i.e., a modelled pattern overlapped the reference pattern). Here, two metrics, including correctness and completeness, were used to assess the accuracy of the pattern recognition results. Correctness refers to the ratio of the correct patterns to the total extracted patterns, whereas completeness refers to the ratio of the correct patterns to the reference patterns.
To understand the robustness of the proposed method on the basis of comparative studies, the MST method was also implemented to recognize linear building patterns in the three datasets. The code for this method is freely available online, while most of the other existing methods for building pattern extraction are not publicly available.

Test Data
Three topographic datasets were used to study the identification of linear building patterns (Figure 7). The datasets were provided by the three Province Urban Planning and Design Survey Research Institutes of the three provinces in China. These datasets have various building distributions and linear building patterns, providing ideal study cases in southern China. Moreover, the distributions of buildings in ShenZhen (SZ) and ChangSha (CS) are more even than those of NanNing (NN). Visually, the distance between buildings belonging to different linear patterns in dataset NN was less than those of datasets SZ and CS, leading to the human perception effect of the linear patterns in dataset NN being lower than those of datasets SZ and CS.

Results and discussion
All experiments were performed on a personal computer with an Intel(R) Core(TM) i7-7700 CPU (central processing unit) and a memory of 8 GB. All algorithms proposed in Section 2 were realized using C# on Microsoft Windows 10 (×64). Component libraries and tool libraries of ArcGIS Engine 10.1 were applied to develop related algorithms. The reference method is based on human visual recognition. Figure 8 presents the linear pattern recognition results extracted by using different methods. Buildings connected with orange triangles form a linear pattern. Visually, the proposed method is effective in recognizing linear building patterns. For each individual dataset, the buildings are reasonably recognized in terms of linear patterns (i.e., collinear pattern and curvilinear pattern). By comparison, the proposed method performs better than the MST method in the three study areas. The linear building patterns extracted by the MST algorithm largely deviate from the reference patterns, especially in the NN study area. This algorithm iteratively detects building patterns on the basis of the distances among objects and ignores other Gestalt principles of patterns. This method is also prone to overpartitioning because it is sensitive to the weights of edges in the graph segmentation processes. The accuracy assessment results of linear building pattern recognition are summarized in Table  2. Overall, the proposed method can detect linear building patterns with correctness values and completeness values above 92%, indicating that the recognition results agree well with the reference data. Specifically, for the proposed method, fewer linear patterns are extracted from the SZ and SC datasets than the reference patterns because underpartitioning could occur when conducting graph partitioning. By comparison, the performance of the MST algorithm is markedly different from that of the proposed method in the three datasets. Both the SZ and SC datasets have high values in terms of correctness and completeness, whereas the NN dataset has much lower values of completeness and correctness. Moreover, the number of modelled group patterns recognized by this algorithm is greater than those of the reference data, indicating that overpartitioning can occur when conducting graph segmentation.  Figure 9 presents the intermediate results of the two methods before performing step 6. Overall, step 5 is effective in removing many insignificant and global edges from the graph, given that there are few edges requiring judgement being left to the next step. This is mainly due to the SCI being applied in the segmentation process. By contrasting the results of NN and the other two results, we find that there are obvious differences in the recognition results extracted by the two methods in the NN data (Figure 9a,d). This may explain the difference in accuracy between the two methods in Table 1. The MST method uses the nearest object to create the graph, resulting in the relationships of adjacent buildings that should belong to the same linear patterns, but that are slightly far away, being deleted prematurely. However, the remaining proximity relationships of some of the nearest but irregularly arranged buildings were weighted with unduly low SCIs, which resulted in these buildings being removed first from the patterns during the filtering process. As a result, the recognition results were more fragmented. This result is consistent with those reported by [31] . In the SZ and CS data, because the distance between the buildings that belong to different linear patterns is much longer, there is no significant difference in the intermediate results obtained by the two methods. However, the proposed method maintains some extra proximity relations.  inclusion pattern (i.e., one modelled pattern contains multiple reference patterns) in the three datasets (Figure 8b,e,h). This is because the triangles that connect the two buildings belonging to two different patterns are similar to those in the same patterns in terms of number and area. The proposed method also identified a within pattern and an overlap pattern in the CS data. The former is because the direct path angle formed by the triangles connecting two adjacent buildings is too small, and their relationship was deleted. For the overlap pattern, it is also difficult for human eyes to recognize them in an absolutely correct manner. In our experiments, one of the most dominant parameters is the path angle. To better demonstrate the algorithms, different path angle values were tested to show how they influence the recognition results. First, direct path angle ={90°,95°,100°,105°,110°,115°} and indirect path angle ={50°,55°,60°,65°,70°,75°} were used to detect linear alignments in the SZ dataset ( Figure 11 and Figure 12).  Figure 11 shows that the best working range of the direct path angle for the proposed method was from 95° to 100°. In this range of values for our test, recognition results did not display any difference. When increasing the direct path angle value, more linear patterns were eliminated. The breaks commonly appeared in the alignments with low curvatures (e.g., triangles marked with blue circles in Figure 11). This was due to intersections that may arise from triangles that connect two buildings on both sides. Similarly, Figure 12 shows that the best working range of the indirect path angle for the proposed method was more than 65°. When decreasing this threshold, some alignments were eliminated (green circles in Figure 12). The lower the path angle was, the more alignments were eliminated (Figure 12a-c). However, when increasing the path angle value, more buildings become potential elements of linear buildings, which may result in error patterns. Moreover, this operation reduces recognition efficiency.

Conclusions
This study set out to detect linear building patterns (e.g., collinear and curvilinear building patterns) via a graph segmentation method, which requires proximity, orientation, and continuity rules. To accomplish such a goal, this study proposed an alternative to measure the direction and the spatial continuity of any two buildings on the basis of the Delaunay triangulation and proposed a segmentation method for the extraction of linear building patterns.
We validated our approach on three vector datasets with some quantitative measurements. The experimental results indicate that the proposed methods can produce satisfactory results, given that the correctness values are all above 92% for the three study areas. Comparative studies revealed that the MST method is an ineffective extraction method for the recognition of linear building patterns when the distances between adjacent buildings that belong to different clusters are far away. This is because the MST method uses the nearest objects to create the graph. The novel SCI can effectively overcome the above defect as experimentally verified. This is because the SCI considers the shape, size, and orientation of surrounding buildings. It is noteworthy that the proposed direction model can accurately measure building relative directions and works efficiently in the extraction of linear building patterns.
Further tests are needed to improve the proposed method, such as testing with more spatial datasets from various scales and more kinds of building patterns (e.g., grid patterns). More work is also required to automatically calibrate parameters (e.g., path angle) used in the presented segmentation strategy.