Method for identifying closed loops to be merged in OSM urban road data

By converting OSM urban road data into graph data and using a breadth-first algorithm to identify the connection paths between breakpoints, the problem of low efficiency in closed loop identification and repair in OSM road data is solved, and more efficient processing of redundant information on road data is achieved. , reducing mechanical labor time.

CN118779394AActive Publication Date: 2024-10-15NANJING SOUTHEAST UNIV URBAN PLANNING & DESIGN INST CO LTD +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410925304.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-15
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

When processing OSM urban road data, the existing technology is difficult to efficiently identify and repair closed loops, resulting in low efficiency in processing redundant road data and relying on manual processing, which consumes a lot of mechanical labor time.

Method used

By converting OSM urban road data into graph data, the angle between any two polylines on a node is calculated, the polylines to be merged are identified, the breadth-first algorithm is used to identify the connection path between breakpoints, and the circle of the shortest polygon to which the connection path belongs is calculated. According to the shape ratio, the polylines that can be used to repair the loop are selected, and finally the closed loop formed by the combination of polylines to be merged is output.

Benefits of technology

It improves the work efficiency of closed loop identification and repair in OSM road data, reduces mechanical labor time, improves the accuracy of road data construction graph data structure, and solves the problem of incomplete loops in the processing of redundant information in road data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779394A_ABST
    Figure CN118779394A_ABST
Patent Text Reader

Abstract

The invention discloses a method for identifying a to-be-merged closed loop in OSM urban road data. The method comprises the following steps: converting OSM urban road data in a specified area range into graph data; identifying the polylines to be combined by calculating the included angle of any two polylines on the node; calculating the number of the multi-segment lines intersected by all nodes on the to-be-combined multi-segment lines so as to identify breakpoints; identifying a connection path between the breakpoints by using a breadth-first algorithm; calculating the roundness rate of the shortest polygon to which the connection path belongs, so as to screen polylines for repairing the loop; adding the available polylines into the to-be-combined polyline combination; for the repeatedly appearing available polylines, checking whether the nodes of all polylines in the same group have breakpoints or not again; and outputting a combination of all connection paths on the closed loop. According to the method, the problem of road section missing caused by the fact that all lanes cannot be accurately recognized when all lanes in the same road section in the OSM road data are merged can be solved, the efficiency of applying the OSM road data to urban road network morphological feature research is improved, and a large amount of mechanical labor time is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of urban planning, and in particular relates to a method for identifying closed loops to be merged in OSM urban road data. Background Art

[0002] As urbanization enters a transformation phase, research on urban spatial structure, development trends, and element flow patterns will help solve increasingly complex urban problems. Accurate, complete, and concise road network data is the basis for urban and rural transportation network analysis, urban and rural transportation planning, and other applications. Currently, the widely used open map data such as OpenStreetMap (OSM) provides a new way to obtain real-time updated and widely covered road data.

[0003] The current OSM road data uses the method of grouping roads by road name, and usually collects and stores lanes as the basic spatial entity. Each lane is regarded as an independent line segment and carries lane-level attribute information. However, OSM road data often has the problem of missing road name information, and this problem often exists in elements such as ramps, right-turn lanes, viaducts, tunnels, etc. in the road section. If researchers group and package all lanes in the same road section only based on road names, it will lead to the loss of original road data information.

[0004] Therefore, when simplifying OSM road data to study the configuration characteristics of urban road networks, researchers must start from the perspective of the data itself and identify the topological relationship between nodes (intersections) and polylines (lanes) in the road data to ensure that all lanes in the same section are packaged into one information group; at the same time, redundant information such as multi-lane, viaduct, tunnel, ramp, etc. is removed to form a closed loop representing a section. In response to the above problems and needs, existing research methods usually use manual processing of complex sections, which requires a lot of mechanical labor time.

[0005] Technical comparison with patent US20010037176A1 "Method and apparatus for merging multiple roadmap databases"

[0006] Patent US20010037176A1 adopts a method of defining a closed loop from two different road map databases, by identifying the corresponding closed loops in the two databases, and copying the road data in the second database that is included in the closed loop but not represented in the first database to the output road map database, thereby realizing the merging of the two road map databases. The present invention adopts the method of converting the OSM city road data within the specified area into graph data, identifying the polylines to be merged by calculating the angle between any two polylines on the nodes, and calculating the number of polylines intersecting at all nodes on the polylines to be merged to identify the breakpoints, and then identifying the connection path between the breakpoints by using the breadth-first algorithm, and screening out the polylines that can be used to repair the loop, and finally outputting the closed loop formed by the combination of all the polylines to be merged.

[0007] Patent US20010037176A1 realizes data merging by comparing closed loops in two different road map databases, while the present invention directly starts from OSM road data and identifies candidate polylines that need to be merged to form a closed loop by analyzing the topological relationship of the data itself without referring to other databases. In addition, the present invention also introduces a circularity index to screen the optimal polyline combination for repairing the loop, so as to obtain a more accurate closed loop identification result.

[0008] Technical comparison with patent US6597986B2 "Junction guide device for providing guidance concerning looped branch road"

[0009] Patent US6597986B2 is a vehicle-mounted navigation system that stores road data and multiple intersection diagrams, each of which represents a common pattern of roads bifurcating into loops at intersections. When a vehicle approaches an intersection, the system uses road data to automatically determine whether the guide route bifurcates into a loop at the intersection, and displays the corresponding intersection diagram to help the driver understand the bifurcation direction of the next intersection and whether the guide route bifurcates into a loop. The present invention is a method for offline identification of closed loops to be merged in OSM urban road data, with the purpose of integrating scattered road data into a complete closed loop for applications such as urban road network topology analysis, and is not a vehicle-mounted real-time navigation.

[0010] Patent US6597986B2 stores a predefined schematic diagram of the intersection loop bifurcation pattern, and guides the driver by determining whether the current intersection conforms to a certain pattern. The present invention starts from OSM road data, analyzes the topological relationship of polylines between nodes, automatically discovers potential breakpoints, and uses a graph search algorithm to find possible repair paths, generating a closed loop that meets the circularity requirements. It has stronger adaptability and robustness, and does not rely on predefined templates. Summary of the invention

