OSM road data simplification method based on same-road multi-lane information identification

By simplifying OSM road data based on the method of identifying multiple lanes on the same road, it solves the problems of topological errors and information loss in the existing technology, achieves more accurate road network simplification and optimization, and is suitable for urban and rural planning and traffic analysis.

CN118747963AActive Publication Date: 2024-10-08SOUTHEAST UNIV +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411031115.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-08
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The existing technology easily introduces topological errors in the process of road data simplification, oversimplifies complex road sections leading to the loss of key topological information, and ignores line segment shape optimization, affecting the topological structure and geometric accuracy of the road network.

Method used

A method based on information identification of multiple lanes on the same road is used to obtain OSM lane data, build a graph data structure, merge lanes with the same name, use depth-first search to find the smallest loop and simplify it, optimize the line segment shape, and retain key topological information.

Benefits of technology

It improves the accuracy and applicability of road networks, ensures topological structure and geometric accuracy, retains topological information of complex roads to the maximum extent, reduces redundant data, and improves analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747963A_ABST
    Figure CN118747963A_ABST
Patent Text Reader

Abstract

The invention relates to an OSM road data simplification method based on same-road multi-lane information identification, and the method comprises the steps: S1, obtaining OSM lane data of a target region, converting the OSM lane data into a graph data structure, and obtaining an information graph; s2, traversing all lanes in the information graph, combining the lanes with the same name into a road, and constructing a sub-graph for each road; s3, for each sub-graph, screening out to-be-deleted nodes and lanes, and deleting the nodes and the lanes to obtain a preliminarily simplified sub-graph; s4, judging whether a preliminarily simplified subgraph with the number of nodes greater than or equal to 2 exists or not, if yes, executing the step S5, and otherwise, executing the step S7; s5, selecting a preliminarily simplified sub-graph with the number of nodes greater than or equal to 2, and searching a minimum loop through a stack-based depth-first search method; s6, judging whether the searched minimum loop is a road area or not, if so, simplifying the minimum loop into a new lane, updating the subgraph, and returning to the step S4; and S7, updating the information graph based on the current sub-graph. Compared with the prior art, the method has the advantages of high accuracy, high adaptability and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a road data simplification method, in particular to an OSM road data simplification method based on identification of multi-lane information on the same road. Background Art

[0002] Currently, crowdsourced geographic information and open map data represented by OpenStreetMap (OSM) are widely used in urban computing. However, open road network data such as OSM are usually collected and stored with lanes as the basic spatial entity. Each lane is regarded as an independent line segment and carries lane-level attribute information, which is different from the abstract model in urban analysis that uses the centerline of the road to represent the set of lanes on both sides of the road. Directly using open road network data such as OSM may lead to repeated calculations of multi-lane areas such as main roads, elevated roads, and overpasses.

[0003] To meet the needs of urban computing, existing road simplification methods mainly start from the geometric characteristics of roads. One type of method merges similar line segments into one road through algorithms such as clustering and outlier detection; another type of method (such as OSMnx) uses the topological relationship and connectivity between road segments to infer the relationship between line segments by analyzing the structural characteristics of the road network, so as to extract the skeleton structure of complex road networks such as main roads, elevated roads, and overpasses.

[0004] However, existing technologies still face the following problems and challenges in adapting to the needs of urban and rural planning:

[0005] 1. Focusing on geometric features, ignoring road functions and topological properties, and easily introducing topological errors: Existing methods are difficult to accurately identify and process line segments of different lanes on the same road. They may mistakenly merge line segments of different roads during simplification, introduce topological errors, destroy the topological structure of the road network, and affect the accuracy of subsequent analysis;

[0006] 2. Oversimplification of complex road sections leads to loss of key topological information and distortion of network structure: Existing methods (such as OSMnx) often merge multiple adjacent intersections into one node when dealing with complex intersections, ignoring the connection relationship and turning restrictions between intersections, resulting in distortion of the simplified road network and failure to accurately depict the actual road structure;

[0007] 3. Ignoring the optimization of the shape of the merged line segments: Existing methods often ignore the optimization of the shape of the merged road segments, resulting in large deviations in the geometric shape of the simplified results, affecting the geometric accuracy of the road network. Summary of the invention

[0008] The purpose of the present invention is to provide an OSM road data simplification method based on the identification of multi-lane information on the same road.

[0009] The purpose of the present invention can be achieved by the following technical solutions:

[0010] A method for simplifying OSM road data based on identification of multiple lanes on the same road, comprising:

[0011] Step S1: Obtain OSM lane data of the target area and convert it into a graph data structure to obtain an information graph;

[0012] Step S2: traverse all lanes in the information graph, merge lanes with the same name into one road, and for each road, extract all nodes connected to it from the information graph and construct a subgraph;

[0013] Step S3: for each subgraph, according to the preconfigured first rule, the nodes and lanes to be deleted are screened out, and after the deletion, a preliminarily simplified subgraph is obtained;

[0014] Step S4: Determine whether there is a preliminarily simplified subgraph with the number of nodes greater than or equal to 2. If yes, execute step S5; otherwise, execute step S7.

[0015] Step S5: Select a preliminarily simplified subgraph with the number of nodes greater than or equal to 2, and find the minimum cycle by a stack-based depth-first search method;

[0016] Step S6: determine the minimum loop and judge whether the minimum loop found is a road area. If yes, simplify the minimum loop into a new lane, update the subgraph, and return to step S4;

[0017] Step S7: Update the information graph based on the current sub-graph.

[0018] The step S1 comprises:

[0019] Step S1-1: Obtain OSM lane data of the target area;

[0020] Step S1-2: Obtain the intersection points of all lanes based on the OSM lane data of the target area, and merge the intersection points of different lanes corresponding to the same road to obtain nodes;

