Disclosure of Invention
The invention aims to provide a traffic network attribute information generation method, a traffic network attribute information generation device, a storage medium and electronic equipment, which are used for generating road attribute information for a traffic network and meeting the requirement of urban network reconstruction.
In order to achieve the above object, according to one aspect of the present disclosure, there is provided a traffic network attribute information generating method, including:
acquiring traffic network data of a target area;
establishing a road information dictionary of a target area, wherein the road information dictionary at least comprises road point coordinates and road names;
calculating the matching relation between a target road in a target area traffic network and a reference road in a road information dictionary; and
and matching the attribute information of the reference road in the road information dictionary to the corresponding target road in response to the matching of the target road and the reference road.
Optionally, in response to the matching failure of the target road and the reference road, the method further includes the following steps:
setting a plurality of reference points for the target road according to the distance, and acquiring position coordinates of the reference points;
according to the position coordinates of the reference point, the second map platform inquires road attribute information in a range which takes the position coordinates of the reference point as a reference point and takes a set threshold value as a radius;
comparing a plurality of road attribute information acquired according to the plurality of reference points, and determining a road corresponding to the plurality of reference points; and
and matching the road attribute information which corresponds to the multiple reference points to the target road.
Optionally, the step of calculating the matching relationship between the target road in the target area traffic network and the reference road in the road information dictionary specifically includes:
respectively obtaining buffer areas of a target road and a reference road;
calculating the intersection ratio of the target road and a reference road buffer area; and
determining that the target road matches the reference road in response to the intersection ratio of the target road to the reference road being greater than or equal to a threshold.
Optionally, the step of establishing a road information dictionary of the target area comprises:
determining a search area on a second map platform according to the location coordinates of the target area;
acquiring road distribution data and attribute information thereof in a search area; and
and generating a road information dictionary according to the road distribution data and the attribute information thereof.
Optionally, the step of establishing a road information dictionary of the target area further comprises:
judging whether the range of the search area is larger than an effective threshold value or not; and
and in response to the range of the search area being larger than a valid threshold, dividing the search area into more than one sub-search area.
Optionally, the number of the second map platform is more than one.
According to another aspect of the present disclosure, there is provided a traffic network attribute information generation apparatus, including:
the target road network data acquisition module is used for acquiring traffic road network data of a target area according to a given position;
the information searching module is used for searching the road distribution data and the attribute information thereof on the second map platform according to the given position;
the road information dictionary module is connected with the information searching module and used for establishing a road information dictionary of a target area according to the road distribution data and the attribute information thereof obtained by searching of the information searching module, wherein the road information dictionary at least comprises road point coordinates and road names; and
and the first matching module is used for calculating the matching relation between a target road in the traffic network of the target area and a reference road in the road information dictionary, responding to the matching between the target road and the reference road, and matching the attribute information of the reference road in the road information dictionary to the corresponding target road.
Optionally, the apparatus further comprises:
the second matching module is used for setting a plurality of reference points for the target road according to the distance and acquiring the position coordinates of the reference points when the first matching module fails to match the road attribute information for the target road in the target area; sending the position coordinates of the plurality of reference points and the set radius threshold value to the information searching module;
the information searching module queries the road name and the attribute information thereof in the range of the radius threshold value by taking the position coordinate of the reference point as a reference point on a second map platform according to the position coordinate of the reference point;
and the second matching module compares a plurality of road names acquired according to the plurality of reference points and matches the road names and the attribute information thereof which are commonly corresponding to the plurality of reference points to the target road.
According to another aspect of the present disclosure, a computer readable storage medium is provided, having a computer program stored thereon, wherein the program, when being executed by a processor, realizes the steps of any of the aforementioned traffic network property information generating methods.
According to another aspect of the present disclosure, there is provided an electronic apparatus, including:
a memory having a computer program stored thereon;
a processor for executing said computer program in said memory for implementing the steps of any of the aforementioned traffic network property information generating methods.
By the technical scheme, the road information dictionary is generated by more than one second map platform, the road attribute information is matched for the target traffic network by calculating the matching relation between the road information dictionary and the target traffic network, the addition of the attribute information of the road network of more than 90% in a given longitude and latitude range can be realized, and the accuracy of obtaining the road network information is more than 85%; the process of adding the original traffic network data attribute information from scratch lays a foundation for the optimization of a subsequent method, the addition of new attributes and the 3D reconstruction of a virtual city.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a flowchart of a method for generating traffic network attribute information according to an embodiment of the present disclosure. The method comprises the following steps:
step S1, traffic network data of the target area is acquired. For example, OSM (openstreetmap) may provide wide-range, new-data map data for free, and in one embodiment of the present disclosure, the traffic network data may be obtained by acquiring OSM data of a target area. OSM data is first acquired. There are many ways to obtain OSM data: OpenStreetMap closest to the target area can be directly downloaded in the official network https:// wiki. opentresetmap. org; can be downloaded by QGIS software; an ArcGIS Editor for OpenStreetMap plug-in can also be downloaded for downloading. And after the data are downloaded, inputting the given longitude and latitude in the corresponding tool interface, and cutting the obtained OSM data to obtain the road network data in the given area.
Step S2, a road information dictionary of the target area is established, which at least includes the coordinates of the road points and the names of the roads. The method comprises the steps of acquiring road attribute information by utilizing some existing map platforms, for example, sending position coordinates of a target area to the Baidu map platform and the Gade map platform through an API (application program interface) of the Baidu map and the Gade map, respectively determining a search area on the Baidu map platform and the Gade map platform through the position coordinates, acquiring road distribution data and attribute information of the search area, and generating a road information dictionary by utilizing the data returned by the API. Attribute information of each road is included in the road information dictionary. For example, road names, such as a loose road, may be included; the width of the road, such as 12 meters; road coordinates, which are a point set formed by longitude and latitude coordinates; road types, such as major roads (city arterial roads); and partial attribute information that partial OSM data would provide, such as whether it is a one-way track; whether it is a bridge; whether it is a tunnel, etc.
The existing map platform may have a search range limitation when searching for a road, and thus, in another embodiment of the present disclosure, an effective threshold of a search area is set, for example, 10 km, to meet the search range requirement of the second map platform. Comparing whether the range of the target area is greater than a valid threshold of the map platform before sending the position coordinates of the target area to the corresponding map platform through an API of the map platform. For example, the diagonal distance of the target area is calculated, if the diagonal distance of the target area is greater than 10 kilometers, the target area is cut into small blocks, such as 2 blocks and 4 blocks, so as to form a sub-area, the position coordinates of the sub-area are obtained, the position coordinates of the sub-area are sent to the second map platform through the API of the second map platform for searching, and the obtained data are combined to serve as a final search result.
And step S3, calculating the matching relation between the traffic network of the target area and the roads in the road information dictionary. In one embodiment of the present disclosure, a road buffer is employed to match the target road and the reference road. As shown in fig. 2:
and step S31, setting a buffer area for the target road, wherein the buffer area is an area covering the road. Because the data in the target road and the data in the road information dictionary come from different systems, the coordinate of the same geographic position has a little error, and the matching success rate and the matching accuracy can be improved by setting a proper buffer area for the road.
In step S32, a reference road is read from the road information dictionary in accordance with the read sequence number.
And step S33, setting a buffer area for the reference road.
And step S34, calculating the intersection ratio of the target road and the reference road buffer area. The intersection ratio refers to the ratio of the intersection and the union of the target road and the reference road buffer area.
And step S35, comparing the intersection ratio with a threshold value, wherein the value range of the threshold value is 0.0015-0.0025, and taking one value as the intersection ratio threshold value.
Step S36, determining whether the intersection ratio is greater than or equal to the threshold, if the intersection ratio is greater than or equal to the threshold, determining that the target road matches the reference road in step S39; if the intersection ratio is less than the threshold, it is judged whether there is any reference road at step S37, and if not, it is determined that the matching fails at step S40. If there is a reference road, the read sequence number is incremented by 1 at step S38, and the process returns to step S32 to read the next reference road.
In step S4, when matching is successful, the attribute information of the reference road is matched to the corresponding target road.
Fig. 3 is a flowchart of a processing method when matching corresponding road attribute information for a road in the target area fails according to another embodiment of the present disclosure, and fig. 4 is a schematic diagram of setting a reference point on a target road according to an embodiment of the present disclosure. With reference to fig. 3 and 4, the method includes:
step S5, a plurality of dense reference points are set for the target road for which matching fails by distance, and the position coordinates of the reference points are acquired. As shown in fig. 4, the road a is orthogonal to the road B, and the road C is incorporated into the road a. Road a is a matching failed road. In this step, P is provided at intervals on the road A1-P7There are 7 reference points in total.
And step S6, according to the position coordinates of the reference point, inquiring the road attribute information in the range which takes the position coordinates of the reference point as a reference point and takes a set threshold value as a radius on the second map platform. As shown in FIG. 4, when the query radius is r, reference point P1、P4、P6And P7The inquired road is a road A and a reference point P2、P3The inquired road comprises a road A and a road B, and a reference point P5The inquired road includes a road a and a road C, and the road attribute information of the road A, B, C, such as the road type, the road width, etc., is inquired. The query radius r can be flexibly set according to the road width, and when the information such as the type, the width and the like of a target road is unknown, half of the width of the widest road can be set to be multi-point, so that the road and the road intersecting and connecting with the road can be queried, the condition that the separated road is queried is avoided, and errors are avoided in the judgment of the following steps.
Step S7, comparing the plurality of road attribute information acquired from the plurality of reference points, and determining a road to which the plurality of reference points correspond. As shown in FIG. 4, by comparison, P1-P7The commonly included road is road a.
And step S8, matching the road attribute information commonly corresponding to the reference points to the target road. As in the embodiment of fig. 4, the information of the common road a queried from the 7 reference points is matched to the target road.
In the method, a road information dictionary of a traffic network is established by using the information of the current map platform and the query function thereof, and the road attribute information is matched for the target road by calculating the matching relation between the target road and the reference road of the road information dictionary. When the matching fails, the attribute information of the target road is determined by inquiring the road information on the map platform through a plurality of reference points which are arranged on the target road in an encrypted manner, so that the matching success rate is improved.
As shown in fig. 5, a schematic block diagram of an apparatus for generating road traffic network attribute information according to an embodiment of the present disclosure is shown, the apparatus includes: the road network data matching system comprises a target road network data acquisition module 1, an information search module 2, a road information dictionary module 3 and a first matching module 4. The target road network data acquisition module 1 is configured to acquire target area traffic road network data according to a given position. For example, OSM data including a target area is downloaded from an OSM official website, a given longitude and latitude is input in a corresponding tool interface, and the obtained OSM data is cut to obtain road network data in the given area. The information search module 2 calls an API of the second map platform, inputs given position information to the second map platform through the API, searches road distribution data and attribute information thereof on the second map platform, and returns the searched data. The road information dictionary module 3 is connected with the information search module 2, and establishes a road information dictionary of a target area according to the road distribution data and the attribute information thereof obtained by searching of the information search module 2, wherein the attribute information at least comprises road point coordinates and road names. The first matching module 4 calculates the matching relationship between the target road and the reference road in the road information dictionary, and matches the attribute information of the corresponding reference road to the corresponding target road when the matching is successful.
In another embodiment, the apparatus further includes a second matching module 5, as shown in fig. 6, configured to, when the first matching module 4 fails to match corresponding road attribute information for the target road in the target area, obtain road attribute information for the road with which the matching fails. Specifically, the second matching module 5 includes a reference point setting unit 51 and a matching unit 52, the reference point setting unit 51 is connected to the first matching module 4, the first matching module 4 sends a matching instruction to the reference point setting unit 51 after matching fails, the reference point setting unit 51 sets a plurality of reference points for the road that fails to match according to a set reference point quantity threshold after receiving the instruction, and obtains the position coordinates of the reference points from the target road network data. The reference point setting unit 51 sends the position coordinates of the reference point and the set radius threshold to the information search module 2, and the information search module 2 calls an API of the second map platform. The position coordinates of the reference point are input to the second map platform through the API, the road distribution data and the attribute information thereof are searched for on the second map platform, and the obtained information is sent to the matching unit 52. The matching unit 52 compares a plurality of road names acquired from the plurality of reference points, and matches the road names and attribute information thereof corresponding to the plurality of reference points to the target road.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. The electronic device 700 may be provided as a terminal, such as a PC terminal, a mobile terminal, etc. As shown in fig. 7, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the above-mentioned method for automatically generating the traffic network attribute information. The memory 702 is used to store various types of data to support operation at the electronic device 700, such as instructions for any application or method operating on the electronic device 700 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The Memory 702 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components 703 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 702 or transmitted through the communication component 705. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 705 may thus include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described automatic generation method of the traffic network attribute information.
In another exemplary embodiment, a computer readable storage medium is also provided comprising program instructions which, when executed by a processor, implement the steps of the above described method for automatic generation of traffic network property information. For example, the computer readable storage medium may be the memory 702 comprising program instructions executable by the processor 701 of the electronic device 700 to perform the method for automatically generating traffic network attribute information as described above.
Fig. 8 is a block diagram illustrating another electronic device 800 according to an example embodiment. For example, the electronic device 800 may be provided as a server. Referring to fig. 8, an electronic device 800 includes a processor 822, which may be one or more in number, and a memory 832 for storing computer programs executable by the processor 822. The computer programs stored in memory 832 may include one or more modules that each correspond to a set of instructions. Further, the processor 822 may be configured to execute the computer program to perform the above-described automatic generation method of the traffic network attribute information.
Additionally, the electronic device 800 may also include a power component 826 and a communication component 850, the power component 826 may be configured to perform power management of the electronic device 800, and the communication component 850 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 800. The electronic device 800 may also include input/output (I/O) interfaces 858. The electronic device 800 may operate based on an operating system stored in the memory 832, such as Windows Server, Mac OS XTM, UnixTM, Linux, and the like.
In another exemplary embodiment, a computer readable storage medium is also provided comprising program instructions which, when executed by a processor, implement the steps of the above described method for automatic generation of traffic network property information. For example, the computer readable storage medium may be the memory 832 comprising program instructions executable by the processor 822 of the electronic device 800 to perform the method for automatically generating traffic network attribute information as described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned method for automatically generating traffic network property information when being executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.