[0011] The technical problem to be solved by the present invention is to provide a method for identifying closed loops to be merged in OSM urban road data, so as to improve the working efficiency of identifying and repairing closed loops when processing redundant information of OSM road data.

[0012] To achieve the above object, the present invention provides a method for identifying closed loops to be merged in OSM urban road data, comprising the following method steps:

[0013] S1. Convert OSM urban road data within a specified area into map data;

[0014] S2, identifying the polyline to be merged by calculating the angle between any two polylines on the node;

[0015] S3, calculating the number of intersecting polylines of all nodes on the polyline to be merged to identify breakpoints;

[0016] S4, identifying the connection path between the breakpoints using a breadth-first algorithm;

[0017] S5, calculating the circularity of the shortest polygon to which the connection path belongs, so as to screen the polyline for repairing the loop;

[0018] S6, adding the polyline that can be used to repair the loop to the combination of polylines to be merged;

[0019] S7. For the repeated available polylines, check again whether there are breakpoints at the nodes of all polylines in the same group;

[0020] S8. Output all the polyline combinations to be merged.

[0021] Furthermore, in step S1, the OSM urban road data within the specified area is converted into map data, specifically including:

[0022] 1) Download OSM city road data within the specified area, including all paths within the specified area j and node n i data;

[0023] 2) Define graph data G, which is used to describe the topological structure of the urban road network in OSM map data, where G = (N, E), N = (N id ,V N ,F N ), E=(E id ,V E ,F E ), each intersection is regarded as a node n i , all nodes are recorded as a set N, where N = {n1,n2,...,nm}; Each road segment is regarded as a polyline j , all line segments are recorded as the set E, where E = {e1,e2,...,e p}, where N id and E id Indicates the unique number of each node and line segment, used to call its corresponding V N 、F N 、V E 、F E The information in the set V Ni Storage and Node n i All polylines with connected relationships j , denoted as V Ni ={e j1 ,e j2 ,…,e jm}, i≤m; j1, j2≤p; V E Storage and Polylines i All nodes n that have connections j , denoted as V Ei ={n j1 ,n j2 ,…}, i≤p; j1, j2≤m, F represents spatial information, F N Stores the spatial coordinate information of the node, F E Stores the spatial path of a polyline, including the length and coordinates of the midpoint of the path.

[0024] Furthermore, in step S2, the polylines to be merged are identified by calculating the angle between any two polylines on the node, which specifically includes:

[0025] 1) Create an empty dictionary M d and the empty list M s , dictionary M d Used to record all polyline collections Es i Information, List M s Includes all polyline sets E si , M s =[E s1 ,E s2 ,…,E sn ], if the dictionary M d and list M s If it already exists, skip this step;

[0026] 2) Traverse the node set N and extract node n i Number N idi and the associated polyline set V Ni ;

[0027] 3) Traverse the set VNi Any two polylines e ja and e jb All combinations of n i As the starting point, the second inflection point as the end point, establish vectors t1 and t2 respectively, and calculate the angle α between the two ab ;

[0028] 4) Set the radian value threshold α0, if α ab If it is greater than α0, the polyline ej a and ej b Add the polyline set Es to be merged i , Es i ={e ja ,e jb}, after many experiments, considering the model performance and computational cost, α0=0.9 is taken in this method;

[0029] 5) Update dictionary M d and list M s The mapping relationship.

[0030] Further, in step S3, the number of intersecting polylines of all nodes on the polyline to be merged is calculated to identify the breakpoints, which specifically includes:

[0031] 1) Create an empty dictionary N s Used to record the attributes of all nodes in a polyline; create an empty list N b Used to record the breakpoint n found bi , N b =[n b1 ,n b2 ,…,n bk ];

[0032] 2) Traverse the list M' s Each polyline set E to be merged si , traverse the set E si All polylines in e j All nodes n in p , calculation and node n p The total number of intersecting polylines to be merged Q p ;

[0033] 3) Q p Node n less than 2 p Determined as breakpoint n bi , while updating node n p In the dictionary N s and add it to the list N b .

[0034] Furthermore, in step S4, a connection path between breakpoints is identified using a breadth-first algorithm, specifically including:

[0035] 1) Traverse the list N b All breakpoints in n bi , after taking out n bi At the same time from the list N b Delete n bi ;

[0036] 2) Use the breadth-first algorithm to find the number of times n bi As the starting point, we continue to search for the next neighboring point n along the path between nodes in the graph data G. h , until another breakpoint n is found bj or reach a limited number of times;

[0037] 3) All nodes n passed in each path search process h Recorded in set N h , calculate the set of all nodes N h All the corresponding polylines e in the graph data G hi length, and take the shortest polyline e ij .

[0038] Furthermore, in step S5, the circularity of the shortest polygon to which the connection path belongs is calculated to screen the polyline for repairing the loop, which specifically includes:

[0039] 1) Traverse all polylines e ij , find the polyline e in the graph data G ij The closed polygon P with the shortest perimeter ij

[0040] 2) Calculate polygon P ij The area S ij and perimeter C ij , then calculate the polygon P ij The circularity r ij , circularity r ij The calculation formula is as follows:

[0041]

[0042] 3) If the circularity r ij is less than r0, then the polyline e ij Can be used to fix breakpoints bi , the polyline e ij The corresponding node set N ij Add to list N p In, N p =[N 11,N 12 ,…,N kl (I < k, j < l, k < l). After multiple experiments, considering the model performance and computational cost, r0 = 0.2 is taken in this method;

[0043] 4) Update point n bi In dictionary N s and list N b to obtain the updated dictionary N' s and list N' b .

[0044] Furthermore, in step S6, the poly-lines available for repairing the loop are added to the poly-line combination to be merged, specifically including:

[0045] 1) Traverse all sets N p in list N ij , and find all poly-lines e ij corresponding to set N pi in the graph data G, and add the set E pj of these poly-lines e pj to set Es i ;

[0046] 2) Traverse all poly-lines e pj in set E pi . If the poly-line e pi is in dictionary M d , it means that a recorded poly-line is found, and then update the mapping of set Es i in list M s ;