[0021] Step S1-3: storing information of each node and lanes connected to each node, and storing information of each lane and nodes connected to each lane.

[0022] The processing of a single sub-graph in step S3 includes:

[0023] Step S3-1: traverse all lanes in the subgraph, and select all lanes connected to only one node as lanes to be deleted;

[0024] Step S3-2: All nodes connected to the lane to be deleted are regarded as nodes to be deleted;

[0025] Step S3-3: Delete all lanes and nodes to be deleted to obtain a preliminarily simplified subgraph.

[0026] The method of finding the minimum loop by using a stack-based depth-first search method includes:

[0027] Step S5-1: Constructing the node access record graph R i , used to record the access status and loop length of the node;

[0028] Step S5-2: Create loop storage list C i , used to store all the loops found;

[0029] Step S5-3: In the subgraph, select the node n with the largest number of connections best As a starting point, create an empty stack S i , n best Push it into the stack and access the record graph R at the node i Mark node n best Has been visited;

[0030] Step S5-4: When stack S i If it is not empty, take the top node n of the stack top , find all its i The adjacent nodes n marked as unvisited in next , stored in the adjacent node set N next middle;

[0031] Step S5-5: Traverse N next Each adjacent node n in next , when the adjacent node n next Not in stack S i or equal to the top node n top , and stack S i If the node is unvisited, then n next Push onto stack S i , in stack S i Mark n next Has been visited and updated n next In stack S i Otherwise, proceed to step 8;

[0032] Step S5-6: When the adjacent node n next Equal to the top node n top , and stack S i If the length is greater than or equal to 2, it means a loop is formed, and the loop c is obtained. i ={n top,...,N next}; Otherwise, continue to execute step S5-5 and traverse the next adjacent node;

[0033] Step S5-7: For the current stack S i , according to the following situations:

[0034] If the stack S i The length of is equal to 3, and there are multiple repeated line segments between the first node and the second node in the stack, then the current ring c i and its total path length are added to the loop storage list C i , continue to execute step S5-8;

[0035] If the stack S i The length of is equal to 3, and there is only one edge between the first node and the second node in the stack, then continue to execute step S5-8;

[0036] If the stack S i If the length of the ring is greater than 3, the current ring c i and its total path length are added to the loop storage list C i , continue to execute step S5-8;

[0037] Step S5-8: Add the top node n to the stack top From stack S i Pop up and reset the node access record graph R i The status and loop length of all adjacent nodes of the node;

[0038] Step S5-9 repeats steps S5-4 to S5-8 until the stack S i Is empty, the depth-first search ends;

[0039] Step S5-10: Store list C in loop i In the example, the cycle with the least number of nodes is selected as the minimum cycle of the subgraph.

[0040] The step of determining the minimum loop and judging whether the found minimum loop is a road area includes:

[0041] Step S6-1-1: Store list C for loop i Each loop c i , calculate loop c i The circularity r i , the circularity calculation formula is:

[0042]

[0043] Among them, S i is the total area of ​​the loop enclosed area, L i is the total length of the loop;

[0044] If the circularity r i is less than r0, then the loop c i If the conditions are met, keep the loop in list C i middle;

[0045] If the circularity r i is greater than or equal to r0, then the loop c i If the conditions are not met, remove the list from list C i Delete it and continue to traverse other loops in the list;

[0046] Step S6-1-2: Store list C in loop i In , the cycle with the least number of nodes is selected as the minimum cycle of the subgraph;

[0047] The minimum loop is simplified into a new lane, including:

[0048] Step S6-2-1: Find the two largest turning nodes n of the minimum loop s and n e , respectively along the node n s To node n e , and along the e To node n s The vector direction traverses all loop nodes and obtains two node sequences R L and R S ;

[0049] Step S6-2-2: For the node sequence R L All nodes on the node sequence R S Find the nearest node and get the midpoint of the two points as the waypoint;

[0050] Step S6-2-3: Connect all the waypoints to obtain a new lane, and replace the minimum loop with the new lane and waypoints.

[0051] The two largest turning nodes n of the minimum loop are found s and n e ,for:

[0052] For each node in the minimum switch, calculate the angle between the adjacent line segments before and after it, and determine the two nodes with the largest angle as the maximum turning node n s and n e .

[0053] In step S6-2-1, the node sequence with the larger length is used as the node sequence R L , another node sequence as the node sequence R S .

[0054] The step S6-2-2 specifically includes:

[0055] Step S6-2-2-1: For the node sequence R S As a benchmark, traverse the node sequence R L Each node n in j ;

[0056] Step S6-2-2-2: In node sequence R S Find the distance n in j The nearest node n k , n j and n k The midpoint of is taken as the waypoint;

[0057] Step S6-2-2-3: Determine the node sequence R S There is a skipped node n in skip , if yes, then determine the skipped node n skip Is it a waypoint? If yes, execute step S6-2-2-4. Otherwise, find node n. skip In the node sequence R L The nearest point in the middle is calculated as the passing point.

[0058] Step S6-2-2-4: Determine whether the node sequence R is completed L Traverse all nodes in , if yes, then all the passing points are sorted according to their node sequence R L The waypoint sequence is obtained by sorting in order, otherwise, return to step S6-2-2-2 to continue traversing.

[0059] The step S6-2-2 also includes:

[0060] Step S6-2-2-5: For any two adjacent waypoints in the obtained waypoint sequence, calculate the distance between the two:

[0061] If the distance between two adjacent waypoints is less than the threshold β, the two nodes are merged into one waypoint;

[0062] If the distance between two adjacent waypoints is greater than or equal to the threshold β, nodes ql and ql+1 are retained without merging;

