Topological relation generation method and device of road network, electronic equipment and storage medium
Through the automated road network topological relationship generation method, the comparison and classification of intersection data and road network data are used to solve the problem of time-consuming and error-prone manual labeling, and efficient and accurate topological relationship construction and maintenance are achieved, which is suitable for navigation and management of complex traffic networks.
Patent Information
- Application Number
- CN202510390516.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the construction and maintenance of topological relationships of road networks are highly dependent on manual annotation, which takes time and is prone to errors, and cannot accurately identify and process complex intersection structures, resulting in limited applicability and reliability in real traffic scenarios.
By obtaining intersection data and road network data of road network, using spatial position matching instructions to generate road signs, and connecting and classifying marked roads, automatically constructing and maintaining topological relationships, and using methods such as intersection coordinates and road coordinate comparison, boundary range judgment and vector angle calculation to realize automated topological relationship generation.
Reducing manual intervention improves the efficiency and accuracy of topological relationship generation, can better reflect the structure and connectivity of the road network, and is suitable for large-scale road network data, and supports efficient driving navigation planning and traffic management.
Smart Images

Figure CN120337463A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of road data processing, and particularly to a method, apparatus, electronic device, and storage medium for generating the topological relationship of a road network. Background Art
[0002] The topological relationship of a road network is a structure that describes the connection relationship and geometric relationship between each road in the road network. It mainly involves the spatial and logical connections between elements such as roads, intersections, and lanes, and helps define driving paths, intersection turns, and road attributes.
[0003] In autonomous driving and intelligent transportation systems, an accurate road network topological relationship is crucial for high-precision navigation. For example, intersections in a traffic road network are often one of the most complex traffic scenarios, and the road topological relationship determines whether a vehicle can turn left, right, or make a U-turn at an intersection.
[0004] In related technologies, the construction and maintenance of the topological relationship of a road network highly rely on manual annotation. However, the manual annotation method not only takes a long time and is error-prone, but also cannot accurately identify and process complex intersection structures, resulting in limitations in its applicability and reliability in real traffic scenarios. Summary of the Invention
[0005] This application provides a method, apparatus, electronic device, and storage medium for generating the topological relationship of a road network to solve or partially solve the problems of how to automatically construct and maintain the topological relationship of a road network and improve the accuracy of the topological relationship.
[0006] The first aspect of this application provides a method for generating the topological relationship of a road network, including: Obtaining intersection data of intersections and road network data of the road network; In response to a spatial position matching instruction, generating a road identifier corresponding to the intersection according to the intersection data and the road network data; Connecting the roads on the road network marked with the road identifier to generate a road connection combination; Classifying the road connection combination to obtain at least one topological relationship.
[0007] In an example, the intersection data includes the intersection coordinates corresponding to each intersection, and the road network data includes the road coordinates corresponding to each target road. The generating a road identifier corresponding to the intersection according to the intersection data and the road network data includes: Comparing the intersection coordinates corresponding to the intersection with the road coordinates corresponding to the target road to determine whether the target road belongs to the road within the intersection; If the target road belongs to the road within the intersection, generate a first identifier corresponding to the intersection; If the target road does not belong to the road within the intersection, generate a second identifier and / or a third identifier corresponding to the intersection.
[0008] In one example, the intersection data further includes a boundary range. Comparing the intersection coordinates corresponding to the intersection with the road coordinates corresponding to the road to determine whether the road belongs to the road within the intersection includes: Traverse the road nodes of each target road on the road network; If the road coordinates of the road node are within the boundary range of the intersection, determine that the road belongs to the road within the intersection; If the road coordinates of the road node are outside the boundary range of the intersection, determine that the road does not belong to the road within the intersection.
[0009] In one example, the road node includes a road start point and a road end point, the road coordinates include the road start point coordinates of the road start point and the road end point coordinates of the road end point, and the intersection coordinates include an intersection start point coordinate and an intersection end point coordinate. Generating the second identifier and / or the third identifier corresponding to the intersection includes: When the road end point coordinates are the same as the intersection start point coordinates, determine that the road belongs to the road entering the intersection and generate the second identifier; and / or, When the road start point coordinates are the same as the intersection end point coordinates, determine that the road belongs to the road exiting the intersection and generate the third identifier.
[0010] In one example, generating a road identifier corresponding to the intersection according to the intersection data and the road network data includes: Compare all target roads in the road network data with the target intersection area in turn to determine whether the target road belongs to the road within the intersection; If the target road belongs to the road within the intersection, generate a first identifier corresponding to the intersection; If the target road does not belong to the road within the intersection, generate a second identifier and / or a third identifier corresponding to the intersection.
[0011] In one example, generating the second identifier and / or the third identifier corresponding to the intersection includes: When the road end point of the target road coincides with the road start point located within the intersection, determine that the road belongs to the road entering the intersection and generate the second identifier; and / or, When the road start point of the target road coincides with the road end point within the intersection, it is determined that the road belongs to the exit intersection road, and the third identifier is generated.
[0012] In one example, the connecting the roads marked with the road identifiers on the road network to generate a road connection combination includes: Respectively determine the connection points of the roads within the intersection, the entering intersection roads, and the exit intersection roads; According to the connection points and a preset connection strategy, combine the roads within the intersection, the entering intersection roads, and the exit intersection roads to generate multiple road connection combinations.
[0013] In one example, the classifying the road connection combination to obtain at least one topological relationship includes: Determine the start vector and the end vector of each road connection combination; Determine the topological relationship by calculating the counterclockwise included angle between the start vector and the end vector.
[0014] In one example, the determining the topological relationship by calculating the counterclockwise included angle between the start vector and the end vector includes: When the counterclockwise included angle between the start vector and the end vector is within the first included angle range, determine that the topological relationship is a right turn direction; When the counterclockwise included angle between the start vector and the end vector is within the second included angle range, determine that the topological relationship is a U-turn direction; When the counterclockwise included angle between the start vector and the end vector is within the third included angle range, determine that the topological relationship is a left turn direction; When the counterclockwise included angle between the start vector and the end vector is within the fourth included angle range, determine that the topological relationship is a straight-ahead direction.
[0015] The second aspect of the present application provides a topological relationship generation device for a road network, including: A data acquisition module, configured to acquire intersection data of an intersection and road network data of the road network; A road identifier generation module, configured to generate a road identifier corresponding to the intersection according to the intersection data and the road network data in response to a spatial position matching instruction; A connection combination generation module, configured to connect the roads marked with the road identifiers on the road network to generate a road connection combination; A topological relationship generation module, configured to classify the road connection combination to obtain at least one topological relationship.
[0016] A third aspect of the present application provides an electronic device, including: a processor; and a memory storing executable code that, when executed by the processor, causes the processor to execute the method as described above.
[0017] A fourth aspect of the present application provides a computer-readable storage medium storing executable code that, when executed by a processor of an electronic device, causes the processor to execute the method as described above.
[0018] The technical solution provided by the present application may include the following beneficial effects: In an embodiment of the present application, intersection data of an intersection and road network data of a road network are obtained. In response to a spatial position matching instruction, a road identifier corresponding to the intersection is generated according to the intersection data and the road network data. The roads marked with the road identifier on the road network are connected to generate a road connection combination, and the road connection combination is classified to obtain at least one topological relationship.
[0019] The technical solution of the present application completes spatial position matching by using intersection data and road network data, accurately identifies the roads connected to the intersection, and automatically outputs the corresponding road identifier. After marking the road identifier in the road network, different roads are connected in an orderly manner according to the type of the road identifier to generate a road connection combination, and then the road connection combination is classified to obtain an accurate topological relationship, thereby realizing the automatic construction and maintenance of the topological relationship of the road network, reducing manual intervention, effectively improving the efficiency and accuracy of generating the topological relationship, and better reflecting the structure and connectivity of the road network.
[0020] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By describing the exemplary embodiments of the present application in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present application will become more obvious, wherein, in the exemplary embodiments of the present application, the same reference numerals generally represent the same components.
[0022] Figure 1 is a flowchart showing a method for generating a topological relationship of a road network according to an embodiment of the present application; Figure 2 is a flowchart showing a method for generating a topological relationship of a road network according to another embodiment of the present application; Figure 3 is a flowchart showing a process of automatically generating a topological relationship of a road network based on a road intersection according to an embodiment of the present application; Figure 4 It is a schematic structural diagram of a topological relationship generation device for a road network shown in an embodiment of the present application; Figure 5 It is a schematic structural diagram of an electronic device shown in an embodiment of the present application. Detailed implementation manners
[0023] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0024] The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0025] It should be understood that although the terms "first", "second", "third", etc. may be used in the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, "a plurality" means two or more unless otherwise specifically defined.
[0026] Currently, the methods in the related art for identifying the topological relationships of complex road intersections such as multi-fork intersections, roundabouts, and weaving intersections have great limitations. For example, the geometric structures and road layouts of multi-fork intersections and roundabouts are often very complex. These intersections not only include multiple entering roads and exiting roads, but also the orientations and connection relationships of different roads are intricate.
[0027] Although traditional recognition algorithms can extract the feature information of multi-fork intersections and roundabouts, during the recognition process, traditional recognition algorithms need to be combined with other algorithms, resulting in a multiple increase in the algorithm complexity, and there may also be problems such as recognition errors and missed recognition.
[0028] In view of the above problems, an embodiment of the present application provides a method for generating a topological relationship of a road network, which can automatically construct and maintain the topological relationship of the road network and improve the accuracy of the topological relationship.
[0029] The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0030] Figure 1 is a schematic flowchart of a method for generating a topological relationship of a road network shown in an embodiment of the present application. Refer to Figure 1 This method at least includes the following steps: Step 101, obtain intersection data of intersections and road network data of the road network.
[0031] In an embodiment of the present application, the intersection data of intersections and the road network data of the road network can be obtained from different data sources.
[0032] Optionally, the intersection data refers to the geometric information and structural layout information of the intersection itself, which at least includes the position data of the intersection, lane distribution, traffic data, and so on.
[0033] As an example, the intersection data can be extracted from data sources such as a GIS (Geographic Information System) platform, remote sensing data, and traffic data.
[0034] Optionally, the road network data refers to a comprehensive description of a road system in a certain area, which at least includes the position data, number, connection relationship between roads, and so on of each road.
[0035] As an example, the road network data can be extracted from data sources such as maps, remote sensing data, and lidar data.
[0036] It should be noted that the intersection data and the road network data can belong to the same data source or different data sources. If the intersection data and the road network data belong to the same data source, it means that the data formats of the two are the same, the processing difficulty is low, and the efficiency of constructing and maintaining the topological relationship is high. If the intersection data and the road network belong to different data sources, it means that the data formats of the two may be different, and then the data formats of the two need to be converted into the same data format before processing. At this time, the data flexibility and scalability are high.
[0037] Step 102, in response to a spatial position matching instruction, generate a road identifier corresponding to the intersection according to the intersection data and the road network data.
[0038] In an embodiment of the present application, when receiving the spatial position matching instruction, a road identifier corresponding to the intersection can be generated according to the intersection data and the road network data.
[0039] Optionally, the spatial location matching instruction refers to an instruction triggered according to user requirements or automatically executed by a program, which can be used to instruct the system to perform spatial matching on the road network and intersections through geographical coordinates or spatial relationships to obtain road identifiers.
[0040] As an example, the triggering mode of the spatial location matching instruction is manual triggering. When the user touches and activates a control or selects an intersection area in the graphical display interface provided by the system, the system can generate a spatial location matching instruction.
[0041] As another example, the triggering mode of the spatial location matching instruction is automatic program triggering. When the system detects new input data, the system can generate a spatial location matching instruction, or a response time interval can be set, and the system generates a spatial location matching instruction regularly according to the response time interval.
[0042] It should be noted that the aforementioned system refers to a system with data storage, data analysis, and data management functions, which can automatically generate topological relationships based on road intersections, and this system can perform spatial location matching operations under different triggering conditions. In actual use, this system can be combined with other control systems, such as combined with a navigation system and an intelligent transportation control system, so as to assist other control systems in smoothly executing relevant tasks.
[0043] Optionally, the road identifier refers to the number or label that identifies a road. The road identifier is unique and can be used to distinguish different roads.
[0044] As an example, the road identifier can be a combined name of Chinese and numbers: Road 1, Road 2, Road 3, etc., and the road identifier can also be a combined name of English and numbers: road_1, road_2, road_3, etc. It can be understood that the name of the road identifier can be set flexibly, and this application does not limit it.
[0045] Step 103: Connect the roads marked with road identifiers on the road network to generate a road connection combination.
[0046] In the embodiment of this application, first mark the road identifier at the corresponding position of the road network, and then connect the roads marked with road identifiers to generate at least one road connection combination.
[0047] Optionally, the road connection combination refers to the possible connection methods and path combinations between different roads. This combination method takes into account the relative relationships, driving directions, and connection conditions of each road in terms of spatial location to describe the possibility of entering one road from another road.
[0048] Step 104: Classify the road connection combinations to obtain at least one topological relationship.
[0049] In the embodiment of the present application, the road connection combinations can be further classified to obtain at least one topological relationship.
[0050] Optionally, the topological relationship refers to the spatial relationships such as connection, proximity, and intersection between different roads in space. In the road network of the present application, the topological relationship is mainly used to describe the spatial connection mode between roads and intersections.
[0051] In the embodiment of the present application, obtain the intersection data of the intersections and the road network data of the road network. In response to the spatial position matching instruction, generate the road identifiers corresponding to the intersections according to the intersection data and the road network data, connect the roads marked with the road identifiers on the road network to generate road connection combinations, classify the road connection combinations, and obtain at least one topological relationship.
[0052] The technical solution of the present application completes the spatial position matching by using the intersection data and the road network data, accurately identifies the roads connected to the intersections, and automatically outputs the corresponding road identifiers. After marking the road identifiers in the road network, the different roads are connected in an orderly manner according to the types of the road identifiers to generate road connection combinations, and then the road connection combinations are classified to obtain accurate topological relationships, thereby realizing the automatic construction and maintenance of the topological relationships of the road network, reducing manual intervention, and effectively improving the efficiency and accuracy of generating topological relationships, and better reflecting the structure and connectivity of the road network.
[0053] Figure 2 It is a schematic flowchart of a method for generating topological relationships of a road network shown in another embodiment of the present application. Figure 2 Relative Figure 1 It describes in more detail the technical solution of the embodiment of the present application. The method may include the following steps: Step 201: Obtain the intersection data of the intersections and the road network data of the road network.
[0054] In the embodiment of the present application, the intersection data includes the intersection coordinates and the boundary range corresponding to each intersection, and the road network data includes the road coordinates corresponding to each target road.
[0055] Among them, the intersection coordinates can be the longitude and latitude coordinates of the center point of the intersection, which are used to represent the spatial position of the intersection and at least include the intersection start coordinates and the intersection end coordinates. The boundary range can be the spatial area of the intersection on the high-precision map.
[0056] In an actual situation, the intersection coordinates can be a set of coordinates representing the polygonal area of the intersection to more accurately reflect its shape and boundary range. For example, several coordinate points around the intersection form a closed polygon and define the coverage area of the intersection, that is, the boundary range of the intersection is determined.
[0057] The road network data often contains a large number of different types of roads, including arterial roads, secondary arterial roads, branch roads, ramps, roundabout roads, and dedicated lanes, etc. These roads together form a complex traffic network. In this application, in order to improve the efficiency of generating the topological relationship of intersections, methods such as spatial range screening and connection relationship screening can be used to screen out the roads near the intersection and mark them as target roads.
[0058] Since each road is composed of a series of nodes, and these nodes form a complete path (such as a broken line or a curve) in sequence, multiple longitude and latitude coordinate points can be used to represent the geometric shape and direction of the road.
[0059] Among them, the road nodes at least include the road start point and the road end point. The road coordinates can be the longitude and latitude coordinates of the target road, which at least include the road start point coordinates of the road start point and the road end point coordinates of the road end point.
[0060] Step 202, in response to the spatial position matching instruction, compare the intersection coordinates corresponding to the intersection with the road coordinates corresponding to the target road, and determine whether the target road belongs to the road within the intersection.
[0061] In the embodiment of this application, when the spatial position matching instruction is triggered, the system will use the intersection coordinates of the intersection and the road coordinates of the road to perform position matching analysis, so as to determine whether the road belongs to the road within the intersection.
[0062] As an example of this application, traverse the road nodes of each road on the road network. If the road coordinates of the road nodes are within the boundary range of the intersection, it is determined that the road belongs to the road within the intersection. If the road coordinates of the road nodes are outside the boundary range of the intersection, it is determined that the road does not belong to the road within the intersection.
[0063] For example, if all the road nodes of the target road are within the boundary range of the intersection, it is considered that the target road completely coincides with the intersection, and this road can be marked as "road within the intersection".
[0064] If some or all of the road nodes of the target road are outside the boundary range of the intersection, it is considered that the target road does not completely coincide with the intersection, and this road can be marked as "road outside the intersection", and further analyze this road.
[0065] In this application, geometric principles can be used to determine whether a road node is within the boundary range. For example, the ray method or the angle method can be used to determine whether a road node is within the polygon area of an intersection. When the longitude and latitude coordinate values of two nodes are exactly the same up to the 8th digit or higher after the decimal point, these two points can be considered to coincide in space. By calculating the spatial position relationship between the road node and the intersection, the system can automatically determine whether the node is within the intersection.
[0066] Step 203: In response to the spatial position matching instruction, sequentially compare all target roads in the road network data with the target intersection area to determine whether the target road belongs to the road within the intersection.
[0067] In an embodiment of this application, when the spatial position matching instruction is triggered, the system can also sequentially compare all target roads in the road network data with the target intersection area to determine whether the target road belongs to the road within the intersection.
[0068] Among them, the target intersection area refers to the geometric boundary area of the intersection, which is composed of boundary points around the intersection and is used to describe the spatial coverage range of the intersection.
[0069] As an example of this application, if the target road is located within the target intersection area, it is determined that the road belongs to the road within the intersection. If part or all of the target road is located outside the target intersection area, it is determined that the road does not belong to the road within the intersection.
[0070] In this application, spatial analysis technology can be used to determine whether the target road is within the target intersection area. For example, the layer of the target road is superimposed with the layer of the target intersection area, and then it is analyzed whether they coincide.
[0071] It should be noted that both Step 202 and Step 203 can be used to determine whether the target road belongs to the road within the intersection. The difference between the two is that the method of Step 202 belongs to coordinate comparison, and the method of Step 203 belongs to graphic comparison. Step 202 is suitable for use when high-precision positioning is required. For example, it is necessary to determine whether some or all road nodes fall within the intersection range, especially in multi-node complex sections or non-regular intersections. Step 203 is suitable for use in large-scale road matching. For example, quickly screen out all target roads that may belong to the intersection and conduct preliminary classification.
[0072] Step 204: If the road belongs to the road within the intersection, generate a first identifier corresponding to the intersection.
[0073] In an embodiment of this application, if the road belongs to the road within the intersection, generate a first identifier corresponding to the intersection.
[0074] Wherein, the first identifier refers to the identifier of the "road within the intersection". If a certain road is marked with the first identifier, it means that the road constitutes the traffic structure inside the intersection, that is, the road belongs to a part of the intersection.
[0075] The system can further analyze information such as traffic flow direction and turning type within the intersection by using the first identifier.
[0076] Step 205, if the road does not belong to the road within the intersection, generate a second identifier and / or a third identifier corresponding to the intersection.
[0077] In the embodiment of the present application, if the end coordinate of the road is the same as the start coordinate of the intersection, it is determined that the road belongs to the road entering the intersection and a second identifier is generated. If the start coordinate of the road is the same as the end coordinate of the intersection, it is determined that the road belongs to the road exiting the intersection and a third identifier is generated. Or, when the end of the target road coincides with the start of the road within the intersection, it is determined that the road belongs to the road entering the intersection and a second identifier is generated. When the start of the target road coincides with the end of the road within the intersection, it is determined that the road belongs to the road exiting the intersection and a third identifier is generated. Wherein, the second identifier refers to the identifier of the "road entering the intersection". If a certain road is marked with the second identifier, it means that the end of the road coincides with the starting point of the intersection. Although the road is not directly connected to the inside of the intersection, it is related to the intersection and is the entrance to the intersection.
[0078] The third identifier refers to the identifier of the "road exiting the intersection". If a certain road is marked with the third identifier, it means that the start of the road coincides with the termination point of the intersection. The road exits from the inside of the intersection and is connected to other roads outside the intersection.
[0079] Distinguishing roads that do not belong to the roads within the intersection (such as roads entering the intersection and roads exiting the intersection) through the second identifier and the third identifier is beneficial for the system to accurately handle the roles and relationships of different types of roads in the intersection and the entire road network, thereby optimizing traffic flow analysis and the construction of road topology.
[0080] Step 206, connect the roads marked with road identifiers on the road network to generate a road connection combination.
[0081] In the embodiment of the present application, by respectively determining the connection points of the roads within the intersection, the roads entering the intersection, and the roads exiting the intersection, and combining the roads within the intersection, the roads entering the intersection, and the roads exiting the intersection according to the connection points and the preset connection strategy, multiple road connection combinations are generated.
[0082] A connection point is a physical location where roads touch or intersect. In a transportation network, these connection points can be the end points of a road, the entry point or the exit point of an intersection. For each road, the system needs to identify its starting point and end point through coordinate data, and then compare these points with the end points or starting points of other roads to find possible connection points.
[0083] The preset connection strategy can be a rule or method for connecting roads together that is set in advance by relevant technical personnel. Generally speaking, the preset connection strategy can be set based on internal and external factors such as traffic rules, road geometry and vehicle flow.
[0084] After respectively determining the connection points of the roads in the intersection, the roads entering the intersection, and the roads exiting the intersection, the roads in the intersection, the roads entering the intersection, and the roads exiting the intersection may be combined using a preset connection strategy to obtain a variety of road connection combinations.
[0085] For example, connect the roads inside the intersection with the roads entering the intersection to form a passable road connection combination, connect the roads inside the intersection with the roads exiting the intersection to form a passable road connection combination, connect the roads entering the intersection, the roads inside the intersection, and the roads exiting the intersection to form a passable road connection combination, etc.
[0086] As an example, assuming that the set of all passable road numbers marked at the intersection is {road1; road2; road3; road4; road5}, it can include road connectivity combination ①: road1-road2-road3, and road connectivity combination ②: road1-road4-road5, indicating that vehicles can pass through in the order of road1, road2, road3, or in the order of road1, road4, road5.
[0087] Step 207: classify the road connectivity combinations to obtain at least one topological relationship.
[0088] In an embodiment of the present application, the starting point vector and the end point vector of each road connectivity combination are first determined, and then the topological relationship is determined by calculating the counterclockwise angle between the starting point vector and the end point vector using a vector angle formula.
[0089] The starting point vector refers to the vector formed from the starting point of the road (outside the intersection or inside the intersection) toward the driving direction of the road. This vector represents the driving direction into the intersection.
[0090] The end point vector is the vector formed from the end point of the road (outside or inside the intersection) to the driving direction of the road. This vector represents the driving direction of exiting the intersection.
[0091] As an example of this application, in the process of determining the topological relationship by calculating the directional angle between the starting vector and the ending vector, there are the following judgment methods: When the counterclockwise directional angle between the starting vector and the ending vector is within the first angle range, determine that the topological relationship is a right-turn direction; When the counterclockwise directional angle between the starting vector and the ending vector is within the second angle range, determine that the topological relationship is a U-turn direction; When the counterclockwise directional angle between the starting vector and the ending vector is within the third angle range, determine that the topological relationship is a left-turn direction; When the counterclockwise directional angle between the starting vector and the ending vector is within the fourth angle range, determine that the topological relationship is a straight-ahead direction.
[0092] Among them, the first angle range can be [215°, 325°], the second angle range can be [125°, 215°], the third angle range can be [55°, 125°], and the fourth angle range can be [325°, 360°] and [0°, 55°].
[0093] As an example, after determining the directional angle, the angles of each connected combination can be distinguished into four topological relationships: straight-ahead, left-turn, right-turn, and U-turn: if 215 <= angle_lane <= 325.0: direction = OutType.turn_right (If the angle is between 215 and 325 degrees, it means that the ending vector is biased to the right relative to the starting vector. Usually, it represents a right-turn situation) elif 125.0 <= angle_lane <= 215.0: direction = OutType.turn_around (If the angle is between 125 and 215 degrees, it means that the ending vector is biased to the rear relative to the starting vector. Usually, it represents a U-turn situation) elif 55 <= angle_lane <= 125.0: direction = OutType.turn_left (If the angle is between 55 and 125 degrees, it means that the ending vector is biased to the left relative to the starting vector. Usually, it represents a left-turn situation) elif 325.0 <= angle_lane or angle_lane <= 55.0: direction = OutType.straight (If the included angle is greater than or equal to 325 degrees, or less than or equal to 55 degrees, it means that the direction of the end vector and the start vector is almost the same or very close. Usually, it represents a straight - going situation) It should be noted that the embodiments of the present application include but are not limited to the above examples. It can be understood that under the guidance of the idea of the embodiments of the present application, those skilled in the art can set according to the actual situation, and the present application does not limit this.
[0094] To enable those skilled in the art to better understand the technical solutions of the embodiments of the present application, the following is an example, and with reference to Figure 3 the flowchart of automatically generating the topological relationship of the road network based on road intersections shown
[0095] S31. Match the spatial positions of the junction (intersection) and the road network. By calculating the node coordinates, determine the road_id of the road network existing within the junction, and label it as the road within the intersection.
[0096] S32. Through coordinate matching, find the data where the end point of the road network (outside the junction range) coincides with the start point of the road network inside the junction, record its road_id, and label the road entering the intersection.
[0097] S33. Through coordinate matching, find the data where the start point of the road network (outside the junction range) coincides with the end point of the road network inside the junction, record its road_id, and label the road exiting the intersection.
[0098] S34. Connect all the roads entering the intersection and the roads exiting the intersection through the roads inside the junction, and record all the connected combinations.
[0099] S35. By differentiating the angles of each connected combination, it is divided into four topological relationships: straight, left - turn, right - turn, and U - turn.
[0100] S36. Judge the connection direction by the counter - clockwise included angle between the start vector and the end vector of the connected combination. The judgment logic is as follows: if 215<= angle_lane<= 325.0: direction = OutType.turn_right elif 125.0<= angle_lane<= 215.0: direction = OutType.turn_around elif 55 <= angle_lane <= 125.0: direction = OutType.turn_left elif 325.0 <= angle_lane or angle_lane <= 55.0: direction = OutType.straight In the embodiments of the present application, by obtaining the intersection data of the intersection and the road network data of the road network, in response to the spatial position matching instruction, comparing the intersection coordinates corresponding to the intersection with the road coordinates corresponding to the road to determine whether the road belongs to the road within the intersection. If the road belongs to the road within the intersection, a first identifier corresponding to the intersection is generated. If the road does not belong to the road within the intersection, a second identifier and / or a third identifier corresponding to the intersection are generated. Connect the roads marked with road identifiers on the road network to generate a road connection combination, classify the road connection combination, and obtain at least one topological relationship.
[0101] First, the technical solution of the present application is not limited by the geographical environment and the number of roads, has high efficiency and scalability, and can therefore process large-scale road network data and is applicable to complex traffic networks in different cities and regions.
[0102] Second, the technical solution of the present application does not require manual intervention, can automatically complete the generation and classification of the topological relationship of the road network, and greatly reduces human errors and time costs. Moreover, by performing spatial position matching on the intersection and road data and automatically calculating the connection and direction between roads, the system can respond to traffic changes in real time and update the topological structure, making the management of the road network more efficient and accurate.
[0103] In addition, the technical solution of the present application also provides strong support for efficient driving navigation planning by clearly distinguishing the directions of the topological relationships of the road network. During the navigation process, the driver can obtain more accurate route guidance based on the clear distinction of road directions (such as going straight, turning left, turning right, and turning around), which helps to reduce traffic congestion, optimize the driving route, and improve the overall travel efficiency.
[0104] Corresponding to the foregoing embodiments of the application function implementation method, the present application also provides a topological relationship generation device for a road network, an electronic device, and corresponding embodiments.
[0105] Figure 4 It is a schematic structural diagram of a topological relationship generation device for a road network shown in the embodiments of the present application. Refer to Figure 4 The device at least includes the following modules: A data acquisition module 401, configured to acquire intersection data of intersections and road network data of a road network; A road sign generation module 402, configured to generate a road sign corresponding to an intersection according to the intersection data and the road network data in response to a spatial position matching instruction; A connection combination generation module 403, configured to connect the roads marked with road signs on the road network to generate a road connection combination; A topological relationship generation module 404, configured to classify the road connection combination to obtain at least one topological relationship.
[0106] As an optional example of the present application, the intersection data includes intersection coordinates corresponding to each intersection, the road network data includes road coordinates corresponding to each target road, and the road sign generation module 402 includes: A first coordinate comparison sub-module, configured to compare the intersection coordinates corresponding to the intersection with the road coordinates corresponding to the target road to determine whether the target road belongs to a road within the intersection; A first generation sub-module, configured to generate a first sign corresponding to the intersection if the target road belongs to a road within the intersection; A second generation sub-module, configured to generate a second sign and / or a third sign corresponding to the intersection if the target road does not belong to a road within the intersection.
[0107] As an optional example of the present application, the intersection data further includes a boundary range, and the first coordinate comparison sub-module is configured to: Traverse the road nodes of each target road on the road network; If the road coordinates of the road node are within the boundary range of the intersection, it is determined that the road belongs to a road within the intersection; If the road coordinates of the road node are outside the boundary range of the intersection, it is determined that the road does not belong to a road within the intersection.
[0108] As an optional example of the present application, the road node includes a road start point and a road end point, the road coordinates include a road start point coordinate of the road start point and a road end point coordinate of the road end point, the intersection coordinates include an intersection start point coordinate and an intersection end point coordinate, and the second generation sub-module is configured to: When the road end point coordinate is the same as the intersection start point coordinate, it is determined that the road belongs to a road entering the intersection and generate a second sign; and / or, When the road start point coordinate is the same as the intersection end point coordinate, it is determined that the road belongs to a road exiting the intersection and generate a third sign.
[0109] As an optional example of the present application, the road sign generation module 402 includes: The second coordinate comparison sub-module is used to sequentially compare all target roads in the road network data with the target intersection area to determine whether the target road belongs to the road within the intersection; The third generation sub-module, if the target road belongs to the road within the intersection, generates a first identifier corresponding to the intersection; The fourth generation sub-module, if the target road does not belong to the road within the intersection, generates a second identifier and / or a third identifier corresponding to the intersection.
[0110] As an optional example of the present application, the fourth generation sub-module is used for: When the end point of the target road coincides with the start point of the road within the intersection, it is determined that the road belongs to the road entering the intersection and a second identifier is generated; and / or, When the start point of the target road coincides with the end point of the road within the intersection, it is determined that the road belongs to the road exiting the intersection and a third identifier is generated.
[0111] As an optional example of the present application, the connection combination generation module 403 is used for: Respectively determine the connection points of the roads within the intersection, the roads entering the intersection, and the roads exiting the intersection; According to the connection points and the preset connection strategy, combine the roads within the intersection, the roads entering the intersection, and the roads exiting the intersection to generate various road connection combinations.
[0112] As an optional example of the present application, the topological relationship generation module 404 includes: The vector determination sub-module is used to determine the start vector and the end vector of each road connection combination; The topological relationship determination sub-module is used to determine the topological relationship by calculating the counterclockwise included angle between the start vector and the end vector.
[0113] As an optional example of the present application, the topological relationship determination sub-module is used for: When the counterclockwise included angle between the start vector and the end vector is within the first included angle range, determine that the topological relationship is the right-turn direction; When the counterclockwise included angle between the start vector and the end vector is within the second included angle range, determine that the topological relationship is the U-turn direction; When the counterclockwise included angle between the start vector and the end vector is within the third included angle range, determine that the topological relationship is the left-turn direction; When the counterclockwise included angle between the start vector and the end vector is within the fourth included angle range, determine that the topological relationship is the straight-ahead direction.
[0114] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated in detail here.
[0115] Figure 5 It is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
[0116] Refer to Figure 5 , the electronic device 500 includes a memory 510 and a processor 520.
[0117] The processor 520 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0118] The memory 510 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, the ROM may store static data or instructions required by the processor 520 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a mass storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory. The system memory may store some or all of the instructions and data required by the processor during operation. In addition, the memory 510 may include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic disks and / or optical disks may also be used. In some embodiments, the memory 510 may include a removable storage device that is readable and / or writable, such as a compact disc (CD), read-only digital versatile disc (such as DVD-ROM, dual-layer DVD-ROM), read-only Blu-ray disc, super density disc, flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and instantaneous electronic signals transmitted wirelessly or wired.
[0119] Executable code is stored on the memory 510, and when the executable code is processed by the processor 520, it can cause the processor 520 to execute some or all of the methods described above.
[0120] In addition, the method according to the present application can also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0121] Alternatively, the present application can also be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium), on which executable code (or a computer program or computer instruction code) is stored. When the executable code (or the computer program or computer instruction code) is executed by a processor of an electronic device (or a server, etc.), it causes the processor to execute some or all of the steps of the above method according to the present application.
[0122] The embodiments of the present application have been described above. The above description is exemplary and not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technologies in the market, or to enable other ordinary skill in the art in the technical field to understand the embodiments disclosed herein.
Claims
1. A method for generating topological relationships of a road network, characterized in that Including: Obtain intersection data of intersections and road network data of the road network; In response to a spatial position matching instruction, generate a road identifier corresponding to the intersection according to the intersection data and the road network data; Connect the roads marked with the road identifier on the road network to generate a road connection combination; Classify the road connection combination to obtain at least one topological relationship.
2. The method according to claim 1, wherein The intersection data includes intersection coordinates corresponding to each intersection, and the road network data includes road coordinates corresponding to each target road. Generating a road identifier corresponding to the intersection according to the intersection data and the road network data includes: Compare the intersection coordinates corresponding to the intersection with the road coordinates corresponding to the target road to determine whether the target road belongs to the road within the intersection; If the target road belongs to the road within the intersection, generate a first identifier corresponding to the intersection; If the target road does not belong to the road within the intersection, generate a second identifier and / or a third identifier corresponding to the intersection.
3. The method according to claim 2, wherein The intersection data further includes a boundary range. Comparing the intersection coordinates corresponding to the intersection with the road coordinates corresponding to the road to determine whether the road belongs to the road within the intersection includes: Traverse the road nodes of each target road on the road network; If the road coordinates of the road node are within the boundary range of the intersection, determine that the road belongs to the road within the intersection; If the road coordinates of the road node are outside the boundary range of the intersection, determine that the road does not belong to the road within the intersection.
4. The method according to claim 3, characterized in that, The road node includes a road start point and a road end point. The road coordinates include the road start point coordinates of the road start point and the road end point coordinates of the road end point. The intersection coordinates include intersection start point coordinates and intersection end point coordinates. Generating a second identifier and / or a third identifier corresponding to the intersection includes: When the road end point coordinates are the same as the intersection start point coordinates, determine that the road belongs to the road entering the intersection and generate the second identifier; and / or, When the road start point coordinates are the same as the intersection end point coordinates, determine that the road belongs to the road exiting the intersection and generate the third identifier.
5. The method according to claim 1, wherein Generating a road identifier corresponding to the intersection according to the intersection data and the road network data includes: Compare all target roads in the road network data with the target intersection area in turn to determine whether the target road belongs to the road within the intersection; If the target road belongs to the road within the intersection, generate a first identifier corresponding to the intersection; If the target road does not belong to the road within the intersection, generate a second identifier and / or a third identifier corresponding to the intersection.
6. The method according to claim 5, wherein Generating a second identifier and / or a third identifier corresponding to the intersection includes: When the road end point of the target road coincides with the road start point located within the intersection, determine that the road belongs to the road entering the intersection and generate the second identifier; and / or, When the road start point of the target road coincides with the road end point within the intersection, it is determined that the road belongs to the road exiting the intersection, and the third identifier is generated.
7. The method according to claim 4 or 6, characterized in that, The connecting the roads marked with the road identifiers on the road network to generate a road connection combination includes: Respectively determining the connection points of the roads within the intersection, the roads entering the intersection, and the roads exiting the intersection; Combining the roads within the intersection, the roads entering the intersection, and the roads exiting the intersection according to the connection points and a preset connection strategy to generate multiple road connection combinations.
8. The method according to claim 1, characterized in that The classifying the road connection combinations to obtain at least one topological relationship includes: Determining the start vector and the end vector of each road connection combination; Determining the topological relationship by calculating the counterclockwise included angle between the start vector and the end vector.
9. The method according to claim 8, wherein The determining the topological relationship by calculating the counterclockwise included angle between the start vector and the end vector includes: When the counterclockwise included angle between the start vector and the end vector is within the first included angle range, determining that the topological relationship is a right-turn direction; When the counterclockwise direction between the start vector and the end vector is within the second included angle range, determining that the topological relationship is a U-turn direction; When the counterclockwise direction between the start vector and the end vector is within the third included angle range, determining that the topological relationship is a left-turn direction; When the counterclockwise direction between the start vector and the end vector is within the fourth included angle range, determining that the topological relationship is a straight-ahead direction.
10. An apparatus for generating a topological relationship of a road network, characterized in that Including: A data acquisition module for acquiring intersection data of the intersection and road network data of the road network; A road identifier generation module for generating a road identifier corresponding to the intersection according to the intersection data and the road network data in response to a spatial position matching instruction; A connection combination generation module for connecting the roads marked with the road identifiers on the road network to generate a road connection combination; A topological relationship generation module for classifying the road connection combinations to obtain at least one topological relationship.
11. An electronic device, characterized in that, Including: A processor; And A memory storing executable code thereon, which when executed by the processor, causes the processor to execute the method according to any one of claims 1-9.
12. A computer-readable storage medium storing executable code thereon, which when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1-9.