[0047] 3) Traverse all poly-lines e i in set Es j . If the poly-line e j is not in dictionary M d , then update the value of e d in dictionary M j to the index value t s of set Es i in list M i ; If the poly-line e j is in dictionary M d , and its value in dictionary M d is not the index value t s of set Es i in list M i , it means that there is another set E s in list M' sj , e j ∈E sj , then add set Esj Set to empty and update polyline e at the same time j In the dictionary M d The value in is the index value t i .

[0048] Compared with the prior art, the present invention has the following advantages:

[0049] The method for identifying and repairing closed loops to be merged in OSM road data adopted by the present invention can make up for the problem of incomplete loops in the method of grouping roads by road names in OSM road data, and specifically includes: with the help of a readable program in a computer storage medium, a large number of closed loops to be merged in OSM city road data within a specified range can be identified and repaired, thereby improving the accuracy of constructing a graph data structure using OSM road data, improving the work efficiency of identifying and repairing closed loops when processing redundant information of OSM road data, and saving a lot of mechanical labor time. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flow chart of the method of the present invention;

[0051] Figure 2 It is a schematic diagram of the scope of embodiments of the present invention;

[0052] Figure 3 This is the schematic diagram of step 2;

[0053] Figure 4 This is the schematic diagram of step 3;

[0054] Figure 5(a) and Figure 5(b) are the calculation results of node n in step 4. qj Distance to starting point D j Schematic diagram of

[0055] FIG6(a) and FIG6(b) are schematic diagrams of searching for the next node step by step and recording relevant information in step 4;

[0056] FIG. 7( a ) and FIG. 7( b ) are schematic diagrams of searching for paths between breakpoints using a breadth-first algorithm in step 4;

[0057] Figure 8 This is the schematic diagram of step 5;

[0058] Figure 9(a) and Figure 9(b) are the polyline e in step 6. pi In the dictionary M d In the middle, set E si Schematic diagram of the treatment method;

[0059] Fig.10 is the polyline e in step 6.5 j In the dictionary M d The value in is not in the list Ms Middle Collection Es i The index value t i When the dictionary M is updated d and list M s Schematic diagram of the correlation mapping;

[0060] Fig.11 After step 8 is completed, list M' s The result of displaying all polylines contained in the GIS software. DETAILED DESCRIPTION

[0061] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. It should be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the accompanying drawings, and the words "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.

[0062] The present invention is described by taking a city road network as an example. The map of the area in OpenStreetMap is as follows: Figure 2 The present invention provides a method for identifying closed loops to be merged in OSM urban road data, the process of which is as follows: Figure 1 As shown, the specific steps include:

[0063] Step 1: Convert the city OSM urban road data into graph data: Download the OSM urban road data within the city, including path and node information. i The information is stored in the polyline set E, and all nodes n within the specified area are i , add the newly created node set N, thereby creating a graph data G.

[0064] In step 1, the graph data G can reflect the topological relationship between intersections, roads, and intersections in the road data. Where G = (N, E), N = (N id ,V N ,F N ), E=(E id ,V E ,F E ). Consider each intersection as a node n i , all nodes are recorded as a set N, where N = {n1,n2,...,n m}; Each road segment is regarded as a line segment e j , all polylines are recorded as a set E, where E = {e1,e2,...,e p}. Among them, Nid and E id Indicates the unique number of each node and line segment, used to call its corresponding V N 、F N 、V E 、F E Information in. Set V N Storage and Node n i All polylines with connected relationships j , which can be expressed as V N ={e j1 ,e j2 ,…,e jm}(i≤m;j1,j2≤p);V E Storage and Polylines i All nodes n that have connections j , which can be expressed as V E ={n j1 ,n j2 ,…}(i≤p; j1, j2≤m). F represents spatial information, F N Stores the spatial coordinate information of the node, F E Stores the spatial path of a polyline, including the length, coordinates of the midpoints of the path, etc.

[0065] Step 2.1, create an empty dictionary M d and the empty list M s , dictionary M d Used to record all the polyline sets to be merged E si Information, List M s Includes all polyline sets E si , M s =[E s1 ,E s2 ,…,E sn ].

[0066] Step 2.2, traverse the node set N and extract node n i Number N idi and the associated polyline set V Ni ;

[0067] Step 2.3, traverse the set V Ni Any two polylines e ja and e jb All combinations of n i As the starting point, the second inflection point as the end point, establish vectors t1 and t2 respectively, and calculate the angle α between them ab , if α abIf it is greater than α0, go to step 2.4, otherwise go to step 2.8. After many experiments, considering the model performance and computational cost, this method takes α0 = 0.9.

[0068] Step 2.4, polyline e ja and e jb Add the polyline set Es to be merged i , Es i ={e ja ,e jb}, determine the polyline e ja and e jb Is it in dictionary M d Middle: If the polyline e ja and e jb All in the dictionary d , then go to step 2.5; if the polyline e ja In the dictionary M d In the polyline e jb Not in dictionary M d or polyline jb In the dictionary M d In the polyline e ja Not in dictionary M d , then go to step 2.6; if the polyline e ja and e jb Not in the dictionary d If yes, go to step 2.7;

[0069] Step 2.5, calculate list M s The number of elements O s , list M s Medium Polyline ja and e jb The corresponding set E si Add to ListM s at the end of the list M s Medium Polyline ja and e jb Set the original collection where the is located to empty, and then traverse the collection E si All polylines in e si , the polyline e si In the dictionary M d The value in is set to 0 s ;

[0070] Step 2.6, in the dictionary M d Create a new line segment e that is not in the dictionary jb The key is assigned to the dictionary M d Zhonge ja The value of polyline e ja Add polylinejb In the list M s The corresponding set E sjb middle;

[0071] Step 2.7, calculate list M s The number of elements O s , in the dictionary M d Create a new polyline in ja and polyline e jb The keys are assigned values ​​of O s , and at the same time set E si Add to list M s middle;

