Method for acquiring coordinates of road center line based on vehicle trajectory data
Through the method based on vehicle trajectory data, the problems of high cost, low timeliness and difficulty in dividing road rights and responsibilities of maintenance teams when relying on remote sensing surveying and mapping technology to obtain road centerline coordinates in the information management system of municipal maintenance units are solved, and the efficiency and accuracy of maintenance work are achieved.
Patent Information
- Application Number
- CN202510028275.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-06
AI Technical Summary
The existing municipal maintenance unit information management system relies on traditional remote sensing surveying and mapping technology to obtain the coordinates of the road centerline, and there are problems such as high cost, low timeliness and difficulty in dividing road rights and responsibilities of maintenance teams.
The road centerline coordinates are obtained based on vehicle trajectory data, and the road maintenance vehicle trajectory data is collected, the data is processed using the K-means clustering algorithm and sliding window technology, and the road centerline coordinates are extracted by linear fitting in combination with the least squares method.
It reduces the cost of obtaining coordinates of the road center line, improves timeliness, facilitates the maintenance team to divide road rights and responsibilities, and improves the overall efficiency and accuracy of road maintenance work.
Smart Images

Figure CN119942786A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geographic space data application, and in particular to a method for obtaining road centerline coordinates based on vehicle trajectory data. Background Art
[0002] The road centerline is a longitudinal marking line drawn in the middle of the road. It is a key feature line in the geometric design of the road line and a key control line in public transportation management. Its coordinate data, as an important data support in the field of road maintenance, meets the business needs of work order management, facility management and other business needs in the information management system of municipal maintenance units, and has an important role and value in task allocation, maintenance inspection statistics and other aspects.
[0003] Remote sensing mapping technology, as a cutting-edge technology that integrates advanced sensors from ground, aviation and aerospace platforms, focuses on detailed mapping of the surface of the Earth and other planets, and can efficiently draw maps and thematic atlases.
[0004] The existing municipal maintenance unit information management system mainly uses remote sensing mapping to obtain road centerlines, extracting relevant information by processing remote sensing images. However, this method has low flexibility and many constraints. The extracted road centerlines often require a lot of data preprocessing and interpretation operations, with complex processes and low update frequency. Specifically, there are the following significant problems:
[0005] Low timeliness: Although remote sensing mapping can efficiently extract road centerlines, its data update cycle is difficult to match the rapid changes in the road network. Dynamic information such as new road construction, renovation and expansion, and temporary closures cannot be reflected in remote sensing data in real time, resulting in maintenance teams lacking the latest road information support during field operations, affecting decision-making efficiency and execution effectiveness.
[0006] Difficulty in dividing road rights and responsibilities among maintenance teams: Remote sensing mapping obtains road center lines and divides them into units of roads. However, in maintenance work, the areas allocated to maintenance teams are often based on road sections, which requires a finer granularity. Therefore, the division method based on roads cannot meet the maintenance requirements of maintenance teams.
[0007] Fairness of assessment is affected: In the performance assessment system of maintenance companies, the road mileage inspection rate is a key indicator, and its accuracy is directly related to the fairness and effectiveness of the assessment. However, due to the data update cost and frequency limitations of traditional remote sensing mapping technology, maintenance teams need to frequently adjust maintenance areas and task allocations to adapt to frequent changes in the road network. Accordingly, the assessment content of the maintenance team must also be adjusted. Therefore, it is difficult to effectively supervise the work efficiency of the maintenance team, affecting the accuracy of the assessment results.
[0008] Precision requirements do not match cost-effectiveness: When building a maintenance management information system, the accuracy requirement for road vector coordinate data is not as high as possible. In fact, modules such as work order management, facility management, and vehicle management focus more on locating point data to specific roads, rather than the extremely high accuracy that remote sensing mapping can provide. Therefore, while existing technologies meet actual needs, they fail to maximize cost-effectiveness.
[0009] In summary, in view of the current situation of frequent updates of road networks, the municipal maintenance information management system relies on remote sensing and mapping technology to extract road centerlines and encounters many challenges. There is an urgent need for a low-cost, high-efficiency, and convenient solution for the division of road rights and responsibilities among maintenance teams, so as to improve the overall efficiency and accuracy of road maintenance work. Summary of the invention
[0010] The present invention solves the problems of high cost and low timeliness in the existing municipal maintenance unit information management system's reliance on traditional remote sensing mapping technology to obtain road centerline coordinates, as well as the difficulty in dividing road rights and responsibilities among maintenance teams, and proposes a method for obtaining road centerline coordinates based on vehicle trajectory data.
[0011] The technical solution claimed in the present invention is as follows:
[0012] A method for obtaining the coordinates of a road centerline based on vehicle trajectory data comprises the following steps:
[0013] S1: Data collection: Collect vehicle trajectory data of a certain road section, the vehicle trajectory data includes: point data, heading angle; the point data includes longitude and latitude; the vehicle trajectory data is collected by road maintenance vehicle inspection;
[0014] S2: Data processing and algorithm calculation, including the following steps:
[0015] S21: Data preprocessing: preprocessing the vehicle trajectory data collected in step S1;
[0016] S22: clustering using K-means clustering algorithm: clustering the point data in the vehicle trajectory data obtained in S21 using the K-means clustering algorithm, classifying the vehicle trajectory data corresponding to similar point data into one category, and forming multiple coordinate clusters;
[0017] S23: Heading angle processing and data sorting within clusters: for the coordinate clusters obtained in S22, the mean of the heading angles in all vehicle trajectory data within each coordinate cluster is calculated; according to the value range of the heading angle mean, all vehicle trajectory data are divided into two groups according to the point data, one group has a large change in the latitude direction, and the vehicle trajectory data within the group are sorted according to latitude; the other group has a large change in the longitude direction, and the vehicle trajectory data within the group are sorted according to longitude;
[0018] S24: Sliding window calculation: Determine the size of the sliding window according to the number of vehicle trajectory data in each coordinate cluster obtained in S23, apply the determined sliding window to the corresponding sorted coordinate cluster, calculate the mean of all point data in the window, and move the sliding window on the coordinate cluster in sequence until the entire coordinate cluster is traversed;
[0019] S25: Linear fitting and extraction of road centerline: The result calculated by each sliding window in S24 is used as the input data of linear fitting, and the least squares method is used to obtain the fitted linear equation; the network centerline coordinates of the road section corresponding to each coordinate cluster are obtained by traversing all coordinate clusters and performing linear fitting, and the network centerline coordinates corresponding to the coordinate clusters are sorted to obtain the centerline coordinates of the road section corresponding to S1.
[0020] Preferably, the road section described in S1 corresponds to the road section that the maintenance team is responsible for maintaining. When the road maintenance vehicle patrol collects vehicle trajectory data, it includes the first collection and subsequent multiple massive collections; the first collection starts from the starting point of a road section and ends at the end of the road section, and repeated collection is not allowed. During the collection process, try to keep driving in the same lane and maintain a low speed, and try to collect as many trajectory points as possible; subsequent multiple massive collections can complete the collection of vehicle trajectory data for the entire road section from any position of the road section, and the collection points are kept as dense and uniform as possible; the speed of the road maintenance vehicle patrol is less than or equal to 55km / h.
[0021] Preferably, the vehicle trajectory data also includes: license plate number, collection time, chip number, vehicle speed, and timestamp.
[0022] Preferably, the data preprocessing refers to data cleaning and screening of the collected vehicle trajectory data, and processing of abnormal values and duplicate values; the abnormal values include abnormal point data values and abnormal vehicle speed values; the abnormal point data values refer to the point data deviating from the original track; the abnormal vehicle speed value refers to the loss of the vehicle speed field, that is, the vehicle speed is 0.
[0023] In the above method, the abnormal point data value is processed as follows: compare the current point data with the point data of the previous acquisition point, and convert the point data into the actual ground distance by the Haversine formula. Assuming that the current point data is (x1, y1) and the point data of the previous acquisition point is (x0, y0), the ground distance d between the two point data is:
[0024]
[0025] Determine whether the current point data is normal based on the d value, and remove it if it is abnormal.
[0026] In the above method, the abnormal vehicle speed value is handled as follows: compare the point data corresponding to the current vehicle speed with the point data corresponding to the previous collection point and the point data corresponding to the next collection point. If the longitude and latitude are equal, the data is normal data; otherwise, calculate the average of the vehicle speeds corresponding to the previous collection point and the next collection point, and use this average as the vehicle speed of the current collection point.
[0027] Preferably, the initial number of clusters of the K-means clustering algorithm in S22 is set according to the road length of the road corresponding to the road section. If the road length does not exceed two kilometers, the initial number of clusters is set to 10; otherwise, the initial number of clusters is set to 15.
[0028] In a specific embodiment of the present invention, S23 includes the following steps:
[0029] S231: Subtract 180 degrees from the heading angles of the vehicle trajectory data in all the coordinate clusters obtained in S22 whose heading angle values exceed 180 degrees;
[0030] S232: for the coordinate clusters processed in S231, calculating the mean of the heading angles in the vehicle trajectory data in each coordinate cluster;
[0031] S233: If the value range of the mean obtained in S232 is [0,45)U[135,180), sort the point data in the vehicle trajectory data in the coordinate cluster according to latitude; if the value range of the mean obtained in S232 is [45,135), sort the point data in the vehicle trajectory data in the coordinate cluster according to longitude.
[0032] In a specific embodiment of the present invention, S24 includes the following steps:
[0033] S241: define window size: define sliding window size according to the number of vehicle trajectory data in the coordinate cluster; the sliding window size = number of vehicle trajectory data / 5;
[0034] S242: Filling the window: setting the sliding window at the beginning of the point data in the vehicle trajectory data in the coordinate cluster, and adding the point data to the window in sequence until the maximum capacity of the window is reached;
[0035] S243: Calculate the mean of the point data: sum the point data in the sliding window, divide the sum result by the window size, and obtain the mean of the point data in the sliding window;
[0036] S244: Sliding window: Move the sliding window to the right by one position, discard the leftmost point data before the sliding window moves, and add the next point data to the window;
[0037] S245: Repeat S242-S244 until the sliding window traverses the point data of all vehicle trajectory data in the coordinate cluster.
[0038] In the above method, the least squares fitting process in S25 is as follows: for each point data p i =(x i ,y i ), find the parameters Minimize the residual sum of squares:
[0039]
[0040] Among them, f(x i ,θ) is about function, n is the number of point data in the coordinate cluster; the extraction of the road centerline in S25 refers to: using the least square fitting formula to obtain the road centerline coordinates of each road section; using the point data of the cluster center of each coordinate cluster and the point data first collected by the road maintenance vehicle to calculate the Euclidean distance, sorting each coordinate cluster according to the time feature, and finally obtaining the road centerline coordinates of the road section in S1.
[0041] Beneficial effects:
[0042] The present invention provides a method for obtaining road centerline coordinates based on vehicle trajectory data. The method comprises collecting vehicle trajectory data. The vehicle trajectory data is collected by patrol inspection of road maintenance vehicles. The vehicle trajectory data is naturally generated when the road maintenance vehicles are patrolling. The data is easy to obtain and has extremely low cost, thereby reducing the manpower and operation and maintenance costs for obtaining the road centerline coordinates. At the same time, because the cost of patrol inspection of road maintenance vehicles is relatively low, when obtaining the road centerline coordinates, the frequency of using road maintenance vehicles to collect vehicle trajectory data can be increased, and the vehicle trajectory data in the road can be obtained and processed in real time, thereby solving the problem that the existing municipal maintenance unit information management system relies on traditional remote sensing sensing and mapping technology to obtain the road centerline coordinates, which has high cost and low timeliness. The method can collect and process the vehicle trajectory data of a certain road section, which is convenient for dividing the road into sections. The maintenance team vehicles are responsible for the maintenance of which sections, and they drive on the corresponding sections and collect vehicle trajectory data. The final trajectory result data is the section that the maintenance team is responsible for, avoiding the difficulty of team assessment caused by different teams responsible for maintaining different sections on the same road, and solving the problem of difficulty in dividing the road rights and responsibilities of the maintenance team of the municipal maintenance unit. In addition: according to specific rules, the vehicle trajectory data in the coordinate cluster is sorted according to the point data, so that the point data sequence is along the road direction, which can avoid the subsequent processing results from deviating from the road conditions; the sliding window is used to obtain the road centerline coordinate feature information of each road section; the least squares are used for linear fitting, and each coordinate cluster is sorted to obtain the road centerline coordinates extending in the road direction; after the above processing and algorithm calculation, the extracted road centerline coordinates can locate the specific road according to a certain point data, so it can meet the needs of work order management, facility management, vehicle management and other modules, and reduce the manpower and time costs in the construction of the remote sensing mapping system.
[0043] When the road maintenance vehicle patrols and collects vehicle trajectory data, including the first collection and subsequent multiple massive collections, as long as the road maintenance vehicle performs patrol operations, the vehicle trajectory data can be collected in time and the road centerline coordinates can be updated. Therefore, the method for obtaining the road centerline coordinates can timely reflect the latest changes in the road network, so that the maintenance team can obtain road change information in time, adjust the maintenance strategy in time, further solve the problem of low timeliness of obtaining road centerline coordinates in the existing technology, and improve the work efficiency and response speed of the maintenance team.
[0044] Preprocessing vehicle trajectories can reduce the impact of dirty data on the results and improve the accuracy and generalization ability of the K-means clustering algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a schematic diagram of the road centerline drawing results in an embodiment of the present invention.
[0046] Figure 2 It is a schematic diagram of the magnified effect of the road centerline drawing results in an embodiment of the present invention.
[0047] Figure 3 It is a flow chart of a method for obtaining the coordinates of the road centerline in an embodiment of the present invention. Specific implementation methods
[0048] In order to make the purpose, technical solution and advantages of the present invention more clear, the technical solution is further clearly and completely described below in conjunction with the accompanying drawings of the present invention.
[0049] The present invention provides a method for obtaining the coordinates of the road centerline based on vehicle trajectory data, such as Figure 3 As shown, the following steps are included:
[0050] S1: Data collection: Collect vehicle trajectory data of a certain road section, the vehicle trajectory data includes: point data, heading angle; the point data includes longitude and latitude; the vehicle trajectory data is collected by road maintenance vehicle inspection; the vehicle trajectory data also includes: license plate number, collection time, chip number, vehicle speed, timestamp; in a specific embodiment of the present invention, the road maintenance vehicle is equipped with a sensor, and the vehicle trajectory data is obtained through the sensor.
[0051] When the road is under maintenance, the road maintenance vehicles of the maintenance team only inspect the road sections that the team is responsible for maintaining. In a specific embodiment of the present invention, a certain road section corresponds to a road section that a certain maintenance team is responsible for maintaining. When the road maintenance vehicle collects vehicle trajectory data through inspection, it includes the first collection and subsequent multiple massive collections; the first collection starts from the starting point of a certain road section and ends at the end of the road section. Repeated collection is not allowed. The collection process tries to keep driving in the same lane and keep a low speed, and collects as many trajectory points as possible; the subsequent multiple massive collections can start from any position of the road section to complete the collection of vehicle trajectory data of the entire road section, and the collection points are as dense and uniform as possible; the speed of the road maintenance vehicle inspection is less than or equal to 55km / h. In fact, the vehicle trajectory data refers to the data set of vehicle trajectory data collected by the road maintenance vehicle at a certain collection point at regular intervals starting from a certain time.
[0052] S2: Data processing and algorithm calculation, including the following steps:
[0053] S21: Data preprocessing: preprocessing the vehicle trajectory data collected in step S1; in a specific embodiment of the present invention, the data preprocessing refers to data cleaning and screening of the collected vehicle trajectory data, and processing of abnormal values and duplicate values; the abnormal values include abnormal point data values and abnormal vehicle speed values; the abnormal point data value refers to the point data deviating from the original track; the abnormal vehicle speed value refers to the loss of the vehicle speed field, that is, the vehicle speed is 0.
[0054] In order to reduce the impact of abnormal data on the longitude extraction of the road centerline and improve the accuracy and generalization ability of the following K-means clustering algorithm, outliers are processed;
[0055] The processing of the abnormal point data value is as follows: The processing of the abnormal point data value is as follows: Compare the current point data with the point data of the previous acquisition point, and convert the point data into the actual ground distance through the Haversine formula. Assuming that the current point data is (x1, y1) and the point data of the previous acquisition point is (x0, y0), the ground distance d between the two point data is:
[0056]
[0057] Whether the current point data is normal is determined based on the d value. If it is abnormal, it will be eliminated. Specifically, the d value is divided by the time interval between the previous and next coordinates to obtain the driving speed of the inspection vehicle. Whether the coordinates are normal is determined based on the driving speed. If the driving speed is greater than 55km / h, the current point is abnormal.
[0058] Abnormal point data may be caused by data errors, equipment failure or other external factors. Measures should be taken to eliminate them to ensure the accuracy and reliability of the subsequent road centerline coordinate extraction and analysis process.
[0059] The abnormal vehicle speed value is processed as follows: the point data corresponding to the current vehicle speed and the point data corresponding to the previous collection point and the point data corresponding to the next collection point are calculated. If the longitude and latitude of the point data corresponding to the previous collection point are equal to the longitude and latitude of the current collection point data and the longitude and latitude of the point data corresponding to the next collection point are equal to the longitude and latitude of the previous collection point data, it means that the point data of the vehicle at the current collection point, the previous collection point and the next collection point are completely overlapped, indicating that the vehicle has not moved from the previous collection point to the next collection point, and this data is normal data; otherwise, the average of the vehicle speeds corresponding to the previous collection point and the next collection point is calculated, and this average is used as the vehicle speed of the current collection point to smooth out abnormal fluctuations in the vehicle speed; the average is the average speed of the vehicle in two adjacent time periods.
[0060] S22: Clustering using K-means clustering algorithm: Clustering the point data in the vehicle trajectory data obtained in S21 using the K-means clustering algorithm, and classify the vehicle trajectory data corresponding to similar point data into one category to form multiple coordinate clusters; in a specific embodiment of the present invention, the vehicle trajectory data is stored in the coordinate cluster, and the vehicle trajectory data is structured data, including the point data, heading angle, license plate number, collection time, chip number, vehicle speed, timestamp and cluster serial number in the vehicle trajectory data.
[0061] The K-means clustering algorithm is an unsupervised learning algorithm used to divide samples into multiple clusters with similar characteristics. Its goal is to assign samples to each cluster so that the similarity between samples within a cluster is as high as possible, while the similarity between samples in different clusters is as low as possible. In a specific embodiment of the present invention, the initial number of clusters of the K-means clustering algorithm is set according to the road length corresponding to the road section. If the road length does not exceed two kilometers, the initial number of clusters is set to 10, otherwise, the initial number of clusters is set to 15. The road length is obtained through the relevant annual report statistical table. Use the K-means clustering algorithm to divide the road section of S1 into 10 or 15 sections, and then process the vehicle trajectory data corresponding to each road section separately to extract the detailed characteristics of the road.
[0062] The specific implementation steps of the K-means clustering algorithm are as follows:
[0063] S221: Parameter initialization: randomly select K point data as the initial clustering center;
[0064] S222: Data allocation: for each point data, calculate its distance to each cluster center, and allocate the vehicle trajectory data corresponding to the point data to the coordinate cluster to which the nearest cluster center belongs;
[0065] S223: Update cluster center: calculate the mean of all point data in the coordinate cluster, and use the mean as the new cluster center;
[0066] S224: Repeat steps S222 and S223 until the cluster center no longer changes significantly, or the loop reaches a preset number of iterations; the preset number of iterations serves as a stop condition for the loop to effectively prevent the algorithm from looping infinitely; in a specific implementation of the present invention, the preset number of iterations is 300 times.
[0067] When a road maintenance vehicle patrols, it passes through different road sections, and the collected vehicle trajectory data will be intertwined, so the starting and ending points of the road section cannot be clearly separated from the time dimension. Therefore, the present invention processes the vehicle trajectory data within the road section and sorts the point data so that the point data within the coordinate cluster conforms to the road direction.
[0068] S23: Heading angle processing and data sorting within clusters: for the coordinate clusters obtained in S22, the mean of the heading angles in all vehicle trajectory data within each coordinate cluster is calculated; according to the value range of the heading angle mean, all vehicle trajectory data are divided into two groups according to the point data, one group has a large change in the latitude direction, and the vehicle trajectory data within the group are sorted according to the latitude, and the other group has a large change in the longitude direction, and the vehicle trajectory data within the group are sorted according to the longitude; specifically, the following steps are included:
[0069] S231: The trajectories of the road maintenance vehicles are all over the two-way lanes of the road. The heading angles in the vehicle trajectory data set are inverted so that the trajectories falling on the two-way lanes are along the same direction. Therefore, the heading angles of the vehicle trajectory data in all the coordinate clusters obtained in S22 with heading angle values exceeding 180 degrees are respectively subtracted by 180 degrees;
[0070] S232: for the coordinate cluster processed in S231, calculating the mean value μ of the heading angle in the vehicle trajectory data in each coordinate cluster;
[0071] S233: If the value range of the mean μ obtained by S232 is [0,45)U[135,180), it means that the direction of this road section is north-south, so the point data in the vehicle trajectory data in the coordinate cluster are sorted according to latitude; if the value range of the mean μ obtained by S232 is [45,135), it means that the direction of this road section is east-west, so the point data in the coordinate cluster are sorted according to longitude.
[0072] S24: Sliding window calculation: Determine the size of the sliding window according to the number of vehicle trajectory data in each coordinate cluster obtained in S23, apply the determined sliding window to the corresponding sorted coordinate cluster, calculate the mean of all point data in the window, and move the sliding window on the coordinate cluster in sequence until the entire coordinate cluster is traversed; specifically, the following steps are included:
[0073] S241: define window size: define sliding window size according to the number of vehicle trajectory data in the coordinate cluster; the sliding window size = number of vehicle trajectory data / 5;
[0074] S242: Filling the window: setting the sliding window at the beginning of the point data in the vehicle trajectory data in the coordinate cluster, and adding the point data to the window in sequence until the maximum capacity of the window is reached;
[0075] S243: Calculate the mean of the point data: sum the point data in the sliding window, divide the sum result by the window size, and obtain the mean of the point data in the sliding window;
[0076] S244: Sliding window: Move the sliding window to the right by one position, discard the leftmost point data before the sliding window moves, and add the next point data to the window;
[0077] S245: Repeat S242-S244 until the sliding window traverses the point data of all vehicle trajectory data in the coordinate cluster.
[0078] The sliding window processing is used to solve the array or string problem, and traverses the entire array or string with a subarray or substring of fixed length, while maintaining statistical information of the subarray or substring. The present invention dynamically adjusts the window size and calculates the mean of the point data in the sliding window, so that the mean is close to the position of the center line of the road.
[0079] S25: Linear fitting and extraction of road centerline: The result of each sliding window calculated in S24 is used as the input data of linear fitting, and the least square method is used to obtain the fitted linear equation; the network centerline coordinates of the road section corresponding to each coordinate cluster are obtained by traversing all coordinate clusters and performing linear fitting, and the network centerline coordinates corresponding to the coordinate clusters are sorted to obtain the centerline coordinates of the road section corresponding to S1 ( Figure 1 , Figure 2 );
[0080] The linear fitting can capture the linear trend of the point data in the vehicle trajectory data in each coordinate cluster, that is, the approximate direction of the corresponding road section; the linear equation of the fitting result represents the overall distribution law of the point data, which more directly corresponds to the centerline position of each road section, and realizes the mathematical description of the road centerline;
[0081] The least squares fitting process is as follows: for each point data p i =(x i ,y i ), find the parameters Minimize the residual sum of squares:
[0082]
[0083] Among them, f(x i ,θ) is about function, n is the number of point data in the coordinate cluster, that is, the number of vehicle trajectory data; the least square fitting formula is used to obtain the road centerline coordinates of each road section; the Euclidean distance is calculated using the point data of the cluster center of each coordinate cluster and the point data first collected by the road maintenance vehicle, and each coordinate cluster is sorted according to the time feature to obtain the road centerline of the road section maintained by each maintenance team extending along the road direction; the cluster center is the mean of the point data in all vehicle trajectory data in the coordinate cluster after S24 processing.
Claims
1. A method for obtaining road centerline coordinates based on vehicle trajectory data, characterized in that: The steps include: S1: Data collection: Collect vehicle trajectory data of a certain road section, the vehicle trajectory data includes: point data, heading angle; the point data includes longitude and latitude; the vehicle trajectory data is collected by road maintenance vehicle inspection; S2: Data processing and algorithm calculation, including the following steps: S21: Data preprocessing: preprocessing the vehicle trajectory data collected in step S1; S22: clustering using K-means clustering algorithm: clustering the point data in the vehicle trajectory data obtained in S21 using the K-means clustering algorithm, classifying the vehicle trajectory data corresponding to similar point data into one category, and forming multiple coordinate clusters; S23: Heading angle processing and data sorting within clusters: for the coordinate clusters obtained in S22, the mean of the heading angles in all vehicle trajectory data within each coordinate cluster is calculated; according to the value range of the heading angle mean, all vehicle trajectory data are divided into two groups according to the point data, one group has a large change in the latitude direction, and the vehicle trajectory data within the group are sorted according to latitude; the other group has a large change in the longitude direction, and the vehicle trajectory data within the group are sorted according to longitude; S24: Sliding window calculation: Determine the size of the sliding window according to the number of vehicle trajectory data in each coordinate cluster obtained in S23, apply the determined sliding window to the corresponding sorted coordinate cluster, calculate the mean of all point data in the window, and move the sliding window on the coordinate cluster in sequence until the entire coordinate cluster is traversed; S25: Linear fitting and extraction of road centerline: The result calculated by each sliding window in S24 is used as the input data of linear fitting, and the least squares method is used to obtain the fitted linear equation; the network centerline coordinates of the road section corresponding to each coordinate cluster are obtained by traversing all coordinate clusters and performing linear fitting, and the network centerline coordinates corresponding to the coordinate clusters are sorted to obtain the centerline coordinates of the road section corresponding to S1.
2. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 1, characterized in that: The road section described in S1 corresponds to the road section maintained by the maintenance team. When the road maintenance vehicle inspection collects vehicle trajectory data, it includes the first collection and subsequent multiple massive collections; the first collection starts from the starting point of a road section and ends at the end of the road section, and repeated collection is not allowed. During the collection process, try to keep driving in the same lane and maintain a low speed, and try to collect as many trajectory points as possible; the subsequent multiple massive collections can start from any position of the road section to complete the collection of vehicle trajectory data for the entire road section, and the collection points are kept as dense and uniform as possible; the speed of the road maintenance vehicle inspection is less than or equal to 55km / h.
3. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 1, characterized in that: The vehicle trajectory data also includes: license plate number, collection time, chip number, vehicle speed, and timestamp.
4. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 3, characterized in that: The data preprocessing refers to cleaning and screening the collected vehicle trajectory data, and processing abnormal values and duplicate values; the abnormal values include abnormal point data values and abnormal vehicle speed values; The abnormal point data value means that the point data deviates from the original track; the abnormal vehicle speed value means that the vehicle speed field is lost, that is, the vehicle speed is 0.
5. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 4, characterized in that: The processing of the abnormal point data value is as follows: compare the current point data with the point data of the previous acquisition point, and convert the point data into the actual ground distance through the Haversine formula. Assuming that the current point data is (x1, y1) and the point data of the previous acquisition point is (x0, y0), the ground distance d between the two point data is: Determine whether the current point data is normal based on the d value, and remove it if it is abnormal.
6. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 4, characterized in that: The processing of the abnormal vehicle speed value is as follows: comparing the point data corresponding to the current vehicle speed with the point data corresponding to the previous acquisition point and the point data corresponding to the next acquisition point. If the longitude and latitude are equal, the data is normal data. Otherwise, the average of the vehicle speeds corresponding to the previous collection point and the next collection point is calculated, and this average is used as the vehicle speed at the current collection point.
7. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 1, characterized in that: In S22, the initial number of clusters of the K-means clustering algorithm is set according to the road length of the road corresponding to the road section. If the road length does not exceed two kilometers, the initial number of clusters is set to 10; otherwise, the initial number of clusters is set to 15.
8. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 1, characterized in that: S23 includes the following steps: S231: Subtract 180 degrees from the heading angles of the vehicle trajectory data in all the coordinate clusters obtained in S22 whose heading angle values exceed 180 degrees; S232: for the coordinate clusters processed in S231, calculating the mean of the heading angles in the vehicle trajectory data in each coordinate cluster; S233: If the value range of the mean obtained in S232 is [0,45)U[135,180), sort the point data in the vehicle trajectory data in the coordinate cluster according to latitude; if the value range of the mean obtained in S232 is [45,135), sort the point data in the vehicle trajectory data in the coordinate cluster according to longitude.
9. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 1, characterized in that: S24 includes the following steps: S241: define window size: define sliding window size according to the number of vehicle trajectory data in the coordinate cluster; the sliding window size = number of vehicle trajectory data / 5; S242: Filling the window: setting the sliding window at the beginning of the point data in the vehicle trajectory data in the coordinate cluster, and adding the point data to the window in sequence until the maximum capacity of the window is reached; S243: Calculate the mean of the point data: sum the point data in the sliding window, divide the sum result by the window size, and obtain the mean of the point data in the sliding window; S244: Sliding window: Move the sliding window to the right by one position, discard the leftmost point data before the sliding window moves, and add the next point data to the window; S245: Repeat S242-S244 until the sliding window traverses the point data of all vehicle trajectory data in the coordinate cluster.
10. The method for obtaining road centerline coordinates based on vehicle trajectory data according to claim 1, characterized in that: The least squares fitting process described in S25 is: for each point data p i =(x i ,y i ), find the parameters Minimize the residual sum of squares: Among them, f(x i ,θ) is about function, n is the number of point data in the coordinate cluster; the extraction of the road centerline in S25 refers to: using the least square fitting formula to obtain the road centerline coordinates of each road section; using the point data of the cluster center of each coordinate cluster and the point data first collected by the road maintenance vehicle to calculate the Euclidean distance, sorting each coordinate cluster according to the time feature, and finally obtaining the road centerline coordinates of the road section in S1.