A method for constructing rectangular partitioning graph based on edge orientation
The topology map is directly extracted from the original map through edge orientation method, and the rectangular segmentation map is constructed through preprocessing and orientation algorithms, which solves the problems of complex calculations and low automation in the existing technology, and realizes efficient and accurate rectangular segmentation map construction.
Patent Information
- Application Number
- CN202210573169.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-05-24
AI Technical Summary
The existing rectangular segmentation graph construction algorithm has the problem of complex calculations and low degree of automation, especially in the conversion process of the original map to the rectangular segmentation graph, which requires multiple manual operations and complex calculations.
The rectangular segmentation graph construction method based on edge orientation is adopted to directly extract the topology map from the original map and pre-process it through topology constraints to obtain a segmentable topology map. Each edge is then oriented with relative position constraints, so that each minimum ring forms a rectangle, and finally the coordinates of the points are determined by the relaxation and alignment algorithm.
Automatic construction of rectangular segmentation graphs is realized, which simplifies the process, reduces additional calculations, and improves the accuracy and efficiency of the algorithm.
Smart Images

Figure CN114882053B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for constructing a rectangular segmentation graph based on edge orientation, and belongs to the technical field of data visualization. Background Art
[0002] A rectangular cartogram is a cartogram in which each area is a rectangle. It is a novel representation method that facilitates the simultaneous recognition of quantity and topological relationships. It is widely used in population trend analysis, natural disaster prediction and other fields. The mainstream algorithms for constructing rectangular cartograms include the construction algorithm based on rectangular segmentation graphs and the heuristic construction algorithm. Among them, the construction algorithm based on rectangular segmentation graphs has clear ideas and wide applicability and is widely used. A rectangular segmentation graph is a rectangular segmentation system Φ of a rectangle R. Φ={R1,R2...Rn} is a set of rectangles that do not contain four-chain nodes after R is segmented. In a rectangular cartogram, Φ is a special expression of a certain attribute of each area in the map. The rectangle R is equivalent to the inner outline of the map, and the small rectangles inside represent meaningful areas in the map, such as administrative divisions, geographical boundaries, etc. The adjacent relationship of the small rectangles is consistent with the adjacent relationship of the represented area.
[0003] At present, the main algorithms for constructing rectangular segmentation graphs include the Regular Edge Labeling (REL) algorithm, the Canonical Ordering algorithm, and the Path Digraph algorithm. However, these algorithms still have the following problems: ① The degree of automation of the algorithm is low: the algorithm starts with a properly triangulated planar (PTP), that is, the topological relationship must be extracted from the map first, and then the PTP graph must be obtained through a "point-to-plane" conversion before the rectangular segmentation graph can be constructed. The process of constructing the PTP requires a lot of manual operations, resulting in the entire algorithm not being fully automated; ② There are many additional calculations: the Regular Edge Labeling algorithm and the Canonical Ordering algorithm need to transform the area in the map into points twice for subsequent calculations, and then convert it into planes after the calculations are completed; the Path Digraph algorithm needs to first extract a directed graph describing the orientation relationship of the sub-rectangles, and then determine the specific position of the sub-rectangles based on the graph. The additional calculations increase the difficulty of algorithm implementation and reduce the accuracy of the algorithm. Summary of the invention
[0004] The purpose of the present invention is to provide a method for constructing a rectangular segmentation map based on edge orientation, so as to solve the problems of complex calculation and low efficiency existing in the current rectangular segmentation map division of the original map.
[0005] In order to solve the above technical problems, the present invention provides a method for constructing a rectangular segmentation graph based on edge orientation, and the method comprises the following steps:
[0006] 1) Obtaining the original map data of the target area, and extracting a topological map based on the topological relationship between the regions in the original map data;
[0007] 2) Preprocessing the obtained topological graph using topological constraints to obtain a separable topological graph, wherein the topological constraints are: there is no ring with a degree less than 4 in the topological graph, and the degree of the ring refers to the number of points constituting the ring;
[0008] 3) Orient each edge in the separable topological graph using relative position constraints, so that each minimum ring forming area in the separable topological graph is a rectangle, and obtain an oriented graph;
[0009] 4) Determine the coordinate value of each point according to the connection status of each point in the directed graph, so that each ring in the rectangular partition graph is a rectangle and there are no duplicate edges inside the layout.
[0010] The present invention directly extracts a topological map from an original map, and obtains a divisible topological map by preprocessing the topological map so that there are no rings with a degree less than 4 in the topological map; on this basis, the present invention uses relative position constraints to orient each edge in the divisible topological map, thereby obtaining a directed graph in which each ring is a rectangle; finally, the coordinates of each point are determined using the connection status of each point in the directed graph, thereby obtaining a rectangular segmentation map. The present invention does not need to convert the original map into a PTP graph, and can directly obtain a divisible topological map using a preprocessing method with set rules; at the same time, positioning and coordinate determination can be achieved through simple iterations based on the properties of the rectangular graph. Therefore, the implementation process of the present invention is simple, does not require additional complex calculations, and can automatically realize the construction of a rectangular segmentation map.
[0011] Furthermore, the specific implementation process of step 3) is as follows:
[0012] a. Assign attributes to each point, and the assigned attributes are used to characterize the connection of the point in four directions;
[0013] b. Determine all attributes of points on the outer boundary of the separable topology map and individual attributes of points connected to the outer boundary according to the obtained separable topology map;
[0014] c. Use the orientation condition to determine the attributes of all points in the separable topological map to ensure that the degree of freedom of each point except the four corner points is 0, where the degree of a point refers to the number of neighboring points of the point, and the degree of freedom of a point refers to the undetermined number of neighboring points. In the separable topological map, except for the four corner points, the degree of each point is 3 and the degree of freedom is 0; the orientation condition is determined based on the property that each ring in the oriented map is a rectangle.
[0015] The present invention first determines the attributes of the outer boundary points in the divisible topological map and the attributes of the points directly connected thereto, and then determines the attributes of each point in an iterative manner using the orientation condition formulated by the ring being a rectangle, thereby achieving orientation of the divisible topological map. The present invention achieves orientation by determining the point attributes, and can accurately and quickly achieve orientation of the divisible topological map.
[0016] Furthermore, the orientation conditions include:
[0017] A. If the properties of two adjacent sides of a quadrilateral are determined, then the properties of the four sides in the quadrilateral are also determined;
[0018] B. If the connection relationship between two adjacent points inside the quadrilateral is determined, and one of the points has a definite relationship with its adjacent point outside the quadrilateral, then the attributes of the four sides of the quadrilateral are determined;
[0019] C. If a point with a degree of freedom of 1 has two selectable directions, and the current selection of the directional attribute makes a ring in the splittable topology graph a rectangle, then the connection orientation of the current point is correct;
[0020] D. When a point with a degree of freedom of 1 has two relative positions to choose from, the direction of the ring is determined according to the attributes of other points on the ring;
[0021] E. If there are four corner points in the ring arranged in a clockwise or counterclockwise order, the current ring is a rectangle and the attributes of each point in the ring are determined.
[0022] The present invention makes full use of the properties of the rectangular graph and formulates the orientation conditions according to the properties of the rectangular graph, thereby further ensuring that the obtained orientation graph can meet the requirements of the rectangular graph.
[0023] The step 4) includes using a relaxation algorithm to determine the preliminary coordinates of each point in the oriented graph and using an alignment algorithm to adjust the preliminary coordinates so that the longitudinal coordinates of the horizontal common edges are equal and the abscissas of the vertical common edges are equal.
[0024] The present invention can quickly realize the preliminary calibration of the coordinates of each point in the oriented graph by using a relaxation algorithm, and then adjust the preliminary calibrated coordinates by using an alignment algorithm, so that the distance relationship of each point in the rectangle can be more reasonably reflected, and the obtained coordinates are more reasonable.
[0025] Furthermore, the implementation process of the relaxation algorithm is as follows:
[0026] Assign the same initial value to each point in the directed graph, set the minimum distance between two points, take the upper left corner of the directed graph as the starting point, and set the coordinates of the point equal to the initial value;
[0027] Starting from the starting point, the distribution of neighboring points of each point in the oriented graph is determined in order from left to right and from top to bottom, so as to assign and update the coordinates of each point:
[0028] Take any point as the target point, and determine whether there are neighboring points on the left and above the target point. If there are neighboring points on the left but not on the above, the abscissa of the target point after the assignment is the abscissa of the left neighbor plus the minimum distance and the larger value of the abscissa of the target point before the assignment, and the ordinate is the ordinate of the left neighbor plus the minimum distance and the larger value of the ordinate of the target point before the assignment; if there are neighboring points on the above but not on the left, the abscissa of the target point after the assignment is the abscissa of the upper neighbor plus the minimum distance and the larger value of the abscissa of the target point before the assignment, and the ordinate is the ordinate of the upper neighbor plus the minimum distance and the larger value of the ordinate of the target point before the assignment; if there are neighboring points on both the left and above, the abscissa of the target point after the assignment is the maximum value of the abscissa of the left neighbor plus the minimum distance, the abscissa of the upper neighbor, and the abscissa of the target point before the assignment, and the ordinate is the maximum value of the ordinate of the left neighbor, the ordinate of the upper neighbor plus the minimum distance, and the ordinate of the target point before the assignment.
[0029] The present invention utilizes the coordinates and positional relationship of adjacent points and can automatically and quickly assign values to each point in an iterative manner.
[0030] Furthermore, the implementation process of the alignment algorithm is as follows:
[0031] Starting from any point in the oriented graph, the azimuth relationship between adjacent points is used to determine the maximum horizontal path and the maximum vertical path composed of continuous points, which are used as the horizontal common edges and vertical common edges of the rectangular partition graph respectively. The coordinate values of each point are adjusted according to the principle that the ordinates of the horizontal common edges are equal and the abscissas of the vertical common edges are equal.
[0032] Furthermore, the preprocessing in step 2) includes adding corner points, correcting breakpoints, correcting triangular rings and correcting repeated edges.
[0033] The present invention can quickly realize the correction of the topological graph by adding corner points, correcting breakpoints, correcting triangular rings and correcting multiple edges, so that no ring with a degree less than 4 exists in the topological graph.
[0034] Furthermore, in the step 1), if there are areas in the original map data with two or more external edges, the areas with two or more external edges are deleted before topological map extraction; or the areas with two or more external edges are segmented so that the segmented areas have only one external edge.
[0035] In view of the situation that there are multiple outer regions in the original map, the present invention processes the original map by deleting or re-dividing it to avoid the problem of orientation error caused by this situation, thereby greatly improving the accuracy of constructing the rectangular segmentation map. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1-a is the original map obtained;
[0037] Figure 1-b It is a floor plan extracted from the original map;
[0038] Figure 1-c It is a schematic diagram of the relationship between REL and the rectangular dual graph;
[0039] Figure 2 It is a flow chart of the method for constructing a rectangular segmentation graph based on edge orientation of the present invention;
[0040] Figure 3-a is a topological map extracted based on the original map in an embodiment of the present invention;
[0041] Figure 3-b is a topological map after preprocessing in an embodiment of the present invention;
[0042] Figure 4 It is a schematic diagram of the data structure of point attributes adopted by the present invention;
[0043] Figure 5-a It is the initial state of the divisible topological map before orientation in the embodiment of the present invention;
[0044] Figure 5-b is an orientation graph obtained after orientation in an embodiment of the present invention;
[0045] Figure 6 is a flow chart of the directional algorithm adopted by the present invention;
[0046] Figure 7-a It is a schematic diagram of the principle of conclusion 1 in an embodiment of the present invention;
[0047] Figure 7-b It is a schematic diagram of the principle of conclusion 1 in an embodiment of the present invention;
[0048] Figure 7-c It is a schematic diagram of the principle of conclusion 2 in an embodiment of the present invention;
[0049] Figure 8-a is a schematic diagram of forming a directed ring in a first direction when a point with a degree of freedom of 1 has two relative positions to be selected in an embodiment of the present invention;
[0050] Figure 8-bis a schematic diagram of forming a directed ring in a second direction when a point with a degree of freedom of 1 has two relative positions to be selected in an embodiment of the present invention;
[0051] Fig. 9 is a schematic diagram of four points arranged in a clockwise or counterclockwise order to form a rectangle in an embodiment of the present invention;
[0052] Fig.10 It is a flow chart of the implementation from the directional graph to the rectangular partitioning graph adopted by the present invention;
[0053] Figure 11-a is a schematic diagram of an embodiment of the present invention in which a target point has a left neighboring point but no upper neighboring point;
[0054] Figure 11-b is a schematic diagram of an embodiment of the present invention in which a target point has an upper neighboring point but no left neighboring point;
[0055] Figure 11-c is a schematic diagram of an embodiment of the present invention in which a target point has both a left neighboring point and an upper neighboring point;
[0056] Figure 12-a It is a schematic diagram of assigning initial values to a directed graph in an embodiment of the present invention;
[0057] Figure 12-b is a schematic diagram of determining coordinates of a directed graph by a relaxation method in an embodiment of the present invention;
[0058] Figure 12-c is a schematic diagram of correcting the coordinates of a directional graph by an alignment method in an embodiment of the present invention;
[0059] Figure 13-a is the original map of the German continental part obtained in the experimental example of the present invention;
[0060] Figure 13-b The topological map corresponding to the map of Germany obtained in the experimental example of the present invention;
[0061] Figure 13-c is a preprocessed segmentable topological map corresponding to the German map obtained in the experimental example of the present invention;
[0062] Figure 13-d is a rectangular segmentation map corresponding to the German map obtained in the experimental example of the present invention;
[0063] Figure 14-a is the original map of the continental United States obtained in the experimental example of the present invention;
[0064] Figure 14-b It is a simplified map of the continental United States obtained in the experimental example of the present invention. DETAILED DESCRIPTION
[0065] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0066] Among the existing methods for constructing rectangular segmentation of maps, the clearer idea is to first extract the topological relationship of the map to form a plane graph G, and then process G according to the duality principle to obtain a dual graph G*. After the edges of G* are oriented according to the rules, regular edge labels REL (Regular Edge Labeling) can be obtained, and then the rectangular dual graph of the plane graph G* is constructed by REL.
[0067] The rectangular dual graph of a planar graph G* = (V, E) is a rectangular partitioning system Φ that satisfies the following two conditions: (1) The rectangles in Φ have a one-to-one correspondence with the points in G* through a surjective relation f:V←→Φ; (2) The rectangles in Φ corresponding to the vertex V have a common edge only if the two vertices in G are connected. Figure 1-a For the original map, Figure 1-b is the floor plan extracted from the original map, Figure 1-c is the relationship between REL and the rectangular dual graph.
[0068] This method has the following problems: ① Two dual operations are required from the map to its rectangular partitioning; ② The planar graph G does not necessarily satisfy the topological relationship of the rectangular partitioning graph, and some topological relationships need to be manually processed.
[0069] To this end, the present invention proposes a method for constructing a rectangular segmentation map based on edge orientation. The present invention first obtains the original map data of the target area, and extracts a topological map based on the topological relationship between the regions in the original map data; then, the topological constraint condition is used to preprocess the obtained topological map to obtain a separable topological map, and the topological constraint condition is: there are no rings with a degree less than 4 in the topological map; then, the relative position constraint is used to orient each edge in the separable topological map, so that each minimum ring forming area in the separable topological map is a rectangle, and a directed graph is obtained; finally, according to the connection status of each point in the directed graph, the relaxation algorithm and the alignment algorithm are used to determine the coordinate value of each point, so that each ring in the segmentation map is a rectangle and there are no duplicate edges inside the layout. The implementation process of this method is as follows: Figure 2 As shown, the specific implementation process is as follows.
[0070] 1. Obtain the original map data of the target area and obtain the corresponding topological map.
[0071] Assume that the original map data obtained in this embodiment is as follows Figure 1-a As shown, the topological map is extracted according to the topological relationship between the regions in the map, and the topological map corresponding to the map can be obtained. If there are two or more external edges in the original map data, the region with two or more external edges is deleted before the topological map is extracted; or the region with two or more external edges is segmented so that the segmented region has only one external edge.
[0072] 2. Preprocess the obtained topological map to obtain the corresponding separable topological map.
[0073] The preprocessing of the present invention mainly adopts "there is no ring with degree less than 4 in the topological map", that is, any ring in the topological map is composed of at least 4 points, which is the basic requirement that each face in the topological map can be represented as a rectangle. Before introducing the process, several concepts involved are explained. The degree of a point refers to the number of neighboring points of the current point in the divisible topological map; the degree of a ring refers to the number of points that make up the ring in the divisible topological map. For example, when the degree of a ring is 3, the ring is called a triangle, and when the degree of a ring is 4, the ring is called a quadrilateral.
[0074] like Figure 3-a As shown, in this embodiment, the topological graph has topological errors such as breakpoints, repeated edges and triangular rings, that is, it does not meet the constraint condition of "there is no ring with degree less than 4 in the topological graph". For the above errors, the present invention uses a preprocessing method to process them, including adding corner points and correcting breakpoints, triangular rings and repeated edges. The topological graph obtained after preprocessing is as shown in FIG. Figure 3-b As shown, the topological graph is a divisible topological graph, and the topological conditions it satisfies include: i. except for the four corner points of the outline which are 2-link nodes, the remaining points are 3-link nodes; ii. the ring within the topological graph contains at least 4 points.
[0075] 3. Perform directed graph conversion on the obtained separable topological graph.
[0076] The present invention performs directed graph conversion based on point attributes. Therefore, before describing the directed graph conversion process in detail, the point attribute structure used in the present invention is first explained. The selection of the point attribute structure is mainly based on the following considerations: except for the corner points, each point in the separable graph and three neighboring points form three edges with a degree of 3. At the same time, according to the horizontal and vertical characteristics of the rectangle, the three edges can only be in the four directions of "east, south, west, and north", and each direction has at most one neighboring point. Therefore, the direction of the rectangular partition graph edge can be represented by the point attributes. This embodiment uses an array of length 4 to represent the connection status of the four directions. The index of the array represents the direction, representing point 0 (north in the map), point 1 (east in the map), point 2 (south in the map), and point 3 (west in the map). The attribute value is the number of the neighboring point or -1, where -1 indicates no connection. Figure 4 As shown, in this embodiment, the attribute of point e is [a, b, c, -1], which means that position 0 is connected to point a, position 1 is connected to point b, position 2 is connected to point c, and position 3 is not connected, which is represented by -1. Using an array to represent the connection of four directions can also derive the algebraic relationship between the directions.
[0077] The basic idea of edge orientation is to determine the initial state of the layout by the direction of the outline of the rectangular partitioning graph, and then assign attributes to each point by using the property that each small area of the rectangular partitioning graph is a rectangle. Figure 5-a is the initial state of a rectangular segmentation graph. The known attributes in the initial state are all the attributes of the points on the outer boundary and the single attributes of the points connected to the outer boundary, such as Figure 5-a The points with lighter colors in the middle, and the initial values of the other points are [-1,-1,-1,-1] (indicating the attribute positions of these points, first characterized by no connection). Since the degree of the inner point is 3 (all points except the four corner points have three adjacent points), when the attribute array is all -1, it means that the degree of freedom is 3, indicating that the three adjacent points of the point are undetermined. When there is only one -1 in the attribute array, it means that the degree of freedom is 0 (except the four corner points), indicating that the three adjacent points of the point are all determined. Afterwards, the attributes of all points are determined using the orientation conditions. When the degree of freedom of all points is 0 (that is, all the adjacent points of each point are determined), it means that the attributes of each point have been determined, thus achieving the orientation of the topological map. The orientation result obtained in this embodiment is as follows: Figure 5-b shown.
[0078] The essence of converting a separable graph into a rectangular segmentation graph is to transform the rings in the separable graph into rectangles. By analyzing the transformation process, the following basic properties can be obtained: 1) Each ring is a rectangle, and the degree of the ring is at least 4; 2) If the degree of the ring is 4, the direction of the ring can be determined according to the state of a single corner point or the direction of a single edge; 3) If the degree of the ring is greater than 4, it can be determined whether the ring can form a rectangle according to whether it is an orientable ring; 4) The direction attribute of a single point can be determined according to the state of the adjacent points; 5) The corner points of the rectangle are special and exist uniquely in the rectangle.
[0079] Based on the above analysis, the present invention can draw the following conclusions:
[0080] Conclusion 1: If the properties of two adjacent sides of a quadrilateral are determined, then the properties of the four sides within the quadrilateral can also be determined.
[0081] If the properties of the two adjacent sides in the quadrilateral are determined, then the connection properties between the three points in the quadrilateral can be determined, and the properties of the fourth point in the quadrilateral can be determined. Figure 7-a and Figure 7-b As shown, assuming that the connection between a and the two points b and d in the rectangle is determined, then the two sides ab and ad in the quadrilateral are determined, and the connection between the sides cb and cd can be determined by the uniqueness of the quadrilateral.
[0082] Conclusion 2: If the connection relationship between two adjacent points in a quadrilateral is determined, and at the same time, one of the points has a definite relationship with its adjacent point outside the quadrilateral, then the connection inside the quadrilateral can be determined.
[0083] like Figure 7-cAs shown, suppose a point a in the rectangle has a definite relationship with a point b in the rectangle, and their adjacent positions are connected to the adjacent point f outside the quadrilateral. Then, due to the restriction that the corner points of the rectangle are right angles, the other adjacent point d can only be in the other adjacent position of point b. At this time, the properties of the two adjacent sides in the quadrilateral can be determined. According to the content of Conclusion 1, the properties of the four sides of the quadrilateral can be determined.
[0084] Conclusion 3: When a point with a degree of freedom of 1 has two selectable directions, if the current choice of directional attribute makes a ring in the segmentation graph become a rectangle, then the connection orientation of the current point is determined to be correct.
[0085] The degree of each point that forms a quadrilateral is 3 (except for the corner points). If the degree of freedom of the current point is 1, it means that two of the three neighboring points of the point have been determined, and only one neighboring point is left undetermined, that is, two of the four positions of the point have been determined, and the other neighboring point can only be selected from the remaining two positions. Since the purpose of orientation is to obtain an internal rectangle, if the current orientation makes a ring become a rectangle, it can be determined that the direction of the current orientation is the direction of the last neighboring point, that is, the direction of the current orientation is correct.
[0086] Conclusion 4: When a point with a degree of freedom of 1 has two relative positions to choose from, when the directed ring cw and the corner point have the relationship shown in Formula 1, the connection relationship between cw and the starting point is Formula 2; when the directed ring cw and the corner point have the relationship shown in Formula 3, the connection relationship between cw and the starting point is Formula 4.
[0087] A directed ring is a ring whose midpoints are arranged in sequence from the starting point to the end point, such as Figure 8-a As shown in the figure, the direction of the starting point refers to the position of the second point in the orientation of the first point, denoted as direction. If the two determined neighboring points of w are f and e, and f and e are located on opposite sides of w, then the cw edge must form a right angle with the we and wf edges, that is, point w must be a corner point in the cw ring. After preprocessing, the cw ring forms a directed ring with point w as the starting point and point c as the end point, denoted as path. It can be seen that cw has two ways to form a ring, one is to form a ring along direction2, and the other is to form a ring along direction1.
[0088] Depending on the initial direction, the following two specific situations can be obtained:
[0089] ① If there is a corner point in the cw ring and the direction satisfies the relationship shown in formula 1, then c and w satisfy the relationship shown in formula 2, such as Figure 8-a shown.
[0090]
[0091]
[0092] Wherein direction refers to the direction of w as the starting point. For this embodiment, there are two directions of w, one is along the direction of wf (direction1), and the other is along the direction of we (direction2). The direction of w determined by the present invention is direction1 or direction2. Wherein a[(direction+3)%4]=path[last] represents that the direction of point a after moving 3 points clockwise along the direction of its starting point direction modulo 4 is the previous point in the ring relative to point a. Similarly, the meaning expressed by the conditions of each point can be inferred. If points a, b and c all satisfy the above relationship (Formula 1), it can be inferred that the relationship between c and w is:
[0093] w[(direction+3)%4]=c, c[(direction+1)%4]=w Formula 2
[0094] In the formula, path[last] and path[next] are the previous and next points in the ring relative to point a.
[0095] ② If the corner point and direction in the cw ring satisfy the relationship shown in formula 3, then c and w satisfy the relationship shown in formula 4, such as Figure 8-b shown.
[0096]
[0097] At this time, the relationship between c and w is
[0098] Formula 4
[0099] w[(direction+1)%4]=c, c[(direction+3)%4]=w
[0100] In formula 1 and formula 3, directions are relative directions, and all possible situations can be obtained by changing the direction.
[0101] This conclusion can be used to determine the direction of the directed ring.
[0102] Conclusion 5: If there are four corner points in the ring arranged in a clockwise or counterclockwise order, the current ring can form a rectangle, and the remaining points in the ring except these four points can be completely determined.
[0103] like Fig. 9As shown, if there are the following states in the ring and the four points are arranged clockwise or counterclockwise: a[1,2]! = -1, b[2,3]! = -1, c[0,3]! = -1, d[0,1]! = -1, where a[1,2]! = -1 means that both the 1st and 2nd positions of point a have neighbors, b[2,3]! = -1 means that both the 2nd and 3rd positions of point b have neighbors, c[0,3]! = -1 means that both the 0th and 3rd positions of point c have neighbors, and d[0,1]! = -1 means that both the 0th and 1st positions of point d have neighbors; position 0 refers to the top (north) of the plane graph, position 1 refers to the right (east) of the plane graph, position 2 refers to the bottom (south) of the plane graph, and position 3 refers to the left (west) of the plane graph. Therefore, it can be inferred that a is the upper left corner of the rectangle, b is the upper right corner of the rectangle, c is the lower right corner of the rectangle, and d is the lower left corner of the rectangle. Arrange the ring in a clockwise direction, and it can be determined that the state of the point between a and b is [m, h, -1, q], the state of the point between b and c is [q, m, h, -1], the state of the point between c and d is [-1, q, m, h], and the state of the point between d and a is [h, -1, q, m], where q is the previous point of the current point, h is the next point of the current point, and m is the neighboring point of the current point outside the ring. The information of q, h, and m is included in the ring and topological relationship. The next point is the next point of the current point in the clockwise direction, and the previous point is the next point of the current point in the counterclockwise direction. After the four corner points of the rectangle are determined, the state of the point on the line between the two corner points can be determined, because the state of the edge is determined.
[0104] The four corner points in the topology map determine whether the ring meets the rectangular condition. If four corner points are found, a closed quadrilateral is formed, and all points in the ring except the corner points can be oriented. At the same time, since the ring orientation has the highest credibility, setting the redirection property for it can correct the previous error.
[0105] Based on the above analysis, the present invention can orient the divisible topological graph according to the above conclusions, and the process is as follows: Figure 6 As shown, the specific process is as follows:
[0106] 1) Search for an orientable quadrilateral and assign a value.
[0107] An orientable quadrilateral is a four-vertex ring whose directions of four sides can be determined. The direction of a four-vertex ring is simple to determine (see Conclusion 1), requires fewer conditions, and can determine multiple attributes of multiple points at the same time. This process is to use Conclusions 1-5 to orient the quadrilateral and obtain an orientated graph.
[0108] 2) Search for a point with a degree of freedom of 1 and assign a value. If the point is found, return to step 1), otherwise go to step 3).
[0109] A point with a degree of freedom of 1 means that both of its neighboring points have been determined and only one neighboring point is undetermined. At this time, return to step 1) to determine the undetermined neighboring points until all the undetermined neighboring points of the points with a degree of freedom of 1 are determined. There is no point with a degree of freedom of 1 in the topological graph.
[0110] 3) Search for a point with a degree of freedom of 2) and assign a value. If the point is found, return to step 1), otherwise go to step 4).
[0111] A point with a degree of freedom of 2 means that one neighboring point of the point has been determined, and there are still two neighboring points that have not been determined. At this time, we return to step 1) and determine the remaining two neighboring points based on conclusions 1-5, so that their degree of freedom is 0.
[0112] 4) Search for an orientable ring and assign a value. If a point is found, return to step 1), otherwise the algorithm ends. The search is based on the fact that there are four corner points in the ring.
[0113] According to the five conclusions summarized, the present invention can orient the separable topological graph, determine the data of each point in the graph, make the degree of freedom of each point in the graph 0, and obtain the corresponding oriented graph.
[0114] 4. Relax and align the obtained oriented graph, determine the coordinates of each point in the oriented graph, and obtain a rectangular segmentation graph.
[0115] After obtaining the directed graph, it is necessary to determine the coordinates of each point in the directed graph to obtain a rectangular partitioning graph. A rectangular partitioning graph is a rectangular layout with coordinate attributes, and it is necessary to assign coordinate values to each point. The basic requirements of a rectangular partitioning graph are that each internal ring is a rectangle and there are no duplicate edges inside the layout. According to the above requirements, the upper left corner point (0, 0) is used as the starting point, and the initial value (0, 0) is assigned to the remaining points. The minimum distance between two points is set to 1, and the global layout is obtained by using the coordinate relationship of adjacent points and the same horizontal (vertical) coordinates of the common edges.
[0116] Assume that the x-axis and y-axis coordinate values of the current target point w are xw and yw respectively, xleft and yleft are the x-axis and y-axis coordinate values of the point l on the left side of the target point w, xup and yup are the x-axis and y-axis coordinate values of the point u on the upper side of the target point w, xnew and ynew are the x-axis and y-axis coordinate values of the point w obtained after the relaxation operation, and a is the minimum interval between two points specified by the algorithm. For the convenience of calculation, this embodiment sets a to 1. According to the order of assignment operations from left to right and from top to bottom, the coordinates of the target point are affected by the coordinate values of its upper or left neighboring points. According to whether there are neighboring points on the left and upper sides of the target point, the assignment operation of the target point is divided into three cases.
[0117] The first type: Figure 11-aAs shown, the target point w has neighboring points only on the left side but not on the upper side. Then the coordinates of the target point after assignment are xnew = Math.max(xleft+a,xw); ynew = Math.max(yleft,yw).
[0118] The second type: Figure 11-b As shown, the target point w has neighboring points only on the upper side but not on the left side. Then the coordinates of the target point after assignment are xnew = Math.max(xup, xw); ynew = Math.max(yup+a, yw).
[0119] The third type: Figure 11-c As shown, there are neighboring points on the left and above the target point w, so the coordinates of the target point after assignment are xnew = Math.max(xup, xleft+a, xw); ynew = Math.max(yleft, yup+a, yw).
[0120] By judging and assigning values to each target point according to the above process, the coordinates of each point in the graph can be determined, such as Figure 12-b Said, wherein Figure 12-a This is a schematic diagram after the initial value is assigned to the obtained directional graph, in which the initial coordinates of each point are assigned to (0, 0). The points are judged and assigned in the order from the upper left to the lower right, and the results are as follows Figure 12-b As shown. Figure 12-b It can be seen that the coordinates of some points in the assignment results are not aligned. For example, the x-axis coordinates of points b, e and f should be the same, but the z-axis coordinates of these three points are not equal after the assignment, and the rectangular properties of the rectangular partitioning diagram are not taken into account at all. Therefore, the present invention also needs to use an alignment algorithm to make the y (x) axis coordinate values of the horizontal (vertical) common edges the same.
[0121] The implementation principle of the alignment algorithm is as follows: Starting from a certain point, the maximum horizontal path or maximum vertical path composed of continuous points can be obtained by using the orientation relationship between adjacent points, which are the horizontal common edges and vertical common edges of the rectangular segmentation graph respectively. According to the same vertical (horizontal) coordinates of the horizontal (vertical) common edges, the maximum value can be assigned to each column coordinate. Figure 12-b As shown, there are at most five continuous points in the horizontal direction and at most four continuous points in the vertical direction. Since the distance between any two continuous points in the horizontal direction and the vertical direction is 1, for this embodiment, the maximum path in the horizontal direction is 4, and the maximum path in the vertical direction is 3. Based on this, the x-axis coordinates of points c, g, and h, which are located at the farthest end of the x-axis (the largest horizontal path), are all 4. From the perspective of horizontal distribution, points b, e, and f are next to the point with the largest horizontal path, so the x-axis coordinates of these three points are 3. Similarly, the x-axis coordinates of other points can be adjusted. In the same way, the y-axis coordinates of each point can be adjusted. The adjusted coordinates of each point are as follows: Figure 12-c As shown. It can be clearly seen that the ordinates (horizontal) and horizontal (vertical) coordinates of the common sides of the adjusted coordinates of each point are the same, which fully satisfies the rectangular properties of the rectangular partitioning graph.
[0122] The implementation process of the above process is as follows Fig.10 As shown, the steps are summarized as follows:
[0123] 1) First, assign an initial value to each point in the obtained directional graph. In this embodiment, the initial value is set to (0, 0) for the convenience of calculation;
[0124] 2) Starting from the upper left corner, use the relaxation algorithm to assign values to each point from top to bottom and from left to right;
[0125] 3) According to the connection relationship between the points, the horizontal (vertical) common line segment is obtained, that is, the point set with the same vertical (horizontal) coordinate;
[0126] 4) Find the largest horizontal (vertical) coordinate value in the same horizontal (vertical) point set, and assign the value to all points in the set;
[0127] 5) Determine whether there are points with the same coordinates in the layout. If so, execute steps 3) and 5) in sequence.
[0128] Through the above steps 1-4, the present invention can obtain a divisible topological map that satisfies the topological relationship of the rectangular partitioning map based on the original map without generating a PTP map, and can automatically construct the divisible topological map by analyzing and summarizing the abnormal patterns such as repeated edges, breakpoints, triangles, etc. that appear during the construction of the divisible topological map, setting corresponding processing rules; and then iteratively determining the azimuth relationship between points in the map according to the properties of the rectangular partitioning map, and orienting each edge of the divisible topological map, thereby determining the overall layout of the rectangular partitioning map. The method is clear and intuitive and does not require additional calculations.
[0129] Experimental verification
[0130] In order to verify the effectiveness of the present invention, the present invention is analyzed from four aspects: 1) topology extraction, including the addition of corner points; 2) preprocessing process; 3) orientation process; 4) coordinate determination process. Among them, topology extraction is the basis for the correct operation of the present invention. Reasonable corner point positions will make the number of points on the four sides more uniform, which is convenient for orientation operations. The preprocessing process is an important operation to obtain the topological conditions of the separable topological map. Only when the topological conditions of the separable topological map are met, the orientation operation of the rectangular segmentation map can obtain the correct result. The orientation algorithm is the key algorithm for generating a separable topological map. The algorithm is relatively complex and is most likely to make mistakes. The coordinate determination algorithm is relatively stable, and no problems will occur when the orientation is correct.
[0131] The following experiment selects two countries (Germany and the United States) with large differences in the number of objects and topological relationships. In order to ensure the integrity of the rectangle, this experiment discards the areas of these two countries that are separated from the main body of the continent.
[0132] 1) The process of German rectangular segmentation map generation method.
[0133] Germany itself has a small area and the original map is close to a rectangle, e.g. Figure 13-a As shown in the figure, the solid line is the edge information extracted from the original map boundary, and the dotted line is the edge information extracted from the map boundary. Figure 4 The straight line connecting the corner points and the midpoint is called an oriented line segment. The line segment where the corner points are located can be obtained by performing cross multiplication calculations with the outer boundary of the four imaginary lines. In the experiment, it was found that the positions of the four corner points obtained by generating variable line segments according to the map shape are more appropriate. Appropriate corner points can make the points on the four sides evenly distributed; Figure 13-b Among them, 22, 23, 24, and 25 are four corner points, and the number of points between the four corner points is relatively even. Figure 13-b This is the topological map formed after adding corner points to the original map, where 7, 13, and 2 form a triangular problem. After processing the triangular problem, we get Figure 13-c , Figure 13-c To obtain a separable topological map. The separable topological map is processed according to the orientation and assignment algorithm of the present invention, and the obtained rectangular segmentation map is as follows: Figure 13-d As shown. Figure 13-c It can be seen that 22, 23, 24, and 25 are added corner points, and their attributes are known. 0, 1, 2, 3, 4, 5, 6, 7, and 8 are external points, and the orientation attributes of these points are all known. 9, 11, 12, 13, 14, 16, 17, and 18 are points connected to the outer boundary, and at least one orientation attribute is known. 10, 15, 19, 20, and 21 are completely unknown. There is more known information and less unknown information, so the orientation process is smoother.
[0134] 2) The process of the American rectangular segmentation map generation method.
[0135] like Figure 14-a As shown in the figure, this is the original map of the continental United States. The western part of the United States is sparsely populated with fewer provinces, while the eastern part has more provinces. In the process of preprocessing the map, many situations that cannot meet the topological conditions were found, and they were not the situations that have been analyzed. After analysis, it was found that there is a peninsula area in the eastern part of the United States, and there are more provinces in the peninsula part, resulting in some areas having multiple edges as external edges, that is, multiple edges are on the boundary, resulting in serious topological errors. Therefore, this experiment needs to solve this situation during preprocessing. To this end, in order to facilitate subsequent orientation and assignment operations, this experiment deleted the area with multiple external edges. The topological map after deletion is shown below. Figure 14-bAs shown in the figure, if the rate complexity is not considered, the area with multiple external edges can also be segmented so that each face has at most one external edge. After the simplified map data is subjected to topological extraction and preprocessing operations, a segmentable topological map can be obtained. After the orientation operation, it is found that reverse errors occur in the first few steps of the orientation operation, resulting in a large-scale reversal. For this reason, this experiment also requires the orientation of individual points through manual assistance in the initial stage of orientation to ensure the accuracy of the orientation operation.
[0136] From the above experiments, it can be seen that the German map data has fewer points, and the original shape is similar to a rectangle, which basically meets the topological conditions for rectangle segmentation. Therefore, the preprocessing process is relatively simple; at the same time, since the number of points on the outer boundary and the points connected to the outer edge is large, the number of completely uncertain points is small, and it is easy to obtain the orientation result according to the orientation algorithm of the present invention. However, due to the large number of points and irregular shapes of the US data, errors may occur during the preprocessing and orientation process, such as the presence of multiple outer edge areas and the problem of orientation flipping in the early stage of orientation. Therefore, it is necessary to use manual assistance, such as deleting multiple outer edge areas and manually orienting individual points, to improve the accuracy of the method of the present invention.
[0137] Therefore, the present invention is to derive an automatic generation method from a topological map to a rectangular segmentation map based on the property that each area of the rectangular segmentation map is a rectangle, obtain a topological map through the topological relationship of each area in the map, eliminate the three-node ring, pseudo-node and its multiple edge problems in the topological map through a preprocessing method, and obtain a separable topological map that meets the separability conditions; use a directional algorithm to perform directional processing on the obtained separable map, and based on the directional processing result, determine the coordinates of each point through an assignment method, so as to obtain the final rectangular segmentation map. The method is simple to implement, does not require additional calculations, can automatically and quickly obtain the corresponding rectangular segmentation map, and the obtained rectangular segmentation map can truly and accurately represent the relative position relationship between the various areas in the original map.
Claims
1. A method for constructing a rectangular segmentation graph based on edge orientation, characterized in that: The construction method includes the following steps: 1) Obtaining the original map data of the target area, and extracting a topological map based on the topological relationship between the regions in the original map data; 2) Preprocessing the obtained topological graph using topological constraints to obtain a separable topological graph, wherein the topological constraints are: there is no ring with a degree less than 4 in the topological graph, and the degree of the ring refers to the number of points constituting the ring; 3) Orient each edge in the separable topological graph using relative position constraints, so that each minimum ring forming area in the separable topological graph is a rectangle, and obtain an oriented graph; 4) Determine the coordinate value of each point according to the connection status of each point in the directed graph, so that each ring in the rectangular partition graph is a rectangle and there are no duplicate edges inside the layout; The specific implementation process of step 3) is as follows: a. Assign attributes to each point, and the assigned attributes are used to characterize the connection of the point in four directions; b. Determine all attributes of points on the outer boundary of the separable topology map and individual attributes of points connected to the outer boundary according to the obtained separable topology map; c. Determine the attributes of all points in the separable topological map using the directional conditions to ensure that the degree of freedom of all points other than the four corner points is 0, where the degree of a point refers to the number of neighboring points of the point, and the degree of freedom of a point refers to the number of neighboring points that has not been determined. In the separable topological map, the degree of each point except the four corner points is 3, and the degree of freedom is 0; the directional conditions are determined based on the property that each ring in the directional map is a rectangle; The step 4) includes using a relaxation algorithm to determine the preliminary coordinates of each point in the oriented graph and using an alignment algorithm to adjust the preliminary coordinates; The implementation process of the relaxation algorithm is as follows: Assign the same initial value to each point in the directed graph, set the minimum distance between two points, take the upper left corner of the directed graph as the starting point, and set the coordinates of the point equal to the initial value; Starting from the starting point, the distribution of neighboring points of each point in the oriented graph is determined in order from left to right and from top to bottom, so as to assign and update the coordinates of each point: Take any point as the target point, and determine whether there are neighboring points on the left and above the target point. If there are neighboring points on the left but not on the above, the abscissa of the target point after the assignment is the abscissa of the left neighbor plus the minimum distance and the larger value of the abscissa of the target point before the assignment, and the ordinate is the ordinate of the left neighbor plus the minimum distance and the larger value of the ordinate of the target point before the assignment; if there are neighboring points on the above but not on the left, the abscissa of the target point after the assignment is the abscissa of the upper neighbor plus the minimum distance and the larger value of the abscissa of the target point before the assignment, and the ordinate is the ordinate of the upper neighbor plus the minimum distance and the larger value of the ordinate of the target point before the assignment; if there are neighboring points on both the left and above, the abscissa of the target point after the assignment is the maximum value of the abscissa of the left neighbor plus the minimum distance, the abscissa of the upper neighbor, and the abscissa of the target point before the assignment, and the ordinate is the maximum value of the ordinate of the left neighbor, the ordinate of the upper neighbor plus the minimum distance, and the ordinate of the target point before the assignment; The implementation process of the alignment algorithm is as follows: Starting from any point in the oriented graph, the azimuth relationship between adjacent points is used to determine the maximum horizontal path and the maximum vertical path composed of continuous points, which are used as the horizontal common edges and vertical common edges of the rectangular partition graph respectively. The coordinate values of each point are adjusted according to the principle that the ordinates of the horizontal common edges are equal and the abscissas of the vertical common edges are equal.
2. The method for constructing a rectangular segmentation graph based on edge orientation according to claim 1, characterized in that: The targeting conditions include: A. If the properties of two adjacent sides of a quadrilateral are determined, then the properties of the four sides in the quadrilateral are also determined; B. If the connection relationship between two adjacent points inside the quadrilateral is determined, and one of the points has a definite relationship with its adjacent point outside the quadrilateral, then the attributes of the four sides of the quadrilateral are determined; C. If a point with a degree of freedom of 1 has two selectable directions, and the current selection of the directional attribute makes a ring in the splittable topology graph a rectangle, then the connection orientation of the current point is correct; D. When a point with a degree of freedom of 1 has two relative positions to choose from, the direction of the ring is determined according to the attributes of other points on the ring; E. If there are four corner points in the ring arranged in a clockwise or counterclockwise order, the current ring is a rectangle and the attributes of each point in the ring are determined.
3. The method for constructing a rectangular segmentation graph based on edge orientation according to claim 1, characterized in that: The preprocessing in step 2) includes adding corner points, correcting breakpoints, correcting triangular rings and correcting repeated edges.
4. The method for constructing a rectangular segmentation graph based on edge orientation according to claim 1, characterized in that: In the step 1), if there are areas in the original map data with two or more external edges, the areas with two or more external edges are deleted before topological map extraction; or the areas with two or more external edges are segmented so that the segmented areas have only one external edge.
Citation Information
Patent Citations
Quadrangle segmentation method applied to finite element analysis
CN107085865A
Content-sensitive virtual path redirection method
CN113205606A