[0072] In this embodiment, it is assumed that a For polyline 74, e b For polyline 104, e c For polyline 73, e d For polyline 103, let n a For node 102, n b For node 103, n c For node 123, go to step 2.2; n a Respectively with the polyline e a and e b connected, such as Figure 3 As shown. Go to step 2.3; Go to step 2.3; Select polyline e a With polyline e b , polyline e a The second vertex of is vertex 10203, and the polyline e b The second inflection point is inflection point 10223; with node n a As the starting point, the turning point 10203 as the end point, establish the vector t a , and then take node n a As the starting point, the turning point 10223 is the end point, and the vector t is established. b , calculate the vector t a and vector t b The angle radian value α ab , α ab is 1.0, α ab >α0, go to step 2.4; add the polyline e a and e b Add the polyline set Es1 to be merged, Es1 = {e a ,e b}; Polyline e a and e b Not in dictionary d , go to step 2.7; List M s The number of elements is 0; in the dictionary Md Create a new polyline in a and polyline e b and assign them 0 respectively; at the same time, add the set Es1 to the list M s At this time, M s =[{e a ,e b}], go to step 2.8.

[0073] Step 2.8, determine the set V Ni Any two polylines e ja and e jb Check whether all combinations of have been traversed. If so, go to step 3; otherwise, return to step 2.3.

[0074] Step 3: Calculate the number of intersecting polylines at all nodes on the polyline to be merged to identify the breakpoints: traverse all sets Es i All polylines in e j All nodes associated with n p , the number of intersecting polylines Q p Node n less than 2 p Determined as breakpoint n bi ;

[0075] Step 3.1, create an empty dictionary N s Used to record the attributes of all nodes in a polyline; create an empty list N b Used to record the breakpoint n found bi , N b =[n b1 ,n b2 ,…,n bk ];

[0076] In step 3.1, the dictionary N s Used to record all nodes n in the polyline p The properties of node n i The number in set N, the set of polylines intersecting the node, and the state attributes of the node; List N b Used to record the breakpoint n found bi , N b =[n b1 ,n b2 ,…,n bk ];

[0077] Step 3.2, traverse the list M s Each polyline set E to be merged si , traverse the set E si All polylines in e j All nodes n in p, calculation and node n p The total number of intersecting polylines to be merged Q p ;

[0078] Step 3.3: Q p Node n less than 2 p Determined as breakpoint n bi , while updating node n p In the dictionary N s and add it to the list N b .

[0079] Step 3.4: Determine the set E si Have all the multi-segment lines been traversed? If so, go to step 4.1; otherwise, return to step 3.2.

[0080] In this embodiment, the polyline e a For polyline 74, e b For polyline 104, e f For polyline 242, e g For polyline 75, set point n a is point 102, n b For point 103, Figure 4 Go to step 3.2 and set E s1 The polyline e in a For example, e a The associated node is n a 、n b , where, with node n a The intersecting polylines have e a and e b , e a and e b In the collection E s1 So it will be with node n a The total number of intersecting polylines to be merged Q a Recorded as 2; similarly, with node n b Intersecting polylines have polylines e a 、Polyline g and polyline e f ; only polyline e a In the collection E s1 So it will be with node n b The total number of intersecting polylines to be merged Q b Record as 1; go to step 3.3; Q b <2, so node n b Determined as a breakpoint, in dictionary N s Where n is the node b Create a new "links" key and assign it to node n bThe set of all the short lines to be merged {e a}, create a new "status" key and assign it the value "breaknd", and at the same time change node n b Add the number to the list N b ; In addition, in the dictionary N s Where n is the node a Create a new "links" key and assign it to node n a The set of all the short lines to be merged {e a ,e b}, and create a new "status" key and assign it to "normalnd"; finally, the updated dictionary N is obtained s and list N b , go to step 3.4;

[0081] Step 4: Use an incremental breadth-first algorithm to identify potential connection paths between adjacent breakpoints: traverse each breakpoint n bi , use the incremental breadth-first algorithm to find the breakpoint n in the graph data G bi To other adjacent breakpoints n bj The shortest polyline e ij .

[0082] Breadth First Search (BFS), also known as Breadth First Search, is a blind search method that aims to systematically expand and check all nodes in the graph to find the result. Given a graph G = (N, E) and a starting vertex n0, the BFS algorithm systematically explores the edges of G to "discover" all vertices that n0 can reach, and calculates the distance from n0 to all these vertices (the minimum number of edges passed). The algorithm can also generate a breadth-first tree with root n0 and all reachable vertices. For any vertex n reachable from n0, i , from n0 to n in the breadth-first tree i The path corresponds to the path from n0 to n in graph G. i The shortest path, that is, the path with the minimum number of edges 0i .

[0083] Step 4.1, traverse the list N b All breakpoints in n bi , after taking out n bi At the same time from the list N b Delete n bi ;

[0084] Step 4.2, use the breadth-first algorithm to select n biAs the starting point, we continue to search for the next neighboring point n along the path between nodes in the graph data G. h , until another breakpoint n is found bj Or the limited number of times is reached, the specific process of step 4.2 includes:

[0085] Step 4.2.1: Traverse the list N b All breakpoints in n bi , go to step 4.2.2;

[0086] Step 4.2.2: Set breakpoint n bi Join the queue Q, and define the initial node level I = 0. The new node found is higher than the previous node level, and go to step 4.2.3;

[0087] Step 4.2.3: Create dictionary N f Used to record all nodes n found qi The previous point n qi ', distance to the starting point D i and node level I i , set breakpoint n bi The previous point n q0 The information is set to empty, the distance D1 to the starting point is set to 0, and the node level is I i Set it to 0 and go to step 4.2.4.

[0088] Step 4.2.4: Determine the current node to be processed n qi Is it empty? If yes, go to step 4.2.5; if no, go to step 4.2.6;

[0089] Step 4.2.5: Take the head node from queue Q and set it as the current node to be processed n qi , and n qi Add to the processed node set N bo , go to step 4.2.9;

[0090] Step 4.2.6: Determine the current node level I i Is it less than the upper limit of search times I0 (default search times limit I0 = 15), if yes, go to step 4.2.7; if no, go to step 4.2.8;

[0091] Step 4.2.7: Take the first node from the queue Q and set it as the current node to be processed n qk , search for all nodes n in the graph data G qj , node n qj With the current node n qi Connected, and not all pending polylines e ji For the corresponding general nodes, go to step 4.2.9;

[0092] Step 4.2.8: Take the first node from queue Q and set it as the current node to be processed n qi , search for all nodes n in the graph data G qj , node n qj With the current node n qi Connected, and not all pending polylines e ji For the corresponding general nodes, go to step 4.3.1;