[0063] The threshold β is 20 meters.

[0064] Compared with the prior art, the present invention has the following beneficial effects:

[0065] 1. Improved the accuracy and applicability of road network simplification. This application comprehensively utilizes the geometric, topological and functional attribute characteristics of roads, and proposes a novel road similarity measurement method that can accurately identify line segments of different lanes on the same road. Unlike existing methods that mainly focus on geometric features, the similarity measurement method of this application fully considers the functional attributes and topological connectivity of roads, ensuring that the simplification process does not introduce topological errors. At the same time, this application performs geometric optimization on the simplified road network data to improve the geometric accuracy of the simplified results. Therefore, the road network obtained by this application is more accurate in topological structure and geometric shape, and can better meet the needs of urban and rural planning, traffic analysis and other fields;

[0066] 2. The key topological information of complex road structures is retained to the maximum extent. For complex multi-lane areas such as main roads, elevated roads, and overpasses, existing topological extraction methods often adopt overly rough strategies, resulting in the loss of key topological information. This application proposes a special topological extraction and retention strategy, which retains key topological information such as road connectivity and traffic restrictions as much as possible while identifying and simplifying multi-lane information. The simplified road network can accurately reflect the actual road structure and traffic rules, greatly improving its usability and reliability in practical applications;

[0067] 3. Improved the efficiency of road network analysis. By identifying and aggregating line segments of different lanes on the same road, this application significantly reduces redundant data, making the simplified road network data more refined. The computational complexity and time consumption of various network analyses performed on this basis, such as shortest path calculation and accessibility analysis, will also be greatly reduced. Therefore, this application not only further improves the applicability of road network data in the field of urban and rural planning, but also indirectly improves the efficiency of subsequent analysis;

[0068] 4. Simplifies the use and maintenance of road network data. The road network simplification method provided in this application realizes the automated processing from original OSM data to high-quality road networks suitable for specific fields, reducing the workload of manual editing and correction. For data users, the simplified road network retains key information while having a clearer structure and smaller data size, making it easier to understand, process and apply. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 It is a schematic flow chart of the main steps of the method of the present invention;

[0070] Figure 2 This is a schematic diagram of some OSM source data;

[0071] Figure 3 It is a schematic diagram of the relationship between the information graph and the sub-graph;

[0072] Figure 4 Schematic diagram of the subgraph simplification process;

[0073] Figure 5 This is a simplified state diagram of the information graph. DETAILED DESCRIPTION

[0074] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0075] A method for simplifying OSM road data based on identifying multiple lanes on the same road, such as Figure 1 As shown, including:

[0076] Step S1: Obtain OSM lane data of the target area and convert it into a graph data structure to obtain an information graph G, including:

[0077] Step S1-1: Obtain OSM lane data of the target area;

[0078] Step S1-2: Obtain the intersection points of all lanes based on the OSM lane data of the target area, and merge the intersection points of different lanes corresponding to the same road to obtain nodes;

[0079] Step S1-3: storing information of each node and lanes connected to each node, and storing information of each lane and nodes connected to each lane.

[0080] Specifically, the graph data G is defined to describe the topological structure of the urban road network in the OSM 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, and record all nodes as a set N, where n1, n2, ..., n m ∈N; each road segment is regarded as a line segment e, and all line segments are recorded as a set E, where e1, e2, ..., e p ∈E. Among them, N id and E id Indicates the unique code of each node and line segment, which is used to retrieve its corresponding V N 、F N 、V E 、F E V represents the connection relationship of the graph, V NThe connection relationship between storage node n and line segment e can be expressed as n i ={e j1 ,e j2 ,…}(i≤m; j1, j2≤p); V E The connection relationship between the storage segment e and the node n can be expressed as e i ={n j1 ,n j2 ,…}(i≤p; j1, j2≤m). F represents spatial information, F N Storage node spatial coordinate information, F E The spatial path of the stored line segment includes the length, coordinates of the middle point of the path, etc.

[0081] Step S2: traverse all lanes in the information graph, merge lanes with the same name into one road, and for each road, extract all nodes connected to it from the information graph and construct a subgraph;

[0082] Step S3: for each subgraph, the nodes and lanes to be deleted are screened out according to the pre-configured first rule, and a preliminarily simplified subgraph is obtained after deletion. The processing of a single subgraph includes:

[0083] Step S3-1: traverse all lanes in the subgraph, and select all lanes connected to only one node as lanes to be deleted;

[0084] Step S3-2: All nodes connected to the lane to be deleted are regarded as nodes to be deleted;

[0085] Step S3-3: Delete all lanes and nodes to be deleted to obtain a preliminarily simplified subgraph.

[0086] Specifically, in this implementation, the process is as follows:

[0087] First, create an empty dictionary terminal_map to store the mapping relationship between the line segment to be deleted and its associated nodes;

[0088] Then, traverse the subgraph G i All line segments e∈E i , count the line segment e in the subgraph G i The number of nodes n_sub associated in G. If n_sub = 1, that is, segment e is in subgraph G. i If there is only one node associated with it, add the key-value pair (e,n) to terminal_map; otherwise, keep the line segment e;

[0089] After that, traverse each key-value pair (e,n) in terminal_map and find the corresponding key-value pair in subgraph G. iDelete the line segment e and the node n, and update the associated line segment sets of other nodes connected to the line segment e, removing the line segment e from them;

[0090] Finally, repeat the above steps until terminal_map is empty, and obtain the initially simplified subgraph G i ';

[0091] Step S4: Determine whether there is a preliminarily simplified subgraph with the number of nodes greater than or equal to 2. If yes, execute step S5; otherwise, execute step S7.

