OSM-based urban traffic three-dimensional simulation scene modeling method and system
By preprocessing and parameterizing the map data to generate a two-dimensional model, and then using three-dimensional visualization software and digital twin tools to generate three-dimensional simulations, the problem of being unable to quickly build a three-dimensional simulation model in the existing technology is solved, and the modeling efficiency and visualization effect are improved.
Patent Information
- Application Number
- CN202510196620.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-07-04
Smart Images

Figure CN120257571A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of map data processing, and in particular, to a method and system for modeling a three-dimensional simulation scene of urban traffic based on OSM. Background Art
[0002] With the acceleration of the urbanization process, the operating efficiency of the urban traffic network has increasingly become a key factor restricting urban development. Traffic simulation technology has played a significant role in improving urban traffic conditions. After the online operation of the highway network traffic simulation platform with multi-source traffic big data, during peak traffic periods, the average congestion duration of highways will be reduced, and the average driving speed will be increased.
[0003] Currently, the adopted City Information Model (CIM) platform can integrate urban dynamic and static data. However, at present, the construction of the simulation model remains at the two-dimensional level and cannot truly reproduce complex three-dimensional environments, making the existing traffic simulation modeling technology unable to meet the need for quickly building large-scale three-dimensional simulation models.
[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention
[0005] The main purpose of the present invention is to provide a method, system, terminal, and computer-readable storage medium for modeling a three-dimensional simulation scene of urban traffic based on OSM, aiming to solve the problem in the existing technology that the construction of the simulation model remains at the two-dimensional level and cannot truly reproduce complex three-dimensional environments, making the existing traffic simulation modeling technology unable to meet the need for quickly building large-scale three-dimensional simulation models.
[0006] To achieve the above object, the present invention provides a method for modeling a three-dimensional simulation scene of urban traffic based on OSM. The method for modeling a three-dimensional simulation scene of urban traffic based on OSM includes the following steps:
[0007] Obtain map data of a target simulation area, and preprocess the map data to obtain preprocessed data;
[0008] Parametrically batch fill shoulders, curbs, and sidewalks according to the preprocessed data parameters, and correspondingly generate a two-dimensional simulation model;
[0009] Define a target data standard, generate a target high-precision map according to the target data standard and the two-dimensional simulation model, and convert the target high-precision map into a three-dimensional road network model through a target software;
[0010] Based on three-dimensional visualization software, generate a three-dimensional simulation model according to the three-dimensional road network model, and generate a three-dimensional visual simulation based on digital twin tools and blueprint tools.
[0011] Optionally, obtaining the map data of the target simulation area and preprocessing the map data to obtain preprocessing data specifically includes:
[0012] Obtaining the map data of the target simulation area, extracting the road network boundary coordinate information from the map data through Python, and deleting all static elements outside the road network boundary range;
[0013] In the data saved in the map data, parsing the key road types reserved for simulation into a string list, and deleting all OSM roads whose type attribute values are not in the list;
[0014] Setting the distance threshold for intersection merging, merging multiple intersections with adjacent distances not greater than the given threshold into one intersection, and regenerating the lane connections in the current intersection. Generating preprocessing data based on the road network boundary coordinate information, string list, lane connections, and the undeleted map data.
[0015] Optionally, parameterizing and batch-filling the road shoulders, curbs, and sidewalks according to the preprocessing data and correspondingly generating a 2D simulation model, specifically including:
[0016] Based on the C++ language, secondary-developing the target program, and parameterizing and batch-filling the preprocessing data into the road shoulders, curbs, and sidewalks according to the target program;
[0017] Processing the batch-filled road shoulders, curbs, and sidewalks according to the automatic conversion program to obtain the 2D simulation model, and checking the 2D simulation model according to the target editor.
[0018] Optionally, based on the C++ language, secondary-developing the target program, and parameterizing and batch-filling the preprocessing data into the road shoulders, curbs, and sidewalks according to the target program, specifically including:
[0019] Based on the C++ language, secondary-developing the target program, obtaining the set of edges that meet the filling requirements in the preprocessing data, and calculating the width of the current lane object to be inserted;
[0020] According to the set of edges that meet the filling requirements and the width of the lane object to be inserted, updating the connection relationship between the front and rear nodes of the edge, and updating the shape of the edge. Filling the road shoulders, curbs, and sidewalks according to the current shape and connection relationship of the edge.
[0021] Optionally, defining the target data standard, generating a target high-precision map according to the target data standard and the 2D simulation model, and converting the target high-precision map into a 3D road network model through the target software, specifically including:
[0022] Define the target data standard, where the target data standard includes the element definition for designing the internal connection lines of the intersection, and each connection line within the intersection is defined as an independent road entity;
[0023] Obtain signal information according to the 2D simulation model;
[0024] Define the intersection in the 2D simulation model according to the target data standard, and generate a target high-precision map in a preset format based on the signal information and the defined intersection, and then generate a 3D road network model based on the target software.
[0025] Optionally, the obtaining signal information according to the 2D simulation model specifically includes:
[0026] Obtain all signal lights at all approach roads in the target area;
[0027] Identify and record the turns controlled by each signal light, and obtain the corresponding signal information according to the turns corresponding to each signal.
[0028] Optionally, based on the 3D visualization software, generating a 3D simulation model according to the 3D road network model, and generating a 3D visual simulation based on the digital twin tool and the blueprint tool specifically includes:
[0029] Input the 3D road network model into the 3D visualization software to generate a 3D simulation model and synchronously map dynamic simulation objects;
[0030] Generate the corresponding building through the digital twin tool, fill the environmental information using the blueprint tool, and generate a 3D visual simulation according to the corresponding building, environmental information and the 3D simulation model.
[0031] In addition, to achieve the above object, the present invention also provides a 3D simulation scene modeling system for urban traffic based on OSM, where the 3D simulation scene modeling system for urban traffic based on OSM includes:
[0032] A preprocessing module, configured to obtain map data of the target simulation area, and preprocess the map data to obtain preprocessed data;
[0033] A 2D simulation model generation module, configured to parametrically batch fill shoulders, curbs and sidewalks according to the preprocessed data parameters, and correspondingly generate a 2D simulation model;
[0034] A 3D road network model generation module, configured to define the target data standard, generate a target high-precision map according to the target data standard and the 2D simulation model, and convert the target high-precision map into a 3D road network model through the target software;
[0035] A three-dimensional visualization simulation generation module, which is used to generate a three-dimensional simulation model based on a three-dimensional visualization software according to the three-dimensional road network model, and generate a three-dimensional visualization simulation based on a digital twin tool and a blueprint tool.
[0036] In addition, to achieve the above object, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a three-dimensional simulation scene modeling program for urban traffic based on OSM stored on the memory and executable on the processor. When the three-dimensional simulation scene modeling program for urban traffic based on OSM is executed by the processor, the steps of the above-mentioned three-dimensional simulation scene modeling method for urban traffic based on OSM are implemented.
[0037] In addition, to achieve the above object, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a three-dimensional simulation scene modeling program for urban traffic based on OSM. When the three-dimensional simulation scene modeling program for urban traffic based on OSM is executed by a processor, the steps of the above-mentioned three-dimensional simulation scene modeling method for urban traffic based on OSM are implemented.
[0038] In the present invention, map data of a target simulation area is obtained, and the map data is preprocessed to obtain preprocessed data; shoulders, curbs, and sidewalks are parametrically batch-filled according to the preprocessed data parameters, and a two-dimensional simulation model is correspondingly generated; a target data standard is defined, and according to the target data standard and the two-dimensional simulation model, a target high-precision map is generated, and the target high-precision map is converted into a three-dimensional road network model through a target software; based on a three-dimensional visualization software, a three-dimensional simulation model is generated according to the three-dimensional road network model, and a three-dimensional visualization simulation is generated based on a digital twin tool and a blueprint tool. The present invention uses an OSM map as a data source for traffic simulation modeling requirements, obtains a corresponding three-dimensional simulation model and a three-dimensional visualization simulation through the data conversion relationship between the two-dimensional simulation model and the three-dimensional model, and improves the automatic modeling efficiency of traffic simulation and strengthens the three-dimensional visualization ability of the simulation model in this process. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flowchart of a preferred embodiment of the three-dimensional simulation scene modeling method for urban traffic based on OSM of the present invention;
[0040] Figure 2 is a schematic diagram of the effect of parametrically batch-filling shoulders, curbs, and sidewalks in the three-dimensional simulation scene modeling method for urban traffic based on OSM of the present invention;
[0041] Figure 3 is a structural diagram of a preferred embodiment of the three-dimensional simulation scene modeling system for urban traffic based on OSM of the present invention;
[0042] Figure 4 The structural diagram of the preferred embodiment of the terminal of the present invention. Detailed implementation manners
[0043] To make the objectives, technical solutions and advantages of the present invention clearer and more explicit, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0044] With the acceleration of the urbanization process, the operating efficiency of the urban traffic network has increasingly become a key factor restricting urban development. Traffic simulation technology has played a significant role in improving urban traffic conditions. After the traffic simulation platform for the highway network with multi-source traffic big data is launched, during peak traffic periods, the average congestion duration of highways will be reduced, and the average driving speed will be increased.
[0045] Currently, the CIM platform integrates urban dynamic and static data, especially putting forward higher requirements for three-dimensional traffic simulation modeling technology. However, in the current research on the construction of simulation models, there are still problems such as low efficiency, high error rate, difficulty in updating, and poor integration; many existing simulation technologies stay at the two-dimensional level and cannot truly reproduce complex three-dimensional environments. At the same time, problems such as model logic errors and missing mapping relationships that occur during the actual conversion of two-dimensional simulation models to three-dimensional simulation models need to be solved. Traffic simulation is a typical traffic data analysis method. Therefore, it is necessary to quickly and automatically generate lane-level traffic simulation models. While accurately reflecting the spatio-temporal characteristics of traffic flow, for the problem of low efficiency in constructing large-scale simulation models, develop three-dimensional traffic simulation rapid modeling technology based on OSM map data. For the problem of insufficient visualization effect of simulation models, through the collaborative simulation of simulation software and rendering software, further enhance the visualization effect of the simulation.
[0046] Meanwhile, in response to one or more of the above problems, the present invention obtains map data of a target simulation area, preprocesses the map data to obtain preprocessed data; parametrically fills shoulders, curbs and sidewalks in batches according to the preprocessed data parameters, and correspondingly generates a two-dimensional simulation model; defines a target data standard, and generates a target high-precision map according to the target data standard and the two-dimensional simulation model, and converts the target high-precision map into a three-dimensional road network model through a target software; based on three-dimensional visualization software, generates a three-dimensional simulation model according to the three-dimensional road network model, and generates three-dimensional visual simulation based on digital twin tools and blueprint tools.
[0047] The method for modeling a three-dimensional traffic simulation scene of a city based on OSM according to the preferred embodiment of the present invention, as Figure 1 shown, the method for modeling a three-dimensional traffic simulation scene of a city based on OSM includes the following steps:
[0048] Step S10: Obtain the map data of the target simulation area, preprocess the map data, and obtain preprocessed data.
[0049] Specifically, in the present invention, obtain the OSM (OpenStreetMap, a type of Internet electronic map data that basically includes four elements: nodes, paths, relations, and tags) map data of the area to be simulated, extract the precise coordinate information of the road network boundary from the Shapefile, set the key road types required for simulation, set the distance threshold for intersection merging, and write it into an XML configuration file for data preprocessing. Through this XML configuration file, the map data can be preprocessed.
[0050] Furthermore, the step of obtaining the map data of the target simulation area, preprocessing the map data, and obtaining preprocessed data specifically includes:
[0051] Obtain the map data of the target simulation area, extract the road network boundary coordinate information from the map data through Python, and delete all static elements outside the road network boundary range;
[0052] In the remaining data saved in the map data, parse the key road types to be retained in the simulation into a string list, and delete all OSM roads whose type attribute values are not in the list;
[0053] Set the distance threshold for intersection merging, merge multiple intersections with adjacent distances not greater than the given threshold into one intersection, and regenerate the lane connections in the current intersection. Generate preprocessed data based on the road network boundary coordinate information, string list, lane connections, and the undeleted map data.
[0054] Specifically, the OSM (OpenStreetMap, a type of Internet electronic map data that basically includes four elements: nodes, paths, relations, and tags) map data of the target simulation area in the OpenStreetMap platform can be obtained using box selection for downloading. Write an XML configuration file for data preprocessing, and preprocess the map data through this XML configuration file. During the preprocessing process, convert the OSM map data into a Shapefile, use the geopandas module of Python to extract the precise road network boundary coordinate information from the Shapefile, and delete all static elements outside the boundary range; parse the key road types to be retained in the simulation into a string list, and delete all OSM roads whose type attribute values are not in the list; set the distance threshold for intersection merging, merge multiple intersections with adjacent distances less than or equal to the given threshold into one intersection, and regenerate the lane connections in the current intersection, thereby generating preprocessed data.
[0055] Step S20: Parametrically and batch-fill the shoulders, curbstones, and sidewalks according to the preprocessed data, and correspondingly generate a 2D simulation model.
[0056] Specifically, in the present invention, the corresponding 2D simulation model is a SUMO (a traffic simulation software) 2D simulation model. The process of generating the SUMO 2D simulation model is as follows: Use C++ language to re-develop the NETCONVERT automatic conversion program of SUMO, parametrically and batch-fill the shoulders, curbstones, and sidewalks with the preprocessed data, and then automatically generate a 2D simulation model. Specifically, as Figure 2 shown, it is a 2D simulation model generated in an embodiment.
[0057] Furthermore, the parametrically and batch-filling the shoulders, curbstones, and sidewalks according to the preprocessed data and correspondingly generating a 2D simulation model specifically includes:
[0058] Re-develop the target program based on the C++ language, and parametrically and batch-fill the preprocessed data into the shoulders, curbstones, and sidewalks according to the target program;
[0059] Process the batch-filled shoulders, curbstones, and sidewalks according to the automatic conversion program to obtain the 2D simulation model, and check the 2D simulation model according to the target editor.
[0060] Specifically, in the present invention, re-develop the target program based on the C++ language, that is, the NETCONVERT program. Among them, this target program is used to parametrically and batch-fill the preprocessed data into the shoulders, curbstones, and sidewalks. In the SUMO simulation software, input the batch-filled shoulders, curbstones, and sidewalks, and the corresponding 2D simulation model can be obtained through the automatic conversion program therein. Then, use the NETEDIT editor, that is, the target editor, to preliminarily check the conversion of the nodes, road segments, connection lines, and traffic lights of the 2D simulation model to confirm that there is no data loss or topological deformation.
[0061] Furthermore, the re-developing the target program based on the C++ language and parametrically and batch-filling the preprocessed data into the shoulders, curbstones, and sidewalks according to the target program specifically includes:
[0062] Re-develop the target program based on the C++ language, obtain the set of edges that meet the filling requirements in the preprocessed data, and calculate the width of the lane object to be inserted currently;
[0063] According to the set of edges that meet the filling requirements and the width of the lane object to be inserted, update the connection relationship between the front and rear nodes of the edge, and update the shape of the edge. Fill the shoulders, curbstones, and sidewalks according to the current shape and connection relationship of the edge.
[0064] Specifically, for the developed target program, it obtains the set of edges that meet the filling requirements in the preprocessed data and calculates the width of the lane object to be inserted currently, where the filling requirements are requirements set by the user; then, it updates the shape, connection relationship, and information of the nodes and lanes according to the obtained set of edges and the width of the lane object.
[0065] Step S30: Define the target data standard. According to the target data standard and the two-dimensional simulation model, generate a target high-precision map, and convert the target high-precision map into a three-dimensional road network model through target software.
[0066] It should be noted that the design process of generating a three-dimensional road network model based on a two-dimensional simulation model is as follows: Consider converting the two-dimensional simulation model into a high-precision map in OpenDRIVE format, and then automatically construct a three-dimensional road network model through RoadRunner software. However, the description of traffic infrastructure in the high-precision map is inconsistent with the simulation data format. To address the problem that the topological structure relationship of each element in the high-precision map conversion to the three-dimensional scene is incomplete, based on the data standard of OpenDRIVE, a general data standard is proposed from aspects such as the two-level relationship between roads and lanes, the basic information required for lanes, the relationship between landmarks and road lanes, and the relationship between physical and virtual elements, so as to achieve accurate conversion.
[0067] Furthermore, the defining of the target data standard, generating a target high-precision map according to the target data standard and the two-dimensional simulation model, and converting the target high-precision map into a three-dimensional road network model through target software specifically includes:
[0068] Define the target data standard, where the target data standard includes the element definition of the internal connecting lines of the designed intersection, and define each connecting line in the intersection as an independent road entity;
[0069] Obtain signal information according to the two-dimensional simulation model;
[0070] Define the intersection in the two-dimensional simulation model according to the target data standard, and generate a target high-precision map in a preset format based on the signal information and the defined intersection, and then generate a three-dimensional road network model based on the target software.
[0071] Specifically, first define the target data standard, that is, the element definition of the internal connection lines at the intersection. Define each connection line within the intersection as an independent road entity. Specifically, select different types of intersection analysis and tests to determine that during the conversion process from the 2D simulation model of SUMO to the OpenDRIVE high-precision map, two sections of roads are connected through expanding or narrowing the intersection, and multiple connection lines in the intersection are regarded as multiple lanes in an internal road. When constructing a 3D road network model, a physical area will be missing for this type of intersection. Therefore, in the present invention, the connection lines between each lane within the intersection are defined as independent road entities with independent attributes (such as road grade, speed limit), allowing independent adjustment of each connection line when the intersection is widened or narrowed without interfering with other road structures.
[0072] Furthermore, obtaining signal information according to the 2D simulation model specifically includes:
[0073] Obtain all signal lights at all approach roads in the target area;
[0074] Identify and record the turns controlled by each signal light, and obtain the corresponding signal information according to the turns corresponding to each signal.
[0075] Specifically, obtain signal information according to the corresponding 2D simulation model, where the signal information is mainly the corresponding relationship between the signal light and the meaning of the turn. Through analysis, it is found that in the SUMO 2D simulation model, the param element records the association information between the connection line and the signal light, the key attribute represents the connection line id, and the value attribute represents the signal light id. However, there is a situation where a single connection line id is bound to multiple signal light ids, resulting in the inability to synchronize the signal light status of the 3D simulation model with the 2D simulation model. Therefore, in the present invention, before obtaining the signal information, design a signal light control scheme based on the approach road turn, that is, after determining the one-to-one correspondence between the connection line and the signal light in the 2D simulation model, design the control scheme for the signal light group, and all connection lines of each approach road are uniformly controlled by the left-turn, straight-ahead, and right-turn signal lights.
[0076] After that, parse the road network of the 2D simulation model through the lxml library of Python, read all Junction elements in the network, and correspondingly obtain all signal lights at all approach roads in the target area, that is, read all connection lines of the approach road, generate the corresponding left-turn, straight-ahead, and right-turn signal lights according to the left-turn, straight-ahead, and right-turn connection lines; and associate the ID of the current connection line with the ID of the signal light corresponding to the turn, store it in the param element, the ID of the connection line corresponds to the attribute key, and the ID attribute of the signal light corresponding to the turn is value, and mount the param element as a sub-element of tlLogic, thereby obtaining the corresponding signal information, where the signal information is stored in the *.net.xml file.
[0077] Each connecting line within the intersection is defined as an independent road entity through the defined target data standard, that is, the 2D simulation model is correspondingly updated. Then, through the signal information, the corresponding high-precision map can be exported in the *.xodr format. After that, by using the RoadRunner software to convert the high-precision map, a 3D road network model is automatically constructed, that is, a 3D road network model in the *.fbx format is output through the ExportCARLA Filmbox module in this software.
[0078] Step S40: Based on the 3D visualization software, generate a 3D simulation model according to the 3D road network model, and generate a 3D visual simulation based on the digital twin tool and the blueprint tool.
[0079] Specifically, a 3D simulation model is correspondingly generated through the 3D visualization software, and the environment and buildings are further filled to obtain a 3D visual simulation.
[0080] Furthermore, the step of generating a 3D simulation model according to the 3D road network model based on the 3D visualization software and generating a 3D visual simulation based on the digital twin tool and the blueprint tool specifically includes:
[0081] Input the 3D road network model into the 3D visualization software to generate a 3D simulation model and synchronously map dynamic simulation objects;
[0082] Generate the corresponding buildings through the digital twin tool, fill the environmental information by using the blueprint tool, and generate a 3D visual simulation according to the corresponding buildings, environmental information and the 3D simulation model.
[0083] Specifically, in the present invention, a 3D simulation model is automatically generated based on the 3D road network model through the 3D visualization software CAR LA, and dynamic simulation objects are synchronously mapped in the process. Then, buildings are programmatically generated by using the digital twin tool, and vegetation, weather and model materials are programmatically filled by using the blueprint tool, and a 3D visual simulation is output.
[0084] The present invention obtains map data of a target simulation area, preprocesses the map data to obtain preprocessed data; parametrically and batch fills shoulders, curbs, and sidewalks according to the preprocessed data parameters, and correspondingly generates a 2D simulation model; defines a target data standard, and generates a target high-precision map according to the target data standard and the 2D simulation model, and converts the target high-precision map into a 3D road network model through a target software; based on 3D visualization software, generates a 3D simulation model according to the 3D road network model, and generates a 3D visual simulation based on digital twin tools and blueprint tools. The present invention uses an OSM map as a data source for traffic simulation modeling requirements, obtains corresponding 3D simulation models and 3D visual simulations through the data conversion relationship between 2D simulation models and 3D models, and improves the automatic modeling efficiency of traffic simulation and strengthens the 3D visualization ability of the simulation model in this process.
[0085] Further, as Figure 3 shown, based on the above-mentioned OSM-based urban traffic 3D simulation scene modeling method, the present invention also correspondingly provides an OSM-based urban traffic 3D simulation scene modeling system, wherein the OSM-based urban traffic 3D simulation scene modeling system includes:
[0086] A preprocessing module 31, configured to obtain map data of a target simulation area, preprocess the map data to obtain preprocessed data;
[0087] A 2D simulation model generation module 32, configured to parametrically and batch fill shoulders, curbs, and sidewalks according to the preprocessed data parameters, and correspondingly generate a 2D simulation model;
[0088] A 3D road network model generation module 33, configured to define a target data standard, generate a target high-precision map according to the target data standard and the 2D simulation model, and convert the target high-precision map into a 3D road network model through a target software;
[0089] A 3D visual simulation generation module 34, configured to generate a 3D simulation model based on 3D visualization software according to the 3D road network model, and generate a 3D visual simulation based on digital twin tools and blueprint tools.
[0090] Further, as Figure 4 shown, based on the above-mentioned OSM-based urban traffic 3D simulation scene modeling method and system, the present invention also correspondingly provides a terminal, and the terminal includes a processor 10, a memory 20, and a display 30. Figure 4 Only some components of the terminal are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.
[0091] The memory 20 may be an internal storage unit of the terminal in some embodiments, such as the hard disk or memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk equipped on the terminal, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 20 may also include both the internal storage unit of the terminal and the external storage device. The memory 20 is used to store application software installed on the terminal and various types of data, such as the program code of the installed terminal. The memory 20 may also be used to temporarily store data that has been output or will be output. In one embodiment, a three-dimensional simulation scene modeling program 40 for urban traffic based on OSM is stored on the memory 20, and the three-dimensional simulation scene modeling program 40 for urban traffic based on OSM can be executed by the processor 10, so as to implement the three-dimensional simulation scene modeling method for urban traffic based on OSM in the present invention.
[0092] The processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chips in some embodiments, and is used to run the program code stored in the memory 20 or process data, such as executing the three-dimensional simulation scene modeling method for urban traffic based on OSM, etc.
[0093] The display 30 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. in some embodiments. The display 30 is used to display information on the terminal and to display a visual user interface.
[0094] In one embodiment, when the processor 10 executes the three-dimensional simulation scene modeling program 40 for urban traffic based on OSM in the memory 20, the steps of the above three-dimensional simulation scene modeling method for urban traffic based on OSM are implemented.
[0095] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a three-dimensional simulation scene modeling program for urban traffic based on OSM, and when the three-dimensional simulation scene modeling program for urban traffic based on OSM is executed by a processor, the following steps are implemented:
[0096] Obtain map data of a target simulation area, and perform preprocessing on the map data to obtain preprocessed data;
[0097] Parametrically batch-fill the shoulders, curbs, and sidewalks according to the preprocessed data, and correspondingly generate a 2D simulation model;
[0098] Define the target data standard, generate a target high-precision map according to the target data standard and the 2D simulation model, and convert the target high-precision map into a 3D road network model through target software;
[0099] Based on 3D visualization software, generate a 3D simulation model according to the 3D road network model, and generate a 3D visualization simulation based on digital twin tools and blueprint tools.
[0100] Among them, the obtaining of the map data of the target simulation area and the preprocessing of the map data to obtain preprocessed data specifically include:
[0101] Obtain the map data of the target simulation area, extract the road network boundary coordinate information from the map data through Python, and delete all static elements outside the road network boundary range;
[0102] In the remaining data saved in the map data, parse the key road types reserved for the simulation into a string list, and delete all OSM roads whose type attribute values are not in the list;
[0103] Set the distance threshold for intersection merging, merge multiple intersections with adjacent distances not greater than the given threshold into one intersection, and regenerate the lane connections in the current intersection. Generate preprocessed data according to the road network boundary coordinate information, string list, lane connections, and the undeleted map data.
[0104] Among them, the parametrically batch-filling the shoulders, curbs, and sidewalks according to the preprocessed data and correspondingly generating a 2D simulation model specifically includes:
[0105] Based on the C++ language, secondary develop the target program, and parametrically batch-fill the preprocessed data into the shoulders, curbs, and sidewalks according to the target program;
[0106] Process the batch-filled shoulders, curbs, and sidewalks according to the automatic conversion program to obtain the 2D simulation model, and check the 2D simulation model according to the target editor.
[0107] Among them, the secondary development of the target program based on the C++ language and the parametrically batch-filling the preprocessed data into the shoulders, curbs, and sidewalks according to the target program specifically include:
[0108] Based on the C++ language, secondary develop the target program, obtain the edge set that meets the filling requirements in the preprocessed data, and calculate the width of the current lane object to be inserted;
[0109] Update the connection relationship of the front and rear nodes of the edge and update the shape of the edge according to the set of edges that meet the filling requirements and the width of the lane object to be inserted. Fill the shoulder, curb, and sidewalk according to the shape and connection relationship of the current edge.
[0110] Among them, the definition of the target data standard, according to the target data standard and the 2D simulation model, generate a target high-precision map, and convert the target high-precision map into a 3D road network model through target software, specifically including:
[0111] Define the target data standard, and the target data standard includes the element definition of the internal connecting lines of the designed intersection, and define each connecting line in the intersection as an independent road entity;
[0112] Obtain signal information according to the 2D simulation model;
[0113] Define the intersection in the 2D simulation model according to the target data standard, and generate a target high-precision map in a preset format according to the signal information and the defined intersection, and then generate a 3D road network model based on the target software.
[0114] Among them, the obtaining of signal information according to the 2D simulation model specifically includes:
[0115] Obtain all signal lights of all approach roads in the target area;
[0116] Identify and record the turns controlled by each signal light, and obtain the corresponding signal information according to the turns corresponding to each signal.
[0117] Among them, based on the 3D visualization software, generate a 3D simulation model according to the 3D road network model, and generate a 3D visual simulation based on the digital twin tool and the blueprint tool, specifically including:
[0118] Input the 3D road network model into the 3D visualization software to generate a 3D simulation model and synchronously map dynamic simulation objects;
[0119] Generate the corresponding building through the digital twin tool, fill the environmental information with the blueprint tool, and generate a 3D visual simulation according to the corresponding building, environmental information, and the 3D simulation model.
[0120] It should be noted that, in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or terminal including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or terminal including such element.
[0121] Of course, those of ordinary skill in the art can understand that all or part of the processes of implementing the above-described embodiments of the method can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium readable by a computer. When the program is executed, it can include the processes of the above-described method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.
[0122] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for modeling a three-dimensional simulation scene of urban traffic based on OSM, characterized in that, The method for modeling a 3D simulation scene of urban traffic based on OSM includes: Obtain the map data of the target simulation area, preprocess the map data to obtain preprocessed data; Parametrically batch-fill the road shoulders, curbs, and sidewalks according to the preprocessed data parameters, and correspondingly generate a 2D simulation model; Define the target data standard, generate a target high-precision map according to the target data standard and the 2D simulation model, and convert the target high-precision map into a 3D road network model through the target software; Based on 3D visualization software, generate a 3D simulation model according to the 3D road network model, and generate a 3D visualization simulation based on digital twin tools and blueprint tools.
2. The method for modeling a three-dimensional simulation scenario of urban traffic based on OSM according to claim 1, wherein The obtaining of the map data of the target simulation area, preprocessing of the map data to obtain preprocessed data specifically includes: Obtain the map data of the target simulation area, extract the road network boundary coordinate information from the map data through Python, and delete all static elements outside the road network boundary range; In the remaining data saved in the map data, parse the key road types reserved for simulation into a string list, and delete all OSM roads whose type attribute values are not in the list; Set the distance threshold for intersection merging, merge multiple intersections with adjacent distances not greater than the given threshold into one intersection, and regenerate the lane connections in the current intersection. Generate preprocessed data according to the road network boundary coordinate information, string list, lane connections, and the undeleted map data.
3. The method for modeling a three-dimensional simulation scene of urban traffic based on OSM according to claim 1, characterized in that, The parametrically batch-filling of the road shoulders, curbs, and sidewalks according to the preprocessed data parameters and correspondingly generating a 2D simulation model specifically includes: Based on the C++ language, redevelop the target program, and parametrically batch-fill the preprocessed data into the road shoulders, curbs, and sidewalks according to the target program; Process the batch-filled road shoulders, curbs, and sidewalks through an automatic conversion program to obtain the 2D simulation model, and check the 2D simulation model according to the target editor.
4. The method for modeling a three-dimensional simulation scenario of urban traffic based on OSM according to claim 3, wherein The based on the C++ language redeveloping the target program and parametrically batch-filling the preprocessed data into the road shoulders, curbs, and sidewalks specifically includes: Based on the C++ language, redevelop the target program, obtain the edge set that meets the filling requirements in the preprocessed data, and calculate the width of the current lane object to be inserted; According to the edge set that meets the filling requirements and the width of the lane object to be inserted, update the connection relationship of the front and rear nodes of the edge, and update the shape of the edge. Fill the road shoulders, curbs, and sidewalks according to the current shape and connection relationship of the edge.
5. The method for modeling a 3D simulation scenario of urban traffic based on OSM according to claim 1, wherein The defining of the target data standard, generating a target high-precision map according to the target data standard and the 2D simulation model, and converting the target high-precision map into a 3D road network model through the target software specifically includes: Define the target data standard, where the target data standard includes the element definition of the internal connecting lines of the designed intersections, and define each connecting line in the intersection as an independent road entity; Obtain the signal information according to the 2D simulation model; Define the intersections in the two-dimensional simulation model according to the target data standard, generate a target high-precision map in a preset format based on the signal information and the defined intersections, and then generate a three-dimensional road network model based on the target software.
6. The method for modeling a three-dimensional simulation scenario of urban traffic based on OSM according to claim 5, wherein The obtaining of signal information according to the two-dimensional simulation model specifically includes: Obtain all signal lights of all approach roads in the target area; Identify and record the turns controlled by each signal light, and obtain the corresponding signal information according to the turns corresponding to each signal.
7. The method for modeling a three-dimensional simulation scenario of urban traffic based on OSM according to claim 1, wherein Based on the three-dimensional visualization software, generate a three-dimensional simulation model according to the three-dimensional road network model, and generate a three-dimensional visual simulation based on the digital twin tool and the blueprint tool, specifically including: Input the three-dimensional road network model into the three-dimensional visualization software to generate a three-dimensional simulation model and synchronously map dynamic simulation objects; Generate corresponding buildings through the digital twin tool, fill the environmental information using the blueprint tool, and generate a three-dimensional visual simulation according to the corresponding buildings, environmental information, and the three-dimensional simulation model.
8. A three-dimensional simulation scene modeling system for urban traffic based on OSM, characterized in that, The three-dimensional simulation scene modeling system for urban traffic based on OSM includes: A preprocessing module for obtaining map data of the target simulation area and preprocessing the map data to obtain preprocessed data; A two-dimensional simulation model generation module for parametrically batch filling shoulders, curbs, and sidewalks according to the preprocessed data parameters and correspondingly generating a two-dimensional simulation model; A three-dimensional road network model generation module for defining the target data standard, generating a target high-precision map according to the target data standard and the two-dimensional simulation model, and converting the target high-precision map into a three-dimensional road network model through the target software; A three-dimensional visual simulation generation module for generating a three-dimensional simulation model based on the three-dimensional road network model using the three-dimensional visualization software and generating a three-dimensional visual simulation based on the digital twin tool and the blueprint tool.
9. A terminal, characterized in that, The terminal includes: a memory, a processor, and an OSM-based three-dimensional simulation scene modeling program for urban traffic stored on the memory and executable on the processor. When the OSM-based three-dimensional simulation scene modeling program for urban traffic is executed by the processor, it implements the steps of the OSM-based three-dimensional simulation scene modeling method for urban traffic according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an OSM-based three-dimensional simulation scene modeling program for urban traffic. When the OSM-based three-dimensional simulation scene modeling program for urban traffic is executed by the processor, it implements the steps of the OSM-based three-dimensional simulation scene modeling method for urban traffic according to any one of claims 1-7.
Citation Information
Cited By
Method, device and equipment for constructing roads at intersections with different heights and readable storage medium
CN120745247A