[0093] Step S4.2.9: Traverse all neighboring nodes n qj , find the neighboring node n in the graph data G qj With node n qi The connecting path polyline e qij , go to step 4.2.10;

[0094] In this embodiment, it is assumed that point n a is point 102, n b is point 103, point n d is point 104, point n e For point 93, let polyline e f For polyline 242, let polyline e g For polyline 75, point n b As the breakpoint, point n b Join queue Q and go to step 4.2.3; in dictionary N f The middle point is n b Create a key and set the value to describe point n b The information set includes the key "prev", the key "distance" and the key "step"; set the value of "prev" to be empty, the value of "distance" to be 0, and the value of "step" to be 0, and go to step 4.2.4; because the current node to be processed is n q1 Is empty, go to step 4.2.5; take the head node n from queue Q b , set as the current processing node, and set n b Add to the processed node set N bo , then go to step 4.2.9; click n b The number of neighboring nodes that meet the restriction requirements is n e and point n d , point n d With point n b The connection path is a polyline e g , point n e With point n b The connection path is a polyline e f , proceed to step 4.2.10.

[0095] In another embodiment, let n c is point 123, point n f is point 105, set point n i For point 121, let point n h is point 122, point n f is the starting point, passing through points 130, 131, 171, 93, 92, 91, 90, 101, 102, 112, 113, 114, 123, 122, 121, and the current processing point is point n i , go to step 4.2.6; click n i In the dictionary N f The value of the key "step" in the corresponding set is 15, which is equal to I0, indicating that a complete path connecting the two breakpoints cannot be found within the limit number of times, and then go to step 4.2.8; take the first node n from the queue Q y , set as the current node to be processed, search for the current node n in the graph data G h All adjacent nodes connected to get point n i and point n c , go to step 4.3.1;

[0096] Step 4.2.10: Traverse all adjacent nodes n qj , computing node n qj Distance to starting point D j , D j Equal to polyline e qij The length and D i The sum of , go to step 4.2.11;

[0097] In this embodiment, it is assumed that point n a is point 102, point n d is point 104, point n f is point 105, point n g is point 131, point n o For point 130, let polyline e a For polyline 74, e g For polyline 75, polyline e p For polyline 205, e o For polyline 221, e n For polyline 220, when n b is the starting point, and point n f When it is the current processing point, as shown in Figure 5(a), go to step 4.2.10; the points previously traversed are point n b 、Point n d 、Point n g and point n o , calculate n f To the starting point na The distance D d , D d For polyline e a 、e g 、e p 、e o 、e n The sum of the lengths of d =699m, go to step 4.2.11.

[0098] Step 4.2.11: Determine neighboring node n qj Is it in the processed node set N bo If yes, go to step 4.2.14; if no, go to step 4.2.12;

[0099] Step 4.2.12: In dictionary N f Update neighboring node n qj Related information: Update neighboring node n qj The previous level node is the current node n qi , the distance to the starting point is D j , node level I j =I i +1, and then node n qj Add to the processed node set N bo , go to step 4.2.13;

[0100] Step 4.2.13: Determine neighboring node n qj Is it in list N b If so, then node n qj Join the newly created set N end ; If not, the neighboring node n qj Join queue Q; go to step 4.2.15;

[0101] In this embodiment, it is assumed that point n b is point 103, point n d is point 104, point n f is point 105, point n g is point 131, point n o For point 130, let polyline e a For polyline 74, e g For polyline 75, polyline e p For polyline 205, e o For polyline 221, e n For polyline 220, when n b is the starting point, and the current processing node is point n o , as shown in Figure 6(a), proceed to step 4.2.11; n oNot in set N bo , go to step 4.2.12; in dictionary N f Create node n in o The information collection includes the key "prev", the key "distance" and the key "step"; update the value of the key "prev" to node n g ; Update the value of the key "distance" to 580m; Update the value of the key "step" to 3, and move node n o Add to the processed node set N bo , go to step 4.2.13; node n o Not in list N b Therefore, node n o Join queue Q and go to step 4.2.15;

[0102] In another embodiment, when n b is the starting point, and the current processing node is point n f , as shown in Figure 6(b), go to step 4.2.11; n f Not in set N bo , go to step 4.2.12; in dictionary N f Create node n in f The information collection includes the key "prev", the key "distance" and the key "step"; update the value of the key "prev" to node n o ; Update the value of the key "distance" to 699m; Update the value of the key "step" to 4, and move node n f Add to the processed node set N bo , go to step 4.2.13; node n f In list N b Therefore, node n f Add to collection N end , go to step 4.2.15;

[0103] Step 4.2.14: Compare the distance D calculated this time j 'With dictionary N f D recorded in j , if D j ' is smaller, then in dictionary N f Update neighboring node n qj The previous level node is the current node n qi , the distance to the starting point is D j , node level I j =I i +1, go to step 4.2.15; if D j ' is larger, go directly to step 4.2.15;

[0104] In another embodiment, let n b is point 103, point n d is point 104, point n f Assume that the polyline e is point 105. a For polyline 74, e g For polyline 75, polyline e h For polyline 76, when n b is the starting point, and the current processing node is point n f , from point n b To point n f Pass through point n d 、n f , as shown in Figure 5(b), go to step 4.2.10; node n f To the starting point n b The distance is the polyline e h Length, D f '=529m, go to step 4.2.11; node n f In the set N bo , go to step 4.2.14; compare D f ' and dot n f In the dictionary N f The value of the middle key "distance" is D f , D f =699m, D f '<D f , so in dictionary N f Update point n f The key "prev" in the corresponding collection is the current node n d , update the value of the key "distance" to 529m; update the value of the key "step" to 2, and go to step 4.2.15.

[0105] Step 4.2.15: Determine the current processing point n qi All neighboring nodes n qj Have all the traversals been completed? If yes, go to step 4.2.16; if not, return to step 4.2.10;

[0106] Step 4.2.16: Determine whether the queue Q is empty. If so, proceed to step 4.3.1; if not, return to step 4.2.4;