[0092] Step S5: Select a preliminarily simplified subgraph with the number of nodes greater than or equal to 2, and find the minimum cycle by a stack-based depth-first search method;

[0093] Among them, the minimum loop is found through a stack-based depth-first search method, including:

[0094] Step S5-1: Constructing the node access record graph R i , used to record the access status and loop length of the node;

[0095] Step S5-2: Create loop storage list C i , used to store all the loops found;

[0096] Step S5-3: In the subgraph, select the node n with the largest number of connections best As a starting point, create an empty stack S i , n best Push it into the stack and access the record graph R at the node i Mark node n best Has been visited;

[0097] Step S5-4: When stack S i If it is not empty, take the top node n of the stack top , find all its i The adjacent nodes n marked as unvisited in next , stored in the adjacent node set N next middle;

[0098] Step S5-5: Traverse N next Each adjacent node n in next , when the adjacent node n next Not in stack S i or equal to the top node n top , and stack S i If the node is unvisited, then n next Push onto stack S i , in stack S i Mark n nextHas been visited and updated n next In stack S i Otherwise, proceed to step 8;

[0099] Step S5-6: When the adjacent node n next Equal to the top node n top , and stack S i If the length is greater than or equal to 2, it means a loop is formed, and the loop c is obtained. i ={n top ,...,N next}; Otherwise, continue to execute step S5-5 and traverse the next adjacent node;

[0100] Step S5-7: For the current stack S i , according to the following situations:

[0101] If the stack S i The length of is equal to 3, and there are multiple repeated line segments between the first node and the second node in the stack, then the current ring c i and its total path length are added to the loop storage list C i , continue to execute step S5-8;

[0102] If the stack S i The length of is equal to 3, and there is only one edge between the first node and the second node in the stack, then continue to execute step S5-8;

[0103] If the stack S i If the length of the ring is greater than 3, the current ring c i and its total path length are added to the loop storage list C i , continue to execute step S5-8;

[0104] Step S5-8: Add the top node n to the stack top From stack S i Pop up and reset the node access record graph R i The status and loop length of all adjacent nodes of the node;

[0105] Step S5-9 repeats steps S5-4 to S5-8 until stack S i Is empty, the depth-first search ends;

[0106] Step S5-10: Store list C in loop i In the example, the cycle with the least number of nodes is selected as the minimum cycle of the subgraph.

[0107] Step S6: determine the minimum loop and judge whether the minimum loop found is a road area. If yes, simplify the minimum loop into a new lane, update the subgraph, and return to step S4;

[0108] Determine the minimum loop and judge whether the minimum loop found is a road area, including:

[0109] Step S6-1-1: Store list C for loop i Each loop c i , calculate loop c i The circularity r i , the circularity calculation formula is:

[0110]

[0111] Among them, S i is the total area of ​​the loop enclosed area, L i is the total length of the loop;

[0112] If the circularity r i is less than r0, then the loop c i If the conditions are met, keep the loop in list C i middle;

[0113] If the circularity r i is greater than or equal to r0, then the loop c i If the conditions are not met, remove the list from list C i Delete it and continue to traverse other loops in the list;

[0114] Step S6-1-2: Store list C in loop i In , the cycle with the least number of nodes is selected as the minimum cycle of the subgraph;

[0115] The smallest loop is simplified into a new lane, including:

[0116] Step S6-2-1: Find the two largest turning nodes n of the minimum loop s and n e , respectively along the node n s To node n e , and along the e To node n s The vector direction traverses all loop nodes and obtains two node sequences R L and R S ;

[0117] Specifically, find the two largest turning nodes n of the minimum loop s and n e ,for:

[0118] For each node in the minimum switch, calculate the angle between the adjacent line segments before and after it, and determine the two nodes with the largest angle as the maximum turning node n s and ne .

[0119] In addition, the node sequence with the larger length is taken as the node sequence R L , another node sequence as the node sequence R S .

[0120] Step S6-2-2: For the node sequence R L All nodes on the node sequence R S Find the nearest node and get the midpoint of the two points as the waypoint, including:

[0121] Step S6-2-2-1: For the node sequence R S As a benchmark, traverse the node sequence R L Each node n in j ;

[0122] Step S6-2-2-2: In node sequence R S Find the distance n in j The nearest node n k , n j and n k The midpoint of is taken as the waypoint;

[0123] Step S6-2-2-3: Determine the node sequence R S There is a skipped node n in skip , if yes, then determine the skipped node n skip Is it a waypoint? If yes, execute step S6-2-2-4. Otherwise, find node n. skip In the node sequence R L The nearest point in the middle is calculated as the passing point.

[0124] Step S6-2-2-4: Determine whether the node sequence R is completed L Traverse all nodes in , if yes, then all the passing points are sorted according to their node sequence R L The waypoint sequence is obtained by sorting in order, otherwise, return to step S6-2-2-2 to continue traversing.

[0125] Step S6-2-2-5: For any two adjacent waypoints in the obtained waypoint sequence, calculate the distance between the two:

[0126] If the distance between two adjacent waypoints is less than a threshold value β, the two nodes are merged into one waypoint. In this embodiment, the threshold value β is 20 meters.

[0127] If the distance between two adjacent waypoints is greater than or equal to the threshold β, nodes ql and ql+1 are retained without merging;

[0128] Step S6-2-3: Connect all the waypoints to obtain a new lane, and replace the minimum loop with the new lane and waypoints.

[0129] In particular, in this embodiment, for the new lane L new Each node q on l , check whether it is an atomic graph G i ', if so, then according to V N 、F N 、V E 、F E , transfer the other line segments connected to the original node to the new node at the corresponding position, and update V N 、F N 、V E 、F E 、E i 、N i , complete subgraph G i ″ Update of topological relationships; otherwise, add new nodes and their connection relationships to N i 、V N 、F N and update E i 、V E 、F E , complete subgraph G i Topological relationship update

