Disclosure of Invention
The embodiment of the invention provides a method and a device for converting expressway longitude and latitude stake marks, which can realize high-precision expressway whole-course longitude and latitude and stake mark interconversion through lane longitude and latitude and road mileage.
In a first aspect, an embodiment of the present invention provides a method for converting longitude and latitude pile numbers of a highway, which is characterized in that the method includes the steps of:
measuring the longitude and latitude of the central line of each lane to obtain a plurality of sections of longitude and latitude coordinate sets with unique numbers;
combining the multiple sections of longitude and latitude coordinate sets with unique numbers into an ordered lane centerline longitude and latitude coordinate set through a clustering algorithm taking the distance as an objective function;
Acquiring the corresponding relation between the longitude and latitude coordinate set of the ordered lane center line and the mileage of the expressway by adopting a differential principle and generating a relation dictionary corresponding to the mileage and the coordinates;
And realizing longitude and latitude stake number conversion based on the input longitude and latitude or stake number and the relation dictionary.
In some embodiments, the method further comprises the step of:
Finding out longitude and latitude coordinates of a non-high-speed road section in the longitude and latitude coordinate set with the unique number in the multiple sections;
and deleting the longitude and latitude coordinates of the non-high-speed road section when the longitude and latitude coordinate sets with the unique numbers of the sections are combined.
In some embodiments, the method further comprises the step of:
finding out a bifurcated lane in the multi-section longitude and latitude coordinate set with the unique number;
and merging each branched lane into a new virtual lane when merging the longitude and latitude coordinate sets with the unique numbers of the multiple sections, wherein the virtual lanes belong to the ordered lanes.
In some embodiments, the merging each of the diverging lanes into a new virtual lane includes the steps of:
and sequentially adding the data points of the coordinate set after lane bifurcation, and averaging, wherein the averaged result is used as the new virtual lane.
In some embodiments, the merging the multiple segments of longitude and latitude coordinate sets with unique numbers into an ordered lane centerline longitude and latitude coordinate set by a clustering algorithm with distance as an objective function includes the steps of:
determining the number of clusters according to the number of lanes in the ordered lanes;
classifying all coordinate segments in the longitude and latitude coordinate set into corresponding cluster by a clustering algorithm taking the distance as an objective function;
classifying all the coordinate segments into corresponding cluster clusters as one-time cluster iteration and carrying out multiple-time cluster iteration, and updating the cluster center point positions of each cluster after each cluster iteration until the cluster center point positions of each cluster are not changed;
And determining the ordered lane center line longitude and latitude coordinate set based on the results after multiple clustering iterations.
In some embodiments, the classifying all coordinate segments in the longitude and latitude coordinate set into corresponding cluster by a clustering algorithm with a distance as an objective function includes the steps of:
Arbitrarily selecting coordinate segments from the longitude and latitude coordinate set as a cluster center point starting position of each cluster;
And calculating the distance from the central point of each section of coordinates in the longitude and latitude coordinate set to the starting position of each clustering central point, and classifying each section of coordinates into a cluster with the shortest distance.
In some embodiments, the objective function comprises:
wherein dis is the distance between two longitude and latitude coordinate points, a is the difference value after the longitude of the two points is converted into radian, b is the difference value after the latitude of the two points is converted into radian, R1 is the longitude of the first point is converted into radian, R2 is the longitude of the second point is converted into radian, and earthR is the earth radius.
In some embodiments, the updating the cluster center point of each cluster includes the steps of:
and enabling the clustering center point position of the new cluster to be the center of the corresponding classified data set.
In some embodiments, the obtaining the correspondence between the longitude and latitude coordinate set of the ordered lane centerline and the mileage of the expressway by using the differential principle and generating the dictionary of the correspondence between the mileage and the coordinates includes the steps of:
dividing the mileage by the number of points in the longitude and latitude coordinate set of the ordered lane center line to obtain the average mileage interval between coordinate points;
determining a relation dictionary of the mileage and coordinates based on a second formula, wherein the second formula comprises k j+x0 x i=set [ i ],
Wherein x 0 represents the average mileage interval, k j represents the lane number, and Set [ i ] represents the ith coordinate point in the ordered lane coordinate Set.
In a second aspect, an embodiment of the present invention provides a highway longitude and latitude pile number conversion device, which is characterized in that the device includes the steps of:
the coordinate set acquisition module is used for measuring the longitude and latitude of the central line of each lane to acquire a plurality of sections of longitude and latitude coordinate sets with unique numbers;
The lane merging module is used for merging the multiple sections of longitude and latitude coordinate sets with unique numbers into an ordered lane center line longitude and latitude coordinate set through a clustering algorithm taking the distance as an objective function;
The relation dictionary generating module is used for acquiring the corresponding relation between the ordered lane center line longitude and latitude coordinate set and the expressway mileage by adopting a differential principle and generating a relation dictionary corresponding to the mileage and the coordinates;
And the conversion module is used for realizing longitude and latitude stake number conversion based on the input longitude and latitude or stake number and the relation dictionary.
The embodiment of the invention provides a method and a device for converting longitude and latitude stake marks of a highway. The method comprises the steps of processing a high-precision longitude and latitude coordinate set by using a clustering algorithm, obtaining an ordered high-precision lane coordinate set by clustering unordered longitude and latitude coordinate data, equally dividing mileage by using differential thought coordinates to obtain a corresponding relation between coordinates and mileage, and enabling dense characteristics of the longitude and latitude coordinate set to be played, enabling fine places to be visible as straight, further achieving one-to-one correspondence between the longitude and latitude set and stake marks without calibration, and enabling the whole longitude and latitude and stake marks of a high-precision expressway to be converted.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, the embodiment of the invention provides a method for converting longitude and latitude pile numbers of a highway, which comprises the following steps:
s100, measuring the longitude and latitude of the center line of each lane, and obtaining a plurality of sections of longitude and latitude coordinate sets with unique numbers;
s200, combining the multiple sections of longitude and latitude coordinate sets with unique numbers into an ordered lane center line longitude and latitude coordinate set through a clustering algorithm with the distance as an objective function;
S300, acquiring the corresponding relation between the ordered longitude and latitude coordinate set of the lane center line and the mileage of the expressway by adopting a differential principle, and generating a relation dictionary corresponding to the mileage and the coordinates;
s400, realizing longitude and latitude stake number conversion based on the input longitude and latitude or stake number and the relation dictionary.
It will be appreciated that the collection of the coordinate sets is performed in a sequence, such as automatically by the machine when dotting is used.
The embodiment of the invention provides a method and a device for converting longitude and latitude stake marks of a highway. The method comprises the steps of processing a high-precision longitude and latitude coordinate set by using a clustering algorithm, obtaining an ordered high-precision lane coordinate set by clustering unordered longitude and latitude coordinate data, and meanwhile, equally dividing mileage by using differential thought coordinates to obtain a corresponding relation between coordinates and mileage, so that the dense characteristic of the longitude and latitude coordinate set can be exerted, a fine place is directly seen, further, the one-to-one correspondence between a non-calibrated longitude and latitude set and stake marks is realized, and the whole-course longitude and latitude and stake marks of a highway with high precision can be converted with each other.
In some embodiments, when the longitude and latitude coordinate set of the lane center line is obtained in S100, the acquired coordinate format is a segmented longitude and latitude set, the coordinates in each segment of coordinate set are ordered, and the whole set is unordered. Compared with the method of collecting data according to the position mark of the integer mileage in the related art, the method of directly collecting the line coordinate set in the lane of the present embodiment can achieve the effect of high accuracy in the longitude and latitude set if the selection interval is small, for example, 0.5 meter.
In some embodiments, S200 further comprises, before merging the multiple segments of longitude and latitude coordinate sets with unique numbers into the ordered lane centerline longitude and latitude coordinate set, the steps of:
S201, finding out longitude and latitude coordinates of a non-high-speed road section in the longitude and latitude coordinate set with the unique number in the multiple sections;
And S202, deleting the longitude and latitude coordinates of the non-high-speed road section when the longitude and latitude coordinate sets with the unique numbers of the sections are combined.
In view of the complexity of the road, the measurement result may include longitude and latitude coordinates of many non-expressway sections, and these coordinate sets may be found by QGIS, where the coordinate sets of the non-expressway sections are deleted when merging the longitude and latitude coordinates of the expressway (i.e., merging into an ordered set of longitude and latitude coordinates in the lane).
In some embodiments, S200 further comprises, before merging the multiple segments of longitude and latitude coordinate sets with unique numbers into the ordered lane centerline longitude and latitude coordinate set, the steps of:
S203, finding out a bifurcation lane in the longitude and latitude coordinate set with the unique number in the multiple sections;
S204, merging each branched lane into a new virtual lane when merging the longitude and latitude coordinate sets with the unique numbers of the multiple sections, wherein the virtual lanes belong to the ordered lanes.
The present embodiment considers that there are many lane increases designed to reduce congestion in an expressway, and one lane may be connected to a plurality of front lanes, resulting in a lane bifurcation phenomenon. This part of latitude and longitude data can also be clearly seen in QGIS. For this part of data, for uniformity of the number of lanes, the branched lanes may be combined into one lane by averaging the longitude and latitude sets.
Preferably, when each of the branched lanes is merged into a new virtual lane in S204, the data points of the coordinate set after lane branching may be sequentially added and averaged, and the averaged result may be used as the new virtual lane.
In some embodiments, S200 comprises the steps of:
s210, determining the number of clusters according to the number of lanes in the ordered lanes;
s220, classifying all coordinate segments in the longitude and latitude coordinate set into corresponding cluster by a clustering algorithm taking the distance as an objective function;
S230, classifying all the coordinate segments into corresponding cluster clusters as one-time clustering iteration and carrying out multiple clustering iterations, and updating the clustering center point positions of each cluster after each clustering iteration until the clustering center point positions of each cluster are not changed;
s240, determining the ordered lane center line longitude and latitude coordinate set based on the results after multiple clustering iterations.
It should be noted that, in S210, the number of clusters is determined according to the number of actual lanes, and if there are 8 lanes actually, there are 8 clusters.
In some embodiments, S220 comprises the steps of:
s221, arbitrarily selecting coordinate segments from the longitude and latitude coordinate set as a cluster center point starting position of each cluster;
S222, calculating the distance from the central point of each section of coordinates in the longitude and latitude coordinate set to the starting position of each clustering central point, and classifying each section of coordinates into a cluster with the shortest distance.
Preferably, the objective function includes:
wherein dis is the distance between two longitude and latitude coordinate points, a is the difference value after the longitude of the two points is converted into radian, b is the difference value after the latitude of the two points is converted into radian, R1 is the longitude of the first point is converted into radian, R2 is the longitude of the second point is converted into radian, and earthR is the earth radius.
Preferably, when the cluster center point position of each cluster is updated, the cluster center point position of the new cluster may be made to be the center of the corresponding classified data set. It can be understood that the elements in the data set are unordered, segmented longitude and latitude coordinate points, and each segment of coordinate points is ordered.
In some embodiments, S300 comprises the steps of:
S310, dividing the mileage by the number of points in the longitude and latitude coordinate set of the ordered lane center line to obtain the average mileage interval between the coordinate points;
S320, determining a relation dictionary corresponding to the mileage and the coordinates based on a second formula, wherein the second formula comprises k j+x0 x i=set [ i ],
Wherein x 0 represents the average mileage interval, k j represents the lane number, and Set [ i ] represents the ith coordinate point in the ordered lane coordinate Set.
It is understood that since the coordinate sets having the smaller interval are acquired in S100, the curved road section within the short distance may be regarded as a straight line. Meanwhile, the dotting speed and the time interval are unchanged, and the coordinate points can be regarded as consistent intervals. Thus, the average mileage interval between coordinate points can be obtained by dividing the mileage by the number of points in the coordinate set. And each coordinate point corresponds to the number of intervals one by one, so that the corresponding relation between longitude and latitude and mileage can be obtained. And S400, when the longitude and latitude or the stake number is input, searching for the nearest point, and completing the corresponding conversion.
In a specific embodiment, the number of lanes is set to 8, i.e., the number of clusters is 8. Firstly, randomly selecting a central point of 8 sections of coordinates from a collected longitude and latitude coordinate set as a clustering central point starting position of each cluster;
Then calculating the distance from the central point of each section of coordinates in the longitude and latitude coordinate set to the starting position of each cluster central point, and classifying each section of coordinates into the cluster with the shortest distance, namely x i∈Sj(Min(dis(xi,Uj)), wherein x i is the central point of the ith section in the coordinate set, S j is the jth cluster, U j is the cluster central point of S j, the value range of i is [0, the length of the coordinate set), and the value range of j is [1, the number of clusters ];
after all the coordinate segments are classified, the positions of the clustering center points of all the clustering clusters are updated to enable the new clustering center points to be the centers of all the classified data sets,
I.e.Wherein a j is the j-th coordinate set after clustering, and x is the center point of each section of coordinate set in the j-th cluster after classification. Assuming that the class 1 clustering center point obtained by the ith clustering iteration is S 1i (wherein 1 represents the lane number and represents the ith clustering center point of the lane 1), the next clustering center obtained is S 1i+1, and a center point variation value C 1i, that is, C 1i=|S1i-S1i+1 |, is obtained, and once each clustering iteration, the clustering center point coordinates are updated according to the new clustering cluster until the position of the clustering center point is no longer changed, that is: the 8 clusters obtained at this time are the final clustering results, which are the center line coordinate sets of 8 lanes.
Because the lane coordinate Set is unordered at this time, for example, when the whole lane is in the east-west direction, the longitudes become smaller in sequence, and the order can be sorted according to the sizes of the longitudes, so that an ordered lane coordinate Set is obtained.
Taking the partial coordinates of lane 1 as an example, as shown in table 1, the ID is the number of each of the acquired multi-segment coordinate sets, and is unique. The coordinate points are shown in a column to the left of the example (only 5 are listed) acquired by the corresponding ID, and hundreds of coordinate points can be actually acquired for each segment.
TABLE 1
As shown in fig. 2, corresponding dotting is formed in the process of collecting longitude and latitude coordinate points, and the dotting interval is about 0.5 meter, which can be regarded as a small pitch. The curve mileage of a short distance is regarded as a straight line according to the differential idea. Meanwhile, the dotting speed and the time interval are unchanged, and the coordinate points can be regarded as consistent intervals. Therefore, the average mileage interval x 0 between coordinate points can be obtained by dividing the mileage by the number of points in the coordinate Set, the correspondence between the pile number and the longitude and latitude is k j+x0 i=set [ i ], and the corresponding conversion can be performed by inputting the longitude and latitude or the pile number by assuming that the length of 25 coordinate points (shown in table 1) in the corresponding coordinate Set of lane 1 (Y1) is 15 meters, and x 0 =15+.25=0.6, and the correspondence dictionary between the longitude and latitude and the pile number of lane 1 is shown in table 2.
TABLE 2
For example, when converting longitude and latitude into stake numbers, a longitude and latitude coordinate point A (115.0345231,30.31839189) of a No. 1 lane to be converted can be input, a coordinate point set corresponding to the No. 1 lane is found from a relation dictionary, the distance between each coordinate point and a target coordinate point is calculated (can be calculated based on an objective function), the stake number corresponding to the longitude and latitude with the shortest distance is the target stake number, and the stake number conversion is calculated to be k0+6.0.
For example, when the pile number is converted to longitude and latitude, the uplink lane 1 pile number k0+2.5 to be converted can be input, the distance between the pile numbers in table 2 is calculated, the longitude and latitude corresponding to the nearest pile number is the target longitude and latitude, and the nearest pile number k0+2.4 and the longitude and latitude are calculated as [115.0345304,30.31842387]. In this embodiment, 8 lanes are shared, 1 to 4 are one traveling direction, and 5 to 8 are the other traveling direction. The 4 lane numbers are not 1234, but 1239,5-8 lanes are 1239, and 1 lane in the traveling direction corresponding to 1-4 is up No. 1, and 1 lane in the traveling direction corresponding to 5-8 is down 1 for distinction. It will be appreciated that since there is no k0+2.5 in Table 2, the dotting distance is about 0.6 m in this example, and thus is not an integer multiple, the closest value may be taken as the matching point.
In the practical business application of intelligent traffic, the upper layer application is concerned about information such as the specific position of the vehicle in the lane, the lane in which the vehicle is located, and the speed, lane change and the like of the vehicle. Therefore, in the corresponding relation between the longitude and the latitude and the stake marks, the longitude and the latitude only take the central line of the lane, and in the calculation mode of converting the longitude and the latitude into the stake marks, the point closest to the central line coordinate set is taken as the mapping result.
As shown in fig. 3, the embodiment of the invention further relates to a expressway longitude and latitude pile number conversion device, which comprises the following steps:
the coordinate set acquisition module is used for measuring the longitude and latitude of the central line of each lane to acquire a plurality of sections of longitude and latitude coordinate sets with unique numbers;
The lane merging module is used for merging the multiple sections of longitude and latitude coordinate sets with unique numbers into an ordered lane center line longitude and latitude coordinate set through a clustering algorithm taking the distance as an objective function;
The relation dictionary generating module is used for acquiring the corresponding relation between the ordered lane center line longitude and latitude coordinate set and the expressway mileage by adopting a differential principle and generating a relation dictionary corresponding to the mileage and the coordinates;
And the conversion module is used for realizing longitude and latitude stake number conversion based on the input longitude and latitude or stake number and the relation dictionary.
In some embodiments, the lane merge module is further to:
Finding out longitude and latitude coordinates of a non-high-speed road section in the longitude and latitude coordinate set with the unique number in the multiple sections;
and deleting the longitude and latitude coordinates of the non-high-speed road section when the longitude and latitude coordinate sets with the unique numbers of the sections are combined.
In some embodiments, the lane merge module is further to:
finding out a bifurcated lane in the multi-section longitude and latitude coordinate set with the unique number;
and merging each branched lane into a new virtual lane when merging the longitude and latitude coordinate sets with the unique numbers of the multiple sections, wherein the virtual lanes belong to the ordered lanes.
Preferably, when each of the branched lanes is combined into a new virtual lane, the data points of the coordinate set after lane branching may be sequentially added and averaged, and the averaged result is used as the new virtual lane.
In some embodiments, the lane merge module is further to:
determining the number of clusters according to the number of lanes in the ordered lanes;
classifying all coordinate segments in the longitude and latitude coordinate set into corresponding cluster by a clustering algorithm taking the distance as an objective function;
classifying all the coordinate segments into corresponding cluster clusters as one-time cluster iteration and carrying out multiple-time cluster iteration, and updating the cluster center point positions of each cluster after each cluster iteration until the cluster center point positions of each cluster are not changed;
And determining the ordered lane center line longitude and latitude coordinate set based on the results after multiple clustering iterations.
In some embodiments, the lane merge module is further to:
Arbitrarily selecting coordinate segments from the longitude and latitude coordinate set as a cluster center point starting position of each cluster;
And calculating the distance from the central point of each section of coordinates in the longitude and latitude coordinate set to the starting position of each clustering central point, and classifying each section of coordinates into a cluster with the shortest distance.
Preferably, the objective function includes:
wherein dis is the distance between two longitude and latitude coordinate points, a is the difference value after the longitude of the two points is converted into radian, b is the difference value after the latitude of the two points is converted into radian, R1 is the longitude of the first point is converted into radian, R2 is the longitude of the second point is converted into radian, and earthR is the earth radius.
Preferably, when the cluster center point position of each cluster is updated, the cluster center point position of the new cluster may be made to be the center of the corresponding classified data set.
In some embodiments, the relational dictionary generation module is further to:
dividing the mileage by the number of points in the longitude and latitude coordinate set of the ordered lane center line to obtain the average mileage interval between coordinate points;
determining a relation dictionary of the mileage and coordinates based on a second formula, wherein the second formula comprises k j+x0 x i=set [ i ],
Wherein x 0 represents the average mileage interval, k j represents the lane number, and Set [ i ] represents the ith coordinate point in the ordered lane coordinate Set.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components, for example, one physical component may have a plurality of functions, or one function or step may be cooperatively performed by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer-readable storage media, which may include computer-readable storage media (or non-transitory media) and communication media (or transitory media).
It should be noted that in the present invention, relational terms such as "first" and "second" and the like are 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. Moreover, 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, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing is only a specific embodiment of the invention to enable those skilled in the art to understand or practice the invention. 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 invention. Thus, the present invention 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.