Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application discloses a road shape adjusting scheme, which aims at the existing electronic map, determines road nodes needing to be adjusted and target roads needing to be adjusted in roads connected with road nodes to be adjusted, and then adjusts the road shape of one section of the target roads, which is close to the road nodes to be adjusted, according to a set adjusting mode. Next, a road shape adjusting method of the present application is described, and as shown in fig. 2, the method includes:
step S100, determining a trend road section in road sections contained in roads aiming at each road connected with a road node to be adjusted, and determining the direction of the trend road section as the trend direction of the road;
specifically, a road node to be adjusted is determined in the electronic map, and a road needing road shape adjustment exists in roads connected with the road node to be adjusted. And determining a trend road section from road sections contained in the road aiming at each road connected with the road nodes to be adjusted, wherein the direction of the trend road section represents the trend direction of the road. A road contains a plurality of nodes, which can be read from an electronic map, with two adjacent nodes forming a road segment. In this step, a trend road segment capable of indicating the trend direction of the road is determined from a plurality of road segments included in the road.
It should be noted that, the roads in the electronic map may be subjected to a bending process, and therefore the road direction near the road node to be adjusted does not necessarily represent the real direction of the road. In this step, the trend direction of the road is determined according to the direction of the trend section of the road, and the real direction of the road is estimated according to the trend direction.
Step S110, determining a target road needing road shape adjustment according to the trend direction of each road connected with the road node to be adjusted;
specifically, after the trend direction of each road connected with the road node to be adjusted is determined in the previous step, the target road in which the road shape is to be adjusted is determined according to the trend direction of each road.
Step S120, taking any point in the trend road section in the target road as a starting point, making a ray along the trend direction of the target road, and taking a first intersection point generated by intersection of the ray and the road connected with the road node to be adjusted as a target point;
among the two end points of the defined trend road section, one section far away from the road node to be adjusted is used as a starting end point, and one end near the road node to be adjusted is used as a tail end point. In this step, a ray may be made along the trend direction of the target road with any one point from a start point to an end point in a trend section as a start point, and a first intersection point generated by intersection of the ray and a road connected with the road node to be adjusted is used as a destination point.
In a preferred embodiment, the application may use the end point of the trend road segment as the starting point, and make a ray along the trend direction of the target road, where the ray intersects with the road connected to the road node to be adjusted to generate a first intersection point as the destination point.
As shown in connection with fig. 3:
assume that the road L2 is a determined target road for which road shape adjustment is required. The trend road segment in L2 is determined to be O11-O12. The trend direction is an intersection O2 of the ray emitted from O12 in the trend direction and the road L5. The destination point is O2.
Step S130, taking one end of the trend road segment close to the road node to be adjusted as an adjustment starting point, and adjusting the road segment from the adjustment starting point to the road node to be adjusted in the target road to a line segment from the adjustment starting point to the destination point. Those skilled in the art can understand that, the section of the target road from the adjustment starting point to the road node to be adjusted is modified as follows: and adjusting the road section consisting of the starting point and the destination point.
In order to ensure that the road shape of the target road can be truly reflected, the road section from the adjustment starting point to the road node to be adjusted in the target road is adjusted into the road section from the adjustment starting point to the destination point.
Still referring to fig. 3, the link from O12 to O1 is adjusted to the link from O12 to O2.
Among them, the road segment O12-O2 is more capable of reflecting the true road shape of the target road L2.
The road shape adjusting method comprises the steps of determining a trend road section in road sections contained in roads aiming at each road connected with road nodes to be adjusted in an electronic map, and determining the direction of the trend road section as the trend direction of the roads; determining a target road needing road shape adjustment according to the trend direction of each road connected with the road node to be adjusted; taking any point in the trend road section in the target road as a starting point, making a ray along the trend direction of the target road, and taking a first intersection point generated by intersection of the ray and the road connected with the road node to be adjusted as a target point; and taking one end of the trend road section close to the road node to be adjusted as an adjustment starting point, and adjusting the road section from the adjustment starting point to the road node to be adjusted in the target road into a line section from the adjustment starting point to the target point. This application is to the target road that needs carry out the road shape adjustment, according to the direction of its trend highway section to arbitrary point is the starting point in the trend highway section and is the ray, and the ray is crossing with other roads and produces first crossing point as the destination point, from the true road shape of target road more can really be represented to the highway section of adjustment starting point to destination point, consequently will in the target road from the adjustment starting point extremely treat the highway section adjustment between the road node of adjusting for from the adjustment starting point extremely the line segment of destination point, the road shape of target road has really been reflected, has improved the intuitiveness of road display.
Optionally, a determination process of determining the length of a line segment from the adjustment starting point to the destination point may be added before step S130, and it is determined whether the length of the line segment is within a set length range, and if so, the adjustment process of step S130 is executed. By increasing the length judgment process, the occurrence of too short or too long adjustment road sections is avoided.
Optionally, before the step S100, the scheme of the present application may further add: and acquiring the road nodes meeting the set node adjustment conditions as road nodes to be adjusted.
Wherein, the setting of the node adjustment condition may include one or more of the following conditions:
1) and the number of roads connected by the road nodes is not less than the first road number threshold.
Wherein, the first road strip number threshold may be 4.
In conjunction with fig. 4a and 4 b:
the main road L1 and the auxiliary road L2 illustrated in fig. 4a converge at the node O1, and at the same time, the road exiting from the node O1 includes L3 and L4.
It should be noted that, according to the real road network situation, after a main road enters an intersection, at least one road which is driven out in parallel with the main road generally exists. Corresponding to the main road entering L1 and the main road exiting L3 in fig. 4 a. In the case of the example of fig. 4a, the side road L2 can generate an intersection point with the road L4 connected to the O1 node by making a ray from the end of the trend link in the route adjustment scheme described in the above embodiment. In the case of the example of fig. 4b, the side road L2 cannot generate an intersection with another road connected to the O1 node by making a ray from the end of the trend link, and even if an intersection with L3 can be generated, this adjustment does not conform to the true road shape.
Comprehensively, the number of roads connected by the road nodes to be adjusted is not less than 4.
2) The number of roads which are connected with the road nodes and provided with road names is not less than a second road number threshold, and the second road number threshold is not more than the first road number threshold.
It should be noted that, there may be some roads in the electronic map and no road name is set, that is, the electronic map belongs to a nameless road. The unknown road is mainly used for some non-important intersections with low importance, remote places and the like. Even if the road shape of the non-important intersection is not in accordance with the practical situation, the influence on the user is very little, and the road nodes corresponding to the non-important intersection can be selected not to be used as the road nodes to be adjusted according to the actual needs.
Therefore, the number of roads with road names connected by the road nodes to be adjusted can be set to be not lower than the second threshold value of the number of roads. The second threshold may be 2 or some other value, so as to ensure that the second threshold does not exceed the first threshold.
3) The number of the roads of which the road node connection type is an up-down line or a crossing line is not less than a third road strip number threshold, and the third road strip number threshold is not more than the first road strip number threshold.
Wherein, the up-down line or the intersection line belongs to the road type and belongs to a part of the road attribute information. The upper line and the lower line are the roads which are divided into the upper line and the lower line by two line segments, namely: one road is divided up and down. The road of the road junction is the part of the upper and lower roads in the road junction.
The number of the roads of which the road types connected with the road nodes to be adjusted are upper and lower lines or intersection lines is not lower than the threshold value of the number of the third roads, so that the road shape adjusting scheme is only used for important intersections, and the workload is reduced. Of course, this condition may be abandoned if it is necessary to implement the road shape adjustment scheme of the present application also for other non-important intersections.
The third road strip number threshold may be 1 or other values, so as to ensure that the third road strip number threshold does not exceed the first road strip number threshold.
In another embodiment of the present application, a specific implementation process of determining a trend section in the sections included in the road for each road of the road node connection to be adjusted in step S100 is described.
Because the auxiliary road is bent when converging into the node, the actual direction of the auxiliary road at the intersection is not the direction of a section of broken line connecting the node. In order to estimate the real direction of the road, the trend road section can be determined according to the distance between the nodes contained in the road, and then the direction of the trend road section is taken as the trend direction of the road, and the trend direction is taken as the real direction of the road. The specific implementation mode comprises the following steps:
and for each road connected with the road node to be adjusted, traversing the nodes of the road one by taking the road node to be adjusted as a starting point until the length of the road section between the currently traversed node and the previously traversed node is greater than a first road section length threshold, and taking the road section between the previously traversed node and the currently traversed node as a trend road section.
Wherein, the directions of the trend road section are as follows: of the two end points forming the trend road section, one end point far away from the road node to be adjusted points to the direction close to the end point of the road node to be adjusted, namely: and the direction from the currently traversed node to the previously traversed node is the direction from the currently traversed node to the previously traversed node, wherein the previously traversed node is an end point of the trend road section, which is close to the road node to be adjusted.
It can be understood that, since the auxiliary road is bent when merging into the node in the electronic map, the nodes included in the segment of the broken line or arc line are relatively denser. Therefore, within a distance of the road close to the road node to be adjusted, the first road segment close to the road node to be adjusted and with the length of the road segment larger than the threshold value of the length of the first road segment can indicate the trend direction of the road close to the road node to be adjusted.
Still referring to fig. 3:
the road L2 to which the road node O1 to be adjusted is connected will be described as an example. And traversing each node of the L2 one by one from the O1 point until the node O11 is traversed, if the distance between the O11 and the O12 is determined to be larger than the first road segment length threshold, determining the road segments from the O11 to the O12 as trend road segments, wherein the direction of the trend road segments is the trend direction of the road L2.
It should be further noted that, before determining the trend section in the above manner, it is also possible to add: aiming at each road connected with the road nodes to be adjusted, the nodes of the road are thinned. It should be understood by those skilled in the art that if the process of rarefying the nodes of the road is added, the rarefied nodes are traversed in the process of determining the trend section.
By thinning the nodes of the road, the length threshold of the first road section can be enlarged to find a sufficiently long road section as a trend road section, and the accuracy of the determined trend direction is ensured.
For the road node rarefying process, the specific implementation may include:
and for each road connected with the road node to be adjusted, traversing the nodes of the road one by taking the road node to be adjusted as a starting point, and deleting the currently traversed node until the last node of the road is traversed if the length of a road section between the currently traversed node and the previously traversed node is smaller than a second road section length threshold, wherein the second road section length threshold is smaller than the first road section length threshold.
In another embodiment of the present application, a process of determining a target road in which road shape adjustment needs to be performed according to a trend direction of each road connected by the road node to be adjusted in step S110 is described, where the detailed implementation process may be as shown in fig. 5, and includes:
s200, calculating an included angle between the trend directions of any two roads according to the trend directions of the roads connected with the road node to be adjusted;
step S210, clustering each road connected with the road node to be adjusted according to the included angle of the trend directions of any two roads to obtain two road cluster clusters;
and during clustering, the roads with smaller included angles in the trend directions are clustered into a road cluster. And clustering according to the included angle of the trend direction, and gathering each road connected with the road node to be adjusted into two road clustering clusters.
S220, combining the roads in each road cluster in pairs to obtain a combined candidate adjustment road pair;
it will be appreciated that roads for which road shape adjustment is typically required are all present in the primary and secondary pairs of roads, which are typically parallel or at a small angle. Therefore, in the step, the roads in each road cluster are combined pairwise to obtain a combined candidate adjustment road pair.
Step S230, if at least one road in the candidate adjustment road pair is a side road, or the road names of the two roads are the same or compatible, judging whether the road grades of the two roads in the candidate adjustment road pair are the same;
specifically, it has been described above that the road to be adjusted in road shape is generally the road in the primary and secondary road pair, and the road names of the two roads in the primary and secondary road pair are generally the same or compatible. The road names are consistent, that is, the two road names have an inclusion relationship, such as the road name "Yuquan road" and the road name "Yuquan road auxiliary road" form a consistent relationship.
In this step, if it is determined that one of the candidate adjusted road pairs is a side road, or the road names of the two roads are the same or compatible, it may be determined that at least one candidate target road exists in the candidate adjusted road pair. Based on this, it is further determined whether the road ranks of the two roads in the adjustment candidate road pair are the same.
Step S240, if the two roads are the same, determining both the two roads in the candidate adjustment road pair as candidate target roads, and if the two roads are different, determining one road with a low road grade as a candidate target road;
specifically, if the road ranks of two roads are the same, both of the two roads may be determined as candidate target roads, and if the road ranks of the two roads are not the same, one road with a low road rank may be determined as a sub road, and thus only the road with the low road rank is determined as a candidate target road.
In step S250, the candidate target road satisfying the set road adjustment condition is determined as the target road.
Specifically, the present application may preset a road adjustment condition, and then determine a candidate target road satisfying the set road adjustment condition as the target road.
The set road adjustment condition may be flexibly combined according to an actual situation, and optionally, the set road adjustment condition may include one or more of the following conditions:
1) the road type is one of a side road, a common road and a bicycle borrowing road;
2) the length of the road section from the adjustment starting point to the road node to be adjusted in the road does not exceed a third road section length threshold value;
specifically, the adjustment starting point is one end of the trend road segment close to the road node to be adjusted, the length of the road segment from the adjustment starting point to the road node to be adjusted in the road cannot be too long, otherwise, the road cannot be determined as the target road.
3) And the included angle between the direction of the road section from the adjustment starting point to the road node to be adjusted in the road and the trend direction of the road is greater than a set included angle threshold value.
Specifically, for a road segment between the adjustment starting point and a road node to be adjusted in the road, if an included angle between the direction of the road segment and the trend direction of the road is not greater than a set included angle threshold value, that is, the included angle is too small, the effect of the adjustment scheme is not obvious, and adjustment is not needed. For the sake of distinction from the following, the angle threshold herein is defined as a second angle threshold.
Of course, the above examples only illustrate several optional road adjustment conditions, and other road adjustment conditions may be set according to actual needs. In the process of determining the target road described in the above embodiment, where step S230 involves determining whether the road names of two roads in the candidate adjusted road pair are the same or consistent, and since part of the roads in the electronic map may not have stored the road names before, the present application may add a process of assigning road names to unknown roads before step S230, which may be described in detail with reference to fig. 6, and includes:
step S300, dividing roads connected with the road nodes to be adjusted into two types according to whether road names are set or not to obtain a named road set and an unknown road set;
the named road set stores roads with road names, and the unknown road set stores roads without road names.
Step S310, judging whether a matched famous road exists in the famous road set or not for each famous road in the famous road set; if not, executing step S320, and if yes, executing step S330;
the matched famous road is the famous road with an included angle with the trend direction of the unknown road smaller than a first included angle threshold value.
Step S320, a unique and non-repeated road name is assigned to the unknown road;
specifically, if there is no famous road in the set of famous roads whose angle with the trend direction of the unknown road is smaller than the first angle threshold, it indicates that there is no famous road in the set of famous roads which is parallel or approximately parallel to the unknown road, so that a unique and non-repeating road name can be assigned to the unknown road.
Step S330, judging whether the unknown road and the target named road meet the position relation or not aiming at the matched target named road; if not, go to step S320, if yes, go to step S340;
and step S340, the road name of the named road is designated as the road name of the unknown road.
Wherein, the above-mentioned position relation may include: and relative to a normal line which passes through the road node to be adjusted and is perpendicular to the trend direction of the unknown road, the unknown road and the target named road are positioned on the same side of the normal line.
It will be appreciated that for a primary and secondary road pair, the road names of the two roads may be the same. However, the main and auxiliary road pairs must be located on the same side of the normal passing through the road node to be adjusted.
The description is made in connection with the example cases of fig. 7a-7 c:
in fig. 7a-7c, L1 is a nameless road, L2 is a named road, and O1 is a road node to be adjusted. The road node O1 to be adjusted is passed and is perpendicular to the normal of the trend direction of the unknown road L1, as shown by the dotted line in the figure.
In the example of fig. 7a, the angle between L1 and L2 is smaller than the first angle threshold, and L1 and L2 are on the same side of the normal, so the road name of L2 can be assigned to L1.
In the example of fig. 7b, the angle between L1 and L2 is not less than the first angle threshold, and L1 may be assigned a unique and non-repeating road name.
In the example of fig. 7c, the angle between L1 and L2 is smaller than the first angle threshold, but L1 and L2 are on both sides of the normal, and L1 may be assigned a unique and non-repeating road name.
In another embodiment of the application, for step S210, the process of clustering the roads connected to the road node to be adjusted according to the included angle between the trend directions of any two roads to obtain two road cluster clusters is introduced, where the detailed implementation process may be as shown in fig. 8, and includes:
s400, adding two roads with the largest included angle into different clustering clusters respectively;
specifically, for each road connected by the road node to be adjusted, the size of the included angle has been calculated for the trend directions of any two roads. In the step, two roads with the largest included angle are selected and added into different clustering clusters respectively.
Optionally, if the included angle of the trend directions of the two roads with the largest included angle is found to be lower than the set included angle threshold, in order to avoid classification errors caused by too small included angle, the road shape adjustment of each road connected to the road node to be adjusted may be abandoned.
And S410, adding other roads connected with the road nodes to be adjusted into a cluster where the road with the smaller included angle is located according to the included angle between the trend direction of the road and the trend direction of the two roads with the largest included angle.
Taking the two roads with the largest included angle as the road 1 and the road 2 as an example, aiming at other roads connected with the road node to be adjusted, according to the included angles between the trend direction of the road and the trend directions of the road 1 and the road 2, selecting one of the road 1 and the road 2 with a smaller included angle, and adding the selected one into the cluster where the road is located. For example, the angle between the road x and the trend direction of the road 1 is θ 1, the angle between the road x and the trend direction of the road 2 is θ 2, and θ 1 < θ 2, so the road x is added to the cluster where the road 1 is located.
Taking the case illustrated in fig. 1 as an example:
firstly, the included angle range of two roads is defined as [0 degree, 90 degree ] road L1-L5, the two roads with the largest included angle are L3 and L4, and the included angle is 90 degrees.
Link L3 was added to the first cluster 1 and link L4 was added to the second cluster 2.
Road L1, whose heading is at a smaller angle to L4 than to L3, was therefore added to road L1 in the second cluster 2.
Road L2, whose heading is at a smaller angle to L4 than to L3, was therefore added to road L2 in the second cluster 2.
The road L5, whose trend direction is at a smaller angle to L3 than to L4, therefore adds road L5 to the first cluster 1.
In another embodiment of the present application, regarding step S220, a process of combining the roads in each road cluster two by two to obtain a combined candidate adjustment road pair is introduced, and a detailed implementation process may be shown in fig. 9, and includes:
s500, calculating the average value of the trend directions of all roads in each road cluster, and taking the average value as the passing direction of the roads in the road cluster;
the passing directions of the roads in the two road cluster clusters are opposite to each other.
Step S510, calculating the outer product of the trend direction of the road and the relative traffic direction of the road aiming at each road in each road cluster;
specifically, by calculating the outer product of the trend direction of the road and its relative traffic direction, it can be determined that the road is located on the left or right side of its relative traffic direction from the positive or negative value of the outer product.
Step S520, if the outer product is a positive value, dividing the road into one sub-road cluster under the corresponding road cluster, and if the outer product is a negative value, dividing the road into the other sub-road cluster under the corresponding road cluster;
specifically, the foregoing roads to which the road nodes to be processed are connected have been divided into two cluster clusters. For ease of understanding, cluster 1 and cluster 2 are defined. The passing direction of the cluster 1 and the passing direction of the cluster 2 are opposite to each other.
In this embodiment, for each cluster, the cluster is divided into different sub-clusters according to the difference between the positive and negative values of the outer product of the trend direction of the road in the cluster and the relative traffic direction of the road in the cluster.
Taking the road L3 in the cluster 1 as an example, if the outer product of the trend direction of L3 and the relative traffic direction is positive, dividing the road L3 into a sub-cluster 11 under the cluster 1; if the outer product of the trend direction of L3 and its relative traffic direction is negative, then road L3 is divided into another sub-cluster 12 under cluster 1.
Taking the road L2 in the cluster 2 as an example, if the outer product of the trend direction of L2 and the relative traffic direction is positive, dividing the road L2 into a sub-cluster 21 under the cluster 2; if the outer product of the trend direction of L2 and its relative traffic direction is negative, then road L2 is divided into another sub-cluster 22 under cluster 2.
And S530, combining every two roads in each sub-road cluster under each road cluster to serve as a candidate adjusting road pair.
It will be appreciated that the primary and secondary pairs are generally on the same side thereof relative to the direction of travel. Therefore, the method and the device aim at sub-road cluster clusters under each road cluster, and pairwise combination of roads in the sub-road cluster clusters is used as a candidate adjustment road pair.
In the above embodiment, a further dividing manner of each road in the cluster 2 after each road in fig. 1 is clustered is described. The cluster 2 includes roads L1, L2, and L4.
Referring to fig. 10, a process of sub-dividing the cluster 2 is illustrated.
By calculating the outer product of each road in the cluster 2 and the relative traffic direction, the left and right position relationship between each road in the cluster 2 and the relative traffic direction can be determined, and then the roads L1 and L2 are divided into the sub-cluster 21, and the road L4 is divided into the sub-cluster 22.
Based on the determination method of the candidate adjusted road pair described in the previous embodiment, in step S120, a process of taking any point in the trend section in the target road as a starting point, making a ray along the trend direction of the target road, where a first intersection point generated by intersection of the ray and the road connected with the road node to be adjusted is taken as a destination point may specifically include:
taking any point in the trend road section in the target road as a starting point, making a ray along the trend direction of the target road, and taking a first intersection point generated by intersection of the ray and the road in the relative passing direction of the target road as a target point.
It can be understood that the intersection point is possible to be the destination point only if the ray intersects with the road in the opposite traffic direction of the target road, otherwise, the ray intersects with other roads in the cluster where the target road is located, so that the same-direction road self-crossing is generated, and the situation is not true.
Referring to fig. 11, where the road L1 belongs to cluster 1, and the roads L2 and L3 belong to cluster 2. Rays are taken from the end of the trend section of the road L1 in the trend direction, and the rays create intersections O2 and O3 with the roads L2 and L3, respectively, which are opposite to the direction of traffic. The first intersection O2 of the ray with the road in the opposite traffic direction is taken as the destination point.
Further, in step S130, before adjusting the road segment from the adjustment starting point to the road node to be adjusted in the target road to the line segment from the adjustment starting point to the destination point, an auto-crossing detection process may be further added, that is, whether the adjusted line segment will intersect with other roads in the road cluster where the target road is located may be detected, which specifically includes:
judging whether a road cluster in which the target road is located exists or not and a road which is intersected with a line segment from the adjustment starting point to the destination point;
if not, executing the step of adjusting the road section between the adjustment starting point and the road node to be adjusted in the target road into a line section between the adjustment starting point and the destination point.
If so, the road shape adjustment of the target road is abandoned.
Referring to fig. 12, the road L1 and the road L2 belong to the same road cluster, and the road L3 belongs to another road cluster.
According to the scheme, rays are taken from one end of the trend section of the road L1 close to the road node to be adjusted along the trend direction, and the rays and the road L3 in the opposite traffic direction generate a first intersection O3 which is used as a destination point.
Further, the method can also be used for judging whether a line segment from one end of the trend road section close to the road node to be adjusted to the destination point intersects with other roads in the road cluster where the target road L1 is located. The detection finds that the intersection with the road L2 generates the intersection O2, which indicates that the adjustment scheme will generate road selfing, which obviously does not meet the actual situation, so the road shape adjustment process for the target road L1 can be abandoned.
In another embodiment of the present application, on the basis of any of the above embodiments, in order to ensure that the road shape adjustment is error-free, after the road shape adjustment is completed on each target road connected to the road node to be adjusted, a process of verifying the adjustment result of each target road connected to the road node to be adjusted may be added. And the verification ensures that the road shape adjusting schemes of all target roads connected with the same road node to be processed do not contradict each other.
The verification process may include:
and if the two target road sections after the adjustment intersect, taking the intersection point generated by the intersection as the end point of each item of road section after the adjustment.
Referring to the illustration, referring to FIG. 13 a:
the road node to be adjusted is O1, and the target roads needing road shape adjustment in the roads connected with the node include L2 and L3.
L2 makes an intersection O2 with the road L4 in the opposite traffic direction as a destination point from the end of the trend link making a ray in the trend direction.
L3 makes an intersection O3 with the road L1 in the opposite traffic direction as a destination point from the end of the trend link making a ray in the trend direction.
Through verification, a line segment from the tail end of the L2 trend link to the destination point O2 intersects a line segment from the tail end of the L3 trend link to the destination point O3, and the intersection point is O4.
Therefore, the intersection O4 can be used as the end point of the link after the adjustment of each of the L2 and L3, and the adjusted link shape is shown in fig. 13 b.
Furthermore, on the basis of any of the above embodiments, after the road shape adjustment is completed for each target road connected to each road node to be adjusted in the road network, a process of verifying the adjustment result for each target road connected to each road node to be adjusted may be further added. Through verification, the road shape adjusting schemes of the target roads connected with different road nodes to be processed are ensured not to be contradictory.
The verification process may include:
determining a target road connected with a road node to be adjusted, and determining whether other nodes except the road node to be adjusted exist in a set distance range around the determined target point during road shape adjustment;
if other nodes exist, determining whether the distance from the destination point to the other nodes is smaller than the road width of the road where the other nodes are located;
and if so, canceling the road shape adjusting process of the target road.
Through the verification mode, the situation that conflict occurs in the generation calculation of the three-dimensional view intersection is avoided.
The adjustment process is explained with reference to the figure, as shown in fig. 14:
the destination point of the target road L1 connected with the road node O1 to be adjusted after the route adjustment is O2. Verification shows that other nodes O3 exist near O2, and the distance between O2 and O3 is smaller than the road width of the road on which O3 is located.
Therefore, in order to avoid collision when the three-dimensional view intersection is generated subsequently, the method and the device can cancel the road shape adjusting process of the target road L1.
The following describes a road shape adjusting device provided in an embodiment of the present application, and the road shape adjusting device described below and the road shape adjusting method described above may be referred to correspondingly.
Referring to fig. 15, fig. 15 is a schematic structural diagram of a road shape adjusting device disclosed in the embodiment of the present application. As shown in fig. 15, the apparatus includes:
the trend roadsection determining unit 11 is configured to determine a trend road section in road sections included in a road for each road connected by a road node to be adjusted, and determine a direction of the trend road section as a trend direction of the road;
a targetroad determining unit 12, configured to determine, according to a trend direction of each road connected to the road node to be adjusted, a target road on which road shape adjustment is required;
a destinationpoint determining unit 13, configured to take any point in the trend road segment in the target road as a starting point, and make a ray along a trend direction of the target road, where a first intersection point generated by intersection of the ray and the road connected with the road node to be adjusted is taken as a destination point;
and a roadsegment adjusting unit 14, configured to use one end of the trend road segment close to the road node to be adjusted as an adjustment starting point, and adjust a road segment in the target road from the adjustment starting point to the road node to be adjusted into a line segment from the adjustment starting point to the destination point.
Optionally, the apparatus of the present application may further include:
a road node obtaining unit, configured to obtain, as a road node to be adjusted, a road node that satisfies a set node adjustment condition before determining a trend road segment in road segments included in the roads, for each road to which the road node to be adjusted is connected, where the set node adjustment condition includes one or more of the following conditions:
the number of roads connected by the road nodes is not less than the first road number threshold;
the number of roads which are connected with the road nodes and provided with road names is not lower than a second road number threshold value, and the second road number threshold value is not higher than the first road number threshold value;
the road type of the road node connection is that the number of the roads of the upper and lower lines or the intersection line is not less than a third road number threshold value, and the third road number threshold value is not more than the first road number threshold value.
Optionally, the process of determining the trend section in the section included in the road by the trend section determining unit for each road connected with the road node to be adjusted may include:
and for each road connected with the road node to be adjusted, traversing the nodes of the road one by taking the road node to be adjusted as a starting point until the length of the road section between the currently traversed node and the previously traversed node is greater than a first road section length threshold, and taking the road section between the previously traversed node and the currently traversed node as a trend road section.
Optionally, the apparatus of the present application may further include:
and the node rarefying unit is used for rarefying the nodes of the road aiming at each road connected with the nodes of the road to be adjusted before the trend road section determining unit traverses the nodes of the road one by taking the nodes of the road to be adjusted as starting points.
Optionally, the node rarefying unit may perform a process of rarefying nodes of the road for each road connected to the road node to be adjusted, where the process includes:
and for each road connected with the road node to be adjusted, traversing the nodes of the road one by taking the road node to be adjusted as a starting point, and deleting the currently traversed node until the last node of the road is traversed if the length of a road section between the currently traversed node and the previously traversed node is smaller than a second road section length threshold, wherein the second road section length threshold is smaller than the first road section length threshold.
Optionally, the process of determining, by the target road determining unit, a target road in which road shape adjustment is required according to the trend direction of each road connected to the road node to be adjusted may specifically include:
calculating the included angle of the trend directions of any two roads according to the trend directions of all the roads connected with the road node to be adjusted;
clustering each road connected with the road node to be adjusted according to the included angle of the trend directions of any two roads to obtain two road cluster clusters;
combining the roads in each road cluster in pairs to obtain a combined candidate adjustment road pair;
if at least one road in the candidate adjusting road pair is a side road, or the road names of the two roads are the same or compatible, judging whether the road grades of the two roads in the candidate adjusting road pair are the same or not;
if the two roads are the same, determining both the two roads in the candidate adjustment road pair as candidate target roads, and if the two roads are different, determining one road with a low road grade as a candidate target road;
the candidate target road satisfying the set road adjustment condition is determined as the target road.
Optionally, the target road determining unit clusters the roads connected to the road node to be adjusted according to an included angle between trend directions of any two roads, so as to obtain a process of clustering two roads, which may specifically include:
adding two roads with the largest included angle into different clustering clusters respectively;
and adding other roads connected with the road nodes to be adjusted into the cluster where the road with the smaller included angle is located according to the included angle between the trend direction of the road and the trend direction of the two roads with the largest included angle.
Optionally, the target road determining unit may combine the roads in each road cluster two by two to obtain a combined candidate adjusted road pair, and specifically may include:
calculating the average value of the trend directions of all roads in each road cluster as the passing direction of the roads in the road cluster, wherein the passing directions of the roads in the two road clusters are opposite to each other;
calculating the outer product of the trend direction of the road and the relative traffic direction of the road aiming at each road in each road cluster;
if the outer product is a positive value, dividing the road into one sub-road cluster under the corresponding road cluster, and if the outer product is a negative value, dividing the road into the other sub-road cluster under the corresponding road cluster;
and combining the roads in the sub-road cluster under each road cluster in pairs as candidate adjusting road pairs.
Optionally, the apparatus of the present application may further include: a road name assignment unit for:
before the target road determining unit determines whether the road names of two roads in the candidate adjusting road pair are the same or compatible, dividing the roads connected with the road nodes to be adjusted into two types according to whether the road names are set, and obtaining a named road set and an unknown road set;
judging whether a famous road with an included angle smaller than a first included angle threshold value with the trend direction exists in the famous road set or not for each famous road in the famous road set;
if the unknown road does not exist, a unique and non-repeated road name is assigned to the unknown road;
if the target famous road exists, judging whether the nameless road and the target famous road are positioned on the same side of a normal line which passes through the road node to be adjusted and is perpendicular to the trend direction of the nameless road or not;
if not, a unique and unrepeated road name is appointed to the nameless road;
and if so, designating the road name of the named road as the road name of the unknown road.
Optionally, the setting of the road adjustment condition may include:
the road type is one of a side road, a common road and a bicycle borrowing road; and/or the presence of a gas in the gas,
the length of the road section from the adjustment starting point to the road node to be adjusted in the road does not exceed a third road section length threshold value; and/or the presence of a gas in the gas,
and the included angle between the direction of the road section from the adjustment starting point to the road node to be adjusted in the road and the trend direction of the road is greater than a second included angle threshold value.
Optionally, the process that the destination point determining unit uses any point in the trend road segment in the target road as a starting point, and makes a ray along the trend direction of the target road, where a first intersection point generated by intersection of the ray and the road connected with the road node to be adjusted is used as a destination point may specifically include:
taking any point in the trend road section in the target road as a starting point, making a ray along the trend direction of the target road, and taking a first intersection point generated by intersection of the ray and the road in the relative passing direction of the target road as a target point.
Optionally, the apparatus of the present application may further include:
the intersection judging unit is used for judging whether a road cluster where the target road is located exists or not and a road which is intersected with a line segment from the adjusting starting point to the destination point; and if the road section does not exist, executing the road section adjusting unit.
Optionally, the apparatus of the present application may further include: the first adjustment result verification unit is used for verifying the adjustment result of each target road after the road shape adjustment of each target road connected with the road node to be adjusted is completed, and the verification process comprises the following steps:
and if the two target road sections after the adjustment intersect, taking the intersection point generated by the intersection as the end point of each item of road section after the adjustment.
Optionally, the apparatus of the present application may further include: a second adjustment result verification unit, configured to verify an adjustment result of a target road connected to each road node to be adjusted after the target road connected to each road node to be adjusted in the road network has completed road shape adjustment, where the verification process includes:
determining a target road connected with a road node to be adjusted, and determining whether other nodes except the road node to be adjusted exist in a set distance range around the determined target point during road shape adjustment;
if other nodes exist, determining whether the distance from the destination point to the other nodes is smaller than the road width of the road where the other nodes are located;
and if so, canceling the road shape adjusting process of the target road.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the use of the phrase "comprising a. -. said" to define an element does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.