[0107] In this embodiment, it is assumed that point n b is point 103, point n c is point 123, point n d is point 104, point n f is point 105, point n his point 122, point n i is point 121, point n j is point 120, point n f and point n j In list N b As shown in Figure 7(a); in step 4.2, the breadth-first algorithm is used to select the points n respectively. b and point n c Start and search outward until you find breakpoint n f and breakpoint n j , and add them to the set N respectively end , get the set N end ={nf,nj}; During the search process, through the loop from step 4.2.4 to step 4.2.16, all potential connection paths from the currently analyzed breakpoint to another breakpoint are found, and the shortest path between the two breakpoints is obtained by comparing the distance from the path to the starting point, and the order of path search is recorded by recording the previous node of each node and the search level of each node. b To point n f , the connection path passes through point n in sequence d 、Point n f ; From point n c To point n j , the connection path passes through point n in sequence h 、Point n i and point n j ; Finally, all the nodes with analysis in queue Q are analyzed, and the results are shown in Figure 7(b), and then go to step 4.3.1.

[0108] Step 4.3: All nodes n passed in each path search process h Recorded in set N h , calculate the set of all nodes N h All the corresponding polylines e in the graph data G hi length, and take the shortest polyline e ij , specifically including the following steps:

[0109] Step 4.3.1, traverse the set N end All breakpoints in n bj , create an empty list N h Used to store all nodes on a path. Let the current node to be processed be n. bj , go to step 4.3.2;

[0110] Step 4.3.2, in list N h Add node n bj , then set the current node to n bj The previous point,

[0111] Step 4.3.3, repeat step 4.3.2 until n bj The previous point is empty, and the connection node n is obtained. bi and n bj All nodes n passed h List N h , go to step 5.1;

[0112] In this embodiment, the polyline e a For polyline 74, polyline e b For polyline 104, node n b is node 103, node n c For node 123, node n d is node 104, node n h is node 122, and the current polyline to be merged is polyline e a and e b , set N end Includes node n f and node n j , let the current node to be processed be n j , go to step 4.3.2, first in list N h Add point n j , then set the current node to point n j The previous point n i , point n i Add to list N h ; Set the current node to point n j The previous point n i , point n i Add to list N h ; Set the current node to point n i The previous point n h , point n h Add to list N h ; Set the current node to point n h The previous point n c , point n c Add to list N h ; Because point n c The previous point is empty, so stop the loop and get list N h For [n j ,n i ,n h ,n c ] and go to step 5.1.

[0113] Step 5, by calculating the circularity of the shortest closed polygon to which the potential connection path belongs, screen the polylines that can be used to repair the closed loop: Search for polylines e in the graph data Gij The closed polygon P with the shortest perimeter ij , if the polygon P ij Circularity rate r ij is less than r0, then the polyline e ij passing through all the nodes n j in the set N ij is added to the list N p .

[0114] In step 5, calculating the circularity rate of the shortest closed polygon to which the potential connection path belongs specifically includes: converting the node path represented by the list N h into a polyline e ij , finding in the graph data G the closed polygon P ij with the shortest perimeter that contains the polyline e ij , and calculating the circularity rate r ij of the polygon P ij . The circularity rate refers to the ratio of 4Π times the area of a polygon to the square of its perimeter. The closer the circularity rate r ij is to 1, the closer the polygon is to a circle. The calculation formula for the circularity rate r

[0115]

[0116] where S ij is the area of the polygon P ij , and C ij is the perimeter of the polygon P ij ;

[0117] If the circularity rate r ij is less than r0, then the polyline e ij can be used to repair the break point n bi , and the set N ij of nodes corresponding to the polyline e ij is added to the list N p , where N p = [N 11 , N 12 , …, N kl (I < k, j < l, k < l). After multiple experiments, considering the model performance and computational cost, r0 = 0.2 is taken in this method;

[0118] In step 5, its specific steps include:

[0119] Step 5.1, finding in the graph data G the polyline e h that connects all the nodes in the list N ij , and proceeding to step 5.2;

[0120] Step 5.2, finding in the graph data G the closed polygon that contains the polyline e ijand the closed polygon P with the shortest perimeter ij , go to step 5.3;

[0121] Step 5.3, calculate the area S ij and perimeter C ij of the polygon P ij , and then calculate the circularity rate r ij of the polygon P ij . The calculation formula of the circularity rate r ij is as follows:

[0122]

[0123] Go to step 5.4;

[0124] Step 5.4, if the circularity rate r ij is less than r0, the polyline e ij can be used to repair the breakpoint n bi . Add the node set N ij corresponding to the polyline e ij to the list N p . N p = [N 11 , N 12 , …, N kl (I < k, j < l, k < l). After multiple experiments, considering the model performance and operation cost, r0 = 0.2 is taken in this method. After the calculation, go to step 5.5;

[0125] Step 5.5, update the mapping of the point n bi in the dictionary N s and the list N b to obtain the updated dictionary N’ s and the list N’ b , go to step 5.5;

[0126] Step 5.6, determine whether all breakpoints n end in the set N bj have been traversed. If so, go to step 6.1; if not, return to step 4.3.1;

[0127] In this embodiment, let the polyline e a be the polyline 74, the polyline e b be the polyline 104, the node n b be the node 103, the node n c be the node 123, the node n d be the node 104, the node n f be the node 105, the node n h be the node 122, the node n i be the node 121, the node nj is node 120, and the current polyline to be merged is polyline e a and e b , let the polyline e h For polyline 105, e m For polyline 106, e j For polyline 107, set N end Includes node n f and node n j ,like Figure 8 As shown, go to step 5.1; N h =[n j ,n i ,n h ,n c ], and its corresponding polyline in the graph data G is polyline e h 、e m and e j , go to step 5.2; let the polyline e h 、e m and e j The merged polyline is e z , polyline e z The corresponding closed polygon with the shortest perimeter in the graph data G passes through nodes 123, 122, 121, 120, 106, 105, 104, 103, 102, and 123. Let this polygon be P a , go to step 5.3; polygon P a The perimeter C pa The area is 1102m2 and the area is S pa is 8357㎡; calculate polygon P a The circularity r a , r a =0.086, go to step 5.4; r a <r0, so list N h Transformed into set N cj Add to list N p , and get N p =[{n j ,n i ,n h ,n c}] Go to step 5.5; change point n b In the dictionary N s Update the key value of "status" in the corresponding collection to "normalnd" and remove it from the list N b , and proceed to step 5.6.

[0128] Step 6: Add the polylines that can be used to repair the closed loop to the polyline combination to be merged: ijAll corresponding polylines e pi The set E p Add to collectionEs i , specifically including the following steps:

[0129] Step 6.1, traverse the list N p All sets N in ij , find the set N in the graph data G ij All corresponding polylines e pi The set E pj , and the set E pj Add to collectionEs i , go to step 6.2;

[0130] Step 6.2: Traverse the set E pj All polylines in e pi , determine the polyline e pi Is it in dictionary M d If yes, it means that the recorded polyline is found, and go to step 6.3; if no, go directly to step 6.4;

[0131] Step 6.3: Set Es i Updated to Collection Es i With polyline e pi In the list M s The union of the corresponding sets in , go to step 6.4;

[0132] Step 6.4: Traverse the set E si All polylines in e j , determine the polyline e j Is it in dictionary M d If not, update the dictionary M d Zhonge j The value of is list M s Middle Collection Es i The index value t i , go to step 6.6; if yes, go to step 6.5;

[0133] In this embodiment, it is assumed that node n b is node 103, node n c For node 123, node n d is node 104, node n f is node 105, node n h For node 122, node n i For node 121, node n j For node 120, polyline e a For polyline 74, polyline e b For polyline 104, eg For polyline 75, e i For polyline 76, e l For polyline 77, e k is polyline 108, the current polyline to be merged is polyline e a and e b , list N p =[{n j ,n i ,n h ,n c},{n f ,n d ,n b}], set E s1 ={e a ,e b}, which is in list M s The index value t1 in the list M is 0, as shown in FIG9(a). s There is a set E s8 ={e k ,e l ,e i ,e g},e g ∈E s8 , as shown in Figure 9(b); go to step 6.1; set {n j ,n i ,n h ,n c}The corresponding path in the graph data G is the polyline e j 、e m and e h , the set {n f ,n d ,n b}The corresponding path in the graph data G is the polyline e g and e i ; Polyline e j 、e m 、e h 、e g and e i Add to collection E s1 , E s1 ={e a ,e b ,e j ,e m ,e h ,e g ,e i}, go to step 6.2; with polyline e g For example, the polyline e g In the dictionary M d , go to step 6.3; polyline eg In the list M s The corresponding set in is set E s8 , so the set E s1 Update to set E s1 With set E s8 The union of s1 ={e a ,e b ,e j ,e g ,e i ,e k ,e l}, as a result, go to step 6.4; for the polyline e g , polyline e g In the dictionary M d , go to step 6.5;

[0134] Step 6.5: Determine the polyline e j In the dictionary M d Is the value in the list M s Middle Collection Es i The index value t i , if not, then the list M s There exists another set E in sj , and e j ∈E sj , so the set E sj Set to empty and update polyline e at the same time j In the dictionary M d The value in is the index value t i , go to step 6.6; if yes, go directly to step 6.6.

[0135] In another embodiment, let the polyline e a For polyline 74, polyline e b is polyline 104, polyline e g For polyline 75, polyline e i For polyline 76, polyline e h For polyline 105, polyline e m is polyline 106, polyline e j For polyline 107, polyline e k is polyline 108, polyline e l For polyline 77, polyline e n For polyline 220, polyline e o For polyline 221, polyline e p For polyline 205, list N p =[{n j ,n i ,nh ,n c},{n f ,n d ,n b}], set E s8 ={e o ,e n ,e i ,e p}, which is in list M s Index value t8=7 in polyline e i In the dictionary M d The value in is 7, such as Fig.10 As shown; go to step 6.5, in the list M s There is a set E s1 ={e a ,e b ,e j ,e m ,e h ,e g ,e i ,e k ,e l},e i ∈E s1 , E s1 In the list M s The index value in t1=0, e i In the dictionary M d The value in is not equal to t1. At this time, the set E s8 Set to empty and set the polyline e i In the dictionary M d The update in is 0, and go to step 6.6;

[0136] Step 6.6: Determine the set E pj All polylines in e pi Is the traversal completed? If yes, go to step 7; if not, return to step 6.2;

[0137] Step 7: For the repeated available polylines, check again whether there are breakpoints at the nodes of all polylines in the same group: p All sets N in ij After the traversal is completed, if the d The polyline e in pi , then you need to check the set E according to the method described in step 3 si Whether there are breakpoints in all nodes corresponding to all polylines in , and get the updated dictionary N s ' and list N b '.

[0138] In another embodiment, let nc is point 123, point n f is point 105, point n j is point 120, polyline e a For polyline 74, polyline e b is polyline 104, polyline e g For polyline 75, polyline e i For polyline 76, polyline e h For polyline 105, polyline e m is polyline 106, polyline e j For polyline 107, polyline e k is polyline 108, polyline e l For polyline 77, set E s1 ={e b ,e a ,e g ,e i ,e l ,e k},like Fig.10 As shown, go to step 7; in this embodiment, in step 6.2, find the dictionary M d The polyline e in g , then check the set E according to the method described in step 3 s1 Whether there is a breakpoint in all nodes corresponding to all polylines in , find the breakpoint n c and breakpoint n j , then we get the updated dictionary N s and list N b , go to step 8;

[0139] Step 8, repeat steps 3 to 7 until all sets E si All have been traversed, and the list M' is obtained s and dictionary M' d .

[0140] In this embodiment, after the above steps, a list M' containing all the closed loops to be merged can be obtained. s and contains all the polylines to be merged in the list M' s The dictionary M' of the index value of the collection to which it belongs d , list M' s All polylines contained in the GIS software are displayed and can be obtained Fig.11 The result is shown by the red polyline.

[0141] It should be noted that the above content merely illustrates the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.

Claims

1. A method for identifying closed loops to be merged in OSM urban road data, characterized by: The method comprises the following steps: S1. Convert OSM urban road data within the specified area into map data; S2, identifying the polyline to be merged by calculating the angle between any two polylines on the node; S3, calculating the number of intersecting polylines of all nodes on the polyline to be merged to identify breakpoints; S4, identifying the connection path between the breakpoints using a breadth-first algorithm; S5, calculating the circularity of the shortest polygon to which the connection path belongs, so as to screen the polyline for repairing the loop; S6. adding the polyline that can be used to repair the loop to the combination of polylines to be merged; S7. For the repeated available polylines, check again whether there are breakpoints at the nodes of all polylines in the same group; S8. Output all the polyline combinations to be merged.

2. A method for identifying closed loops to be merged in OSM urban road data according to claim 1, characterized in that: In step S1, the OSM urban road data within the specified area is converted into map data, specifically including: 1) Download OSM city road data within the specified area, including all paths within the specified area j and node n i data; 2) Define graph data G, which is used to describe the topological structure of the urban road network in OSM map data, where G = (N, E), N = (N id ,V N ,F N ), E=(E id ,V E ,F E ), each intersection is regarded as a node n i , all nodes are recorded as a set N, where N = {n1,n2,...,n m }; Each road segment is regarded as a polyline e j , all line segments are recorded as the set E, where E = {e1,e2,...,e p }, where N id and E id Indicates the unique number of each node and line segment, used to call its corresponding V N 、F N 、V E 、F E The information in the set V Ni Storage and Node n i All polylines with connected relationships j , denoted as V Ni ={e j1 ,e j2 ,…,e jm }, i≤m; j1, j2≤p; V E Storage and Polylines i All nodes n that have connections j , denoted as V Ei ={n j1 ,n j2 ,…}, i≤p; j1, j2≤m, F represents spatial information, F N Storage node spatial coordinate information, F E Stores the spatial path of a polyline, including the length and coordinates of the midpoint of the path.

3. The method for identifying closed loops to be merged in OSM urban road data according to claim 1, characterized in that: In step S2, the polylines to be merged are identified by calculating the angle between any two polylines on the node, which specifically includes: 1) Create an empty dictionary M d and the empty list M s , dictionary M d Used to record all polyline collections Es i Information, List M s Includes all polyline sets E si , M s =[E s1 ,E s2 ,…,E sn ], if the dictionary M d and list M s If it already exists, skip this step; 2) Traverse the node set N and extract node n i Number N idi and the associated polyline set V Ni ; 3) Traverse the set V Ni Any two polylines e ja and e jb All combinations of n i As the starting point, the second inflection point as the end point, establish vectors t1 and t2 respectively, and calculate the angle α between the two ab ; 4) Set the radian value threshold α0, if α ab If it is greater than α0, the polyline ej a and ej b Add the polyline set Es to be merged i , Es i ={e ja ,e jb }, after many experiments, considering the model performance and computational cost, α0=0.9 is taken in this method; 5) Update dictionary M d and list M s The mapping relationship.

4. The method for identifying closed loops to be merged in OSM urban road data according to claim 1, characterized in that: In step S3, the number of intersecting polylines of all nodes on the polyline to be merged is calculated to identify the breakpoints, which specifically includes: 1) Create an empty dictionary N s Used to record the attributes of all nodes in a polyline; create an empty list N b Used to record the breakpoint n found bi , N b =[n b1 ,n b2, …,n bk ]; 2) Traverse the list M ’ s Each polyline set E to be merged si , traverse the set E si All polylines in e j All nodes n in p , calculation and node n p The total number of intersecting polylines to be merged Q p ; 3) Q p Node n less than 2 p Determined as breakpoint n bi , while updating node n p In the dictionary N s and add it to the list N b .

5. The method for identifying closed loops to be merged in OSM urban road data according to claim 1, characterized in that: In step S4, a breadth-first algorithm is used to identify connection paths between breakpoints, specifically including: 1) Traverse the list N b All breakpoints in n bi , after taking out n bi At the same time from the list N b Delete n bi ; 2) Use the breadth-first algorithm to find the number of times n bi As the starting point, we continue to search for the next neighboring point n along the path between nodes in the graph data G. h , until another breakpoint n is found bj or reach a limited number of times; 3) All nodes n passed in each path search process h Recorded in set N h , calculate the set of all nodes N h All the corresponding polylines e in the graph data G hi length, and take the shortest polyline e ij .

6. The method for identifying closed loops to be merged in OSM urban road data according to claim 1, characterized in that: In step S5, the circularity of the shortest polygon to which the connection path belongs is calculated to select the polyline for repairing the loop, which specifically includes: 1) Traverse all polylines e ij , find the polyline e in the graph data G ij The closed polygon P with the shortest perimeter ij 2) Calculate polygon P ij The area S ij and perimeter C ij , then calculate the polygon P ij The circularity r ij , circularity r ij The calculation formula is as follows: 3) If the circularity rate r ij is less than r0, then the polyline e ij can be used to repair the break point n bi , and the node set N ij corresponding to the polyline e ij is added to the list N p , where N p = [N 11 , N 12 , …, N kl (I < k, j < l, k < l). After multiple experiments, considering the model performance and computational cost, r0 = 0.2 is taken in this method; 4) Update point n bi In the dictionary N s and list N b The mapping in gets the updated dictionary N' s and list N' b .

7. The method for identifying closed loops to be merged in OSM urban road data according to claim 1, characterized in that: In step S6, the polyline that can be used to repair the loop is added to the combination of polylines to be merged, which specifically includes: 1) Traverse the list N p All sets N in ij , find the set N in the graph data G ij All corresponding polylines e pi The set E pj , and the set E pj Add to collectionEs i middle; 2) Traverse the set E pj All polylines in e pi , if the polyline e pi In the dictionary M d If the polyline has been found, the set Es is updated. i In the list M s The mapping in 3) Traverse the set Es i All polylines in e j , if the polyline e j Not in dictionary M d Then update the dictionary M d Zhonge j The value of is list M s Middle Collection Es i The index value t i ; If the polyline e j In the dictionary M d and it is in the dictionary M d The value in is not in the list M s Middle Collection Es i The index value t i , then the list M ’ s There exists another set E in sj , e j ∈E sj , then the set E sj Set to empty and update polyline e at the same time j In the dictionary M d The value in is the index value t i .

Citation Information

Patent Citations

  • Junction guide device for providing guidance concerning looped branch road

    US20010037176A1

  • Junction guide device for providing guidance concerning looped branch road

    US6597986B2

  • Method used for evaluating double-shaft linkage performance of numerical control machine and based on rough set

    CN102539132A

  • Method for automatically combining road network intersection nodes in OSM map data

    CN107704531A

  • Semantic map construction method based on vehicle infrastructure collaborative perception system

    CN114882182A