[0130] Step S7: Update the information graph based on the current sub-graph.

[0131] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. These embodiments are only used to illustrate the present invention and are not intended to limit the protection scope of the present invention.

[0132] The present invention is described by taking Yongda Road (Xiayu Road Section) in Ningbo City, Zhejiang Province as a specific embodiment. The OpenStreetMap (OSM) source data of this area is as follows: Figure 2 The present invention provides an OSM road data optimization method based on the simplification of multi-lane information recognition on the same road, and its process is as follows: Figure 1 As shown, the specific steps include:

[0133] Step (1) Use the OSM map API interface to download the OSM road network data within the specified area. The data content includes the ID of the road segment, the longitude and latitude coordinates of the road node, the road name and other attribute information. Convert the acquired OSM data into a graph data structure G = (N, E), where N is a node set and E is a segment set. In the graph data structure G, each node n∈N contains a unique ID, longitude and latitude coordinates and other spatial information, denoted as n = (nid, n_lon, n_lat); each segment e∈E contains a unique ID, a starting node ID, an ending node ID, and attribute information such as the road name, denoted as e = (eid, nid_start, nid_end, e_name).

[0134] In this embodiment, the OSM road data of the selected area is downloaded and read to generate a graph data structure G, and the intercepted part is shown in Table 1 and Table 2. Among them, the road node table and the line segment table are associated through the node ID (nid), reflecting the topological structure of the graph G.

[0135] Table 1 Partial data of road node table

[0136] Node ID (nid) Longitude (n_lon) Latitude (n_lat) …… …… …… 178 118.7218938 32.0047940 179 118.7217814 32.0046574 180 118.7166109 31.9979554 …… …… ……

[0137] Table 2 Partial data of road segment table

[0138] Segment ID (eid) Starting point ID (nid_start) End point ID (nid_end) Road name (e_name) …… …… …… …… 2315 179 178 Yongda Road 2316 180 179 Yongda Road …… …… …… …… 2823 180 179 Yongda Road …… …… …… …… 31 35 178 180 Yongda Road 3136 178 180 Yongda Road …… …… …… ……

[0139] Step (2) Cut graph G into multiple subgraphs G according to the road names i This step includes the following sub-steps:

[0140] Step (21) traverses all line segments in graph G and, based on the road name label e name, merges the line segments with the same road name into a set E i . Each set E i That is, it represents a complete road, including all lane segments on the road. Get the line segment set of all roads {E1, E2, ..., E n};

[0141] Step (22) for each road set E i , extract the starting points and end points of all line segments, and record the set of these nodes as N i , and the line segment set E i Together they form a subgraph G i =(N i , E i ), which represents the network topology of the road. Finally, the original road network graph G is cut into a set of subgraphs {G1, G2, ..., G n};

[0142] Step (23) For each subgraph, count the number of nodes associated with each line segment. i If the number of nodes associated with the subgraph is 1, the line segment e and its associated nodes are deleted from the subgraph. This process continues until there are no more line segments that meet the above conditions in each subgraph, and the subgraph G after the initial simplification is obtained. i ';

[0143] In this embodiment, all line segments with the road name label e_name being "Yongda Road" are extracted and merged into a set E 永达路 ; Extract the starting and ending points of all line segments of the thoroughfare, and record the set of these nodes as N 永达路 ; The road subgraph G 永达路 The relationship with graph G is as follows Figure 3 As shown; and due to the subgraph G 永达路 There is no line segment in the graph that connects only one node, so the subgraph G 永达路 This is the initially simplified subgraph G 永达路 ', its topological relationship is as follows Figure 4 (a)

[0144] Step (3) uses a stack-based depth-first search (DFS) algorithm to search the simplified subgraph G i 'Perform loop detection and find the minimum loop; simplify the minimum loop into a new line segment, and replace the corresponding loop segment in the original graph G with the new line segment; update the relevant topological relationship of graph G. This step includes sub-steps in sequence:

[0145] Step (31) for each initially simplified subgraph G i ': Build node access record graph R i , used to record the access status and path length of the node; build the loop storage list C i , used to store all the loops found. Select a node set N i The node with the most connections n best As the starting point of DFS, push it into stack S i , and in R i Mark as visited;

[0146] Step (32) When stack Si is not empty, take the top node n top , find its i All adjacent nodes n marked as unvisited next , and exists in the set N next In; traverse N next Each node n in next , if the adjacent node n next Not in stack S i or equal to the top node ntop , and R i If the node is unvisited, then n next Push onto stack S i , in R i Mark n next Has been visited and updated n next In R i Otherwise, directly execute step (35);

[0147] Step (33) When the adjacent node n next Equal to the starting point n best , and stack S i When the length is greater than or equal to 2, it means that a loop c is found i ={n top ,…,n next}, store the loop in list C i , continue to execute step (34); otherwise, return to execute step (32) and continue to traverse N next Other adjacent nodes in

[0148] Step (34) for the current stack S i , if stack S i The length of is equal to 3, and there are multiple repeated line segments between the first node and the second node in the stack, then the current ring c i and its total path length are added to the loop storage list C i , continue to step (35); if stack S i The length of is equal to 3, and there is only one edge between the first node and the second node in the stack, then continue to step (35); if the stack S i If the length of the ring is greater than 3, the current ring c i and its total path length are added to the loop storage list C i , continue to execute step (35);

[0149] Step (35) adds the top node n to the stack top From stack S i Pop up and reset n top In R i The status and loop length of all adjacent nodes in the

[0150] Step (36) Repeat steps (32) to (35) until stack S i is empty, that is, all best All the starting paths have been traversed; the loop storage list C i In the example, select the loop with the least number of nodes as the subgraph G. i 'The minimum loop R min , R min={n best ,n1,…,n k ,n best};

[0151] In this embodiment, when n best n 180 , go to step (31), n 180 As the starting point of DFS, it is pushed into stack S 永达路 In R 永达路 is marked as visited; at this time, stack S 永达路 Not empty, top node n top =n 180 , go to step (32), the adjacent node set N 180_next ={n 178 ,n 179}; Traverse the set N 180_next , node n 178 Not in stack S 永达路 So we will 178 Push onto stack S 永达路 In R 永达路 Mark as visited, update the loop length to 1, and continue searching for node n 178 Adjacent nodes, adjacent node set N 178_next ={n 179 ,n 180}; Traverse the set N 178_next , node n 179 Not in stack S 永达路 So we will 179 Push onto stack S 永达路 In R 永达路 Mark as visited, update the loop length to 2, and continue searching for node n 179 Adjacent nodes, adjacent node set N 179_next ={n 180 ,n 178}; Traverse the set N 179_next , node n 180 =n top , and at this time stack S 永达路 The length is greater than or equal to 2, indicating that a loop c1={n 180 ,n 178 ,n 179 ,n 180}, then execute step (34), at this time stack S 永达路 The length is equal to 3, and the first node n in the stack 180 and the second node n 178 There are multiple repeated line segments between them, so loop c1 and its total path length 2 are added to the loop storage list C 永达路 Then, step (35) is executed to move the top node n180 From stack S 永达路 Pop up and reset n 180 In R 永达路 The states and loop lengths of all adjacent nodes in the loop. By completing step (36), the loop storage list C is obtained. 永达路 The data are shown in Table 3;

[0152] Table 3 Loop storage list C 永达路 data

[0153] Loop ID Nodes in the loop 1 <![CDATA[n 180 ,n 178 ,n 179 ,n 180 ]]> 2 <![CDATA[n 180 ,n 179 ,n 180 ]]> 3 <![CDATA[n 180 ,n 178 ,n 180 ]]>

[0154] Step (4) In the minimum loop R min Find the two largest turning points as the starting and ending points of the loop splitting, split and simplify the loop to obtain new line segments; replace the corresponding loop segments in the original graph G with the new line segments, and update the relevant topological relationships. This step includes the following sub-steps:

[0155] Step (41) stores the loop list C i For each loop in the i , if the circularity r i is less than r0, then the loop c i If the conditions are met, keep the loop in list C i If the circularity r i is greater than or equal to 0.2, then the loop c i If the conditions are not met, remove the list from list C i Delete it and continue to traverse other loops in the list;

[0156] In this embodiment, the loop storage list C 永达路 The circularity of the three loops c1, c2, and c3 are: r1 = 0.08, r2 = 0.06, r3 = 0.09, all of which meet the requirements;

[0157] Step (42) stores list C in the loop i In , the cycle with the least number of nodes is selected as the minimum cycle of the subgraph;

[0158] In this embodiment, loop storage list C is selected 永达路 The loop c1 with the least number of nodes is taken as the minimum loop; Step (43) is for the minimum loop R min Each node n on m , calculate the angle θ between it and the adjacent line segments m (θ m ∈[0,π]), take θ m The two nodes with the largest cosine value determine the maximum turning point, denoted as n s and n e; If there are multiple identical maximum angles, the node with the smaller node ID is taken as the maximum turning point;

[0159] Step (44) for each minimum cycle R min , respectively along n s to n e , along n e to n s The vector direction traverses the loop nodes and obtains the node sequence R1 = {n s , ..., n e} and R2={n e , ..., n s}, and according to the length of the node sequence, the longer and shorter segments of the node sequence are recorded as R L , R S ;

[0160] In this embodiment, the loops c2 and c3 have the same length, and c2 = {n 180 ,n 179 ,n 180} is the minimum loop R min Since the loop has only two nodes (n 180 and n 179 ), the two can be directly recorded as the maximum turning point, that is, n s =n 180 , n e =n 179 ; Enter step (44), respectively along n 180 to n 179 , along n 179 to n 180 The vector direction traverses the loop nodes and obtains the node sequence R1 = {n 180 ,n 179 ,n 180}(through line segment e 2316 ) and R2={n 180 ,n 179 ,n 180}(through line segment e 2823 ); Since the length of the node sequences of R1 and R2 is the same, we can record R L =R1, R S =R2;

[0161] Step (45) For each point p in RL j , in R S Find the distance p j The nearest point pk, p j and p k The midpoint of the new line segment L newq1 on the node, and set the state of q1 to "mid_pt"; in this step, if R S There is a skipped node n in skip (i.e. p k In R S The difference between the index in and the index of the last processed node is greater than 1), and the state of the node is not "mid_pt", then the node n is found skip In R L The nearest point in the middle, calculate the midpoint between the two, and add the midpoint to the new line segment L new and set its status to "mid_pt";

[0162] Step (46) adds the new node q l According to its L The corresponding point p j Add the node sequence Q in the order of new All new node sequences Q = [q1,q2,...,q n ]; if two adjacent nodes q in sequence Q l and q l+1 If the distance is less than 20m, the two nodes are merged into a new node q m , where q m The longitude and latitude coordinates are q l and q l+1 The midpoint coordinates, q m The node ID is q l The node ID of m Replace q in the node sequence l and q l+1 ; Until the distance between all adjacent nodes in the node sequence Q is greater than or equal to 20m, all nodes are connected in sequence according to the order of the nodes in the new node sequence Q to form a simplified new line segment L new ;

[0163] Step (47) adds the new line segment L new Through two maximum turning points n s 、n e , replace subgraph G i 'The corresponding loop in the figure gives the simplified subgraph G i ", and update the corresponding road node table and line segment table data;

[0164] In this embodiment, for R L Point n in 180 、n 179 , R S The points closest to it are n 180 、n 179, that is, the nodes q1 and q2 on the new line segment are respectively connected to the original node n 180 、n 179 Coincidence, q1 = n 180 , q2=n 179 , no new nodes need to be created, and a node sequence Q = [q1, q2] is generated; in the sequence Q, the distance between nodes q1 and q2 is greater than 20m, and there is no need to merge them; according to the order of the nodes in the new node sequence Q, nodes q1 and q2 are connected in sequence to form a simplified new line segment L new_1 ; through two maximum turning points n s 、n e , replace subgraph G 永达路 'The corresponding loop in the figure gives the simplified subgraph G 永达路 ",like Figure 4 (b)

[0165] Step (5) Repeat steps (3) to (4) until there is no subgraph G that meets the conditions. i '(that is, the number of nodes in the subgraph is less than 2), the graph G is updated, and the road graph G' that finally completes the simplification of multi-lane information recognition on the same road is obtained.

[0166] In this embodiment, after executing step (5) once, the loop c3={n 180 ,n 178 ,n 180}, after completing step (45), the simplified subgraph G is obtained 永达路 ",like Figure 4 (c) As shown; when step (5) is repeated, there is only one loop {n 180 ,n 178 ,n 179 ,n 180}, that is, the minimum loop R min ={n 180 ,n 178 ,n 179 ,n 180}, go to step (41), calculate n 178 、n 179 、n 180 The angle between the adjacent line segments before and after is selected, and the angle with the smallest cosine value is selected. 180 and n 178 As the biggest turning point, record n s =n 180 , n e =n 178 ; Enter step (42), respectively along n 180 to n 178 , along n 178 to n 180 The vector direction traverses the loop nodes and obtains the node sequence R1 = {n180 ,n 178 ,n 180}(through line segment e 3135 ) and R2={n 180 ,n 178 ,n 179 ,n 180}(through line segment e 2315 、e 2823 ), and record R L =R2, R S = R1; go to step (43), for R L Node n in 178 、n 179 、n 180 , in R S The points closest to it are n 178 、n 178 、n 180 , that is, the nodes q3 and q5 on the new line segment are respectively connected to the original node n 178 、n 180 Coincidence (q3=n 178 , q5=n 180 ), node q4 is node n 178 With n 179 The midpoint of the node sequence Q = [q3, q4, q5] is generated, and the node positions are as follows Figure 4 As shown in (d); since the distance between adjacent nodes q3 and q4 is less than 20m, the two nodes are merged into a new node q6. The longitude and latitude coordinates of node q6 are the midpoint coordinates of q3 and q4, the node ID of q6 is the node ID of q3, and q6 replaces q3 and q4 in the node sequence, that is, the node sequence Q = [q6, q5], and the node position is as follows Figure 4 (e) As shown in the figure, nodes q6 and q5 are connected in sequence according to the order of nodes in the new node sequence Q to form a simplified new line segment L. new_3 ; through two maximum turning points n s 、n e , replace subgraph G 永达路 'The corresponding loop in the final simplified subgraph G is obtained 永达路 ",like Figure 4 As shown in (f); the same subgraph G is performed on the graph G 永达路 The above simplified process continues until there is no subgraph G that meets the conditions. i '(i.e. the number of nodes in the subgraph is less than 2), and the final simplified road graph G' is obtained for the identification of multiple lanes on the same road, as shown in Figure (5);

[0167] The road network simplification and optimization method proposed in this embodiment makes full use of the geometry, topology, attributes and other information of the road, can accurately identify and merge repeated line segments on the same road, and by optimizing the expansion and reorganization of loops, it can eliminate redundancy while maintaining the original topological structure to the maximum extent. Figure 2 As shown in the figure, the same road is divided into multiple line segments for storage, which is difficult to be directly used for analysis in the field of urban and rural planning. However, after the multi-lane information of the same road is identified and simplified by the method of the present invention, the redundancy of OSM road data is greatly reduced, the topological relationship is clearer, and the geometric shape distortion is small, which can significantly improve the efficiency and quality of subsequent road network analysis.

[0168] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

Claims

1. A method for simplifying OSM road data based on identification of multiple lanes on the same road, characterized in that: include: Step S1: Obtain OSM lane data of the target area and convert it into a graph data structure to obtain an information graph; Step S2: traverse all lanes in the information graph, merge lanes with the same name into one road, and for each road, extract all nodes connected to it from the information graph and construct a subgraph; Step S3: for each subgraph, according to the preconfigured first rule, the nodes and lanes to be deleted are screened out, and after the deletion, a preliminarily simplified subgraph is obtained; Step S4: Determine whether there is a preliminarily simplified subgraph with the number of nodes greater than or equal to 2. If yes, execute step S5; otherwise, execute step S7. Step S5: Select a preliminarily simplified subgraph with the number of nodes greater than or equal to 2, and find the cycle by a stack-based depth-first search method; Step S6: determine the minimum loop and judge whether the minimum loop found is a road area. If yes, simplify the minimum loop into a new lane, update the subgraph, and return to step S4; Step S7: Update the information graph based on the current sub-graph.

2. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 1, characterized in that: The step S1 comprises: Step S1-1: Obtain OSM lane data of the target area; Step S1-2: Obtain the intersection points of all lanes based on the OSM lane data of the target area, and merge the intersection points of different lanes corresponding to the same road to obtain nodes; Step S1-3: storing information of each node and lanes connected to each node, and storing information of each lane and nodes connected to each lane.

3. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 1, characterized in that: The processing of a single sub-graph in step S3 includes: Step S3-1: traverse all lanes in the subgraph, and select all lanes connected to only one node as lanes to be deleted; Step S3-2: All nodes connected to the lane to be deleted are regarded as nodes to be deleted; Step S3-3: Delete all lanes and nodes to be deleted to obtain a preliminarily simplified subgraph.

4. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 1, characterized in that: The method of finding the minimum loop by using a stack-based depth-first search method includes: Step S5-1: Constructing the node access record graph R i , used to record the access status and loop length of the node; Step S5-2: Create loop storage list C i , used to store all the loops found; Step S5-3: In the subgraph, select the node n with the largest number of connections best As a starting point, create an empty stack S i , n best Push it into the stack and access the record graph R at the node i Mark node n best Has been visited; Step S5-4: When stack S i If it is not empty, take the top node n of the stack top , find all its i The adjacent nodes n marked as unvisited in next , stored in the adjacent node set N next middle; Step S5-5: Traverse N next Each adjacent node n in next , when the adjacent node n next Not in stack S i or equal to the top node n top , and stack S i If the node is unvisited, then n next Push onto stack S i , in stack S i Mark n next Has been visited and updated n next In stack S i Otherwise, proceed to step 8; Step S5-6: When the adjacent node n next Equal to the top node n top , and stack S i If the length is greater than or equal to 2, it means a loop is formed, and the loop c is obtained. i ={n top ,...,N next }; Otherwise, continue to execute step S5-5 and traverse the next adjacent node; Step S5-7: For the current stack S i , according to the following situations: If the stack S i The length of is equal to 3, and there are multiple repeated line segments between the first node and the second node in the stack, then the current ring c i and its total path length are added to the loop storage list C i , continue to execute step S5-8; If the stack S i The length of is equal to 3, and there is only one edge between the first node and the second node in the stack, then continue to execute step S5-8; If the stack S i If the length of the ring is greater than 3, the current ring c i and its total path length are added to the loop storage list C i , continue to execute step S5-8; Step S5-8: Add the top node n top From stack S i Pop up and reset the node access record graph R i The status and loop length of all adjacent nodes of the node; Step S5-9 repeats steps S5-4 to S5-8 until the stack S i Is empty, the depth-first search ends; Step S5-10: Output loop storage list C i .

5. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 4, characterized in that: The step of determining the minimum loop and judging whether the found minimum loop is a road area includes: Step S6-1-1: Store list C for loop i Each loop c i , calculate loop c i The circularity r i , the circularity calculation formula is: Among them, S i is the total area of ​​the loop enclosed area, L i is the total length of the loop; If the circularity r i is less than r0, then the loop c i If the conditions are met, keep the loop in list C i middle; If the circularity r i is greater than or equal to r0, then the loop c i If the conditions are not met, remove the list from list C i Delete it and continue to traverse other loops in the list; Step S6-1-2: Store list C in loop i In , the cycle with the least number of nodes is selected as the minimum cycle of the subgraph; The minimum loop is simplified into a new lane, including: Step S6-2-1: Find the two largest turning nodes n of the minimum loop s and n e , respectively along the node n s To node n e , and along the e To node n s The vector direction traverses all loop nodes and obtains two node sequences R L and R S ; Step S6-2-2: For the node sequence R L All nodes on the node sequence R S Find the nearest node and get the midpoint of the two points as the waypoint; Step S6-2-3: Connect all the waypoints to obtain a new lane, and replace the minimum loop with the new lane and waypoints.

6. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 5, characterized in that: The two largest turning nodes n of the minimum loop are found s and n e ,for: For each node in the minimum switch, calculate the angle between the adjacent line segments before and after it, and determine the two nodes with the largest angle as the maximum turning node n s and n e .

7. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 5, characterized in that: In step S6-2-1, the node sequence with the larger length is used as the node sequence R L , another node sequence as the node sequence R S .

8. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 5, characterized in that: The step S6-2-2 specifically includes: Step S6-2-2-1: For the node sequence R S As a benchmark, traverse the node sequence R L Each node n in j ; Step S6-2-2-2: In node sequence R S Find the distance n j The nearest node n k , n j and n k The midpoint of is taken as the waypoint; Step S6-2-2-3: Determine the node sequence R S There is a skipped node n in skip , if yes, then determine the skipped node n skip Is it a waypoint? If yes, execute step S6-2-2-4. Otherwise, find node n. skip In the node sequence R L The nearest point in the middle is calculated as the passing point. Step S6-2-2-4: Determine whether the node sequence R is completed L Traverse all nodes in , if yes, then all the passing points are sorted according to their node sequence R L The waypoint sequence is obtained by sorting in order, otherwise, return to step S6-2-2-2 to continue traversing.

9. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 8, characterized in that: The step S6-2-2 also includes: Step S6-2-2-5: For any two adjacent waypoints in the obtained waypoint sequence, calculate the distance between the two: If the distance between two adjacent waypoints is less than the threshold β, the two nodes are merged into one waypoint; If the distance between two adjacent waypoints is greater than or equal to the threshold β, nodes ql and ql+1 are retained without being merged.

10. The OSM road data simplification method based on identification of multiple lanes on the same road according to claim 8, characterized in that: The threshold β is 20 meters.

Citation Information

Patent Citations

  • Category mapping method of OpenStreetMap and land use data

    CN108595496A

  • Redundancy removal method for high-rise navigation road network based on continuous road chains

    CN110968659A

  • Road network topology optimization method, electronic equipment and storage medium

    CN115829094A

  • System and method for processing vehicle event data for improved point snapping of road segments

    US20230128788A1

  • Energy-efficient hardware-software collaborative method and apparatus for graph processing

    US20230367815A1