Road track coincidence mileage determination method, system and device and storage medium
By matching the latitude and longitude coordinates of the highway trajectory line with the buffer area surface of the target highway trajectory line and calculating the adjacent distance, the problem of low efficiency of overlapping mileage analysis in the existing technology is solved, and fast and accurate overlapping mileage calculation is achieved.
Patent Information
- Application Number
- CN202411543200.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-28
AI Technical Summary
In the analysis of rural road trajectory lines, the analysis effect and efficiency of overlapping mileage are poor, resulting in the need of a large number of internal personnel to work overtime to verify, increasing labor costs.
By matching multiple sets of latitude and longitude coordinates of the comparative highway trajectory line with the buffer area surface of the target highway trajectory line, the successful matching overlap latitude and longitude coordinates are obtained, and their adjacent distance values are calculated to determine the overlap mileage between the two trajectory lines.
The rapid and accurate determination of the overlapping mileage between the two highway trajectories is achieved, which improves computing efficiency and reduces labor costs.
Smart Images

Figure CN119537668A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of mileage calculation, and in particular relates to a method, system, device and storage medium for determining the coincident mileage of a highway track. Background Art
[0002] In the past, when analyzing rural road trajectories, third-party tools (such as ArcMap) were needed for analysis, but the analysis effect and efficiency of overlapping mileage were poor, so each verification required a large number of internal staff to work overtime, which increased labor costs. Therefore, how to quickly and accurately determine the overlapping mileage between two trajectories has become an urgent problem to be solved.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of the present invention is to provide a method, system, device and storage medium for determining the overlapping mileage of highway tracks, aiming to solve the technical problem of how to quickly and accurately determine the overlapping mileage between two track lines.
[0005] To achieve the above object, the present invention provides a method for determining the coincident mileage of highway tracks, the method comprising:
[0006] Matching the multiple sets of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the cache area surface corresponding to the target highway trajectory line, and sequentially storing the multiple sets of overlapping longitude and latitude coordinates that have been successfully matched into the overlapping array set;
[0007] Based on the coincident array set, respectively obtain the adjacent distance values between each set of coincident longitude and latitude coordinates;
[0008] The overlapping mileage between the comparison highway trajectory line and the target highway trajectory line is determined according to the adjacent distance values between each set of overlapping longitude and latitude coordinates.
[0009] Optionally, the step of matching the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the cache area surfaces corresponding to the target highway trajectory line respectively includes:
[0010] Splitting the coordinates of the comparison highway trajectory line to obtain multiple groups of longitude and latitude coordinates, and storing the multiple groups of longitude and latitude coordinates in sequence into a comparison coordinate array set based on the trajectory sequence;
[0011] Determine the cache area surface corresponding to the target highway trajectory line according to the cache distance;
[0012] Each set of longitude and latitude coordinates in the comparison coordinate array set is matched with the cache area surface respectively through the st_contains method of postgis.
[0013] Optionally, the step of determining the cache area surface corresponding to the target highway trajectory line according to the cache distance includes:
[0014] According to the cache distance, the cache area corresponding to the target highway trajectory line is obtained through the st_buffer method in postgis;
[0015] Determining a cache boundary according to the cache area;
[0016] A cache area surface corresponding to the target highway trajectory line is determined based on the cache boundary line.
[0017] Optionally, after the step of matching each set of longitude and latitude coordinates in the comparison coordinate array set with the buffer area surface respectively, the method further includes:
[0018] Obtaining respectively the Boolean value of each set of longitude and latitude coordinates matching the cache area surface;
[0019] The multiple sets of overlapping longitude and latitude coordinates that are successfully matched are determined according to the Boolean value.
[0020] Optionally, the step of respectively obtaining adjacent distance values between each set of coincident longitude and latitude coordinates based on the coincident array set includes:
[0021] Based on the coincident array set, traverse a plurality of sets of coincident longitude and latitude coordinates in sequence;
[0022] The st_distance method of PostGIS is used to determine the adjacent distance values between each set of overlapping longitude and latitude coordinates.
[0023] Optionally, the step of determining the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between the overlapping longitude and latitude coordinates includes:
[0024] Accumulate the adjacent distance values between the coincident longitude and latitude coordinates to obtain the accumulated total distance value;
[0025] The overlapping mileage between the comparison highway trajectory line and the target highway trajectory line is determined according to the accumulated total distance value.
[0026] Optionally, the highway track overlap mileage determination system includes:
[0027] A matching module, used to match the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the buffer area surface corresponding to the target highway trajectory line, and store the multiple groups of overlapping longitude and latitude coordinates that are successfully matched in sequence into the overlapping array set;
[0028] A calculation module, used for respectively obtaining the adjacent distance values between each set of coincident longitude and latitude coordinates based on the coincident array set;
[0029] The determination module is used to determine the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between each set of overlapping longitude and latitude coordinates.
[0030] In addition, to achieve the above-mentioned purpose, the present invention also proposes a highway track overlap mileage determination system, the highway track overlap mileage determination system comprising:
[0031] A matching module, used to match the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the buffer area surface corresponding to the target highway trajectory line, and store the multiple groups of overlapping longitude and latitude coordinates that are successfully matched in sequence into the overlapping array set;
[0032] A calculation module, used for respectively obtaining the adjacent distance values between each set of coincident longitude and latitude coordinates based on the coincident array set;
[0033] The determination module is used to determine the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between each set of overlapping longitude and latitude coordinates.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also proposes a highway trajectory overlap mileage determination device, the device comprising: a memory, a processor, and a highway trajectory overlap mileage determination program stored in the memory and executable on the processor, the highway trajectory overlap mileage determination program being configured to implement the steps of the highway trajectory overlap mileage determination method as described above.
[0035] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a highway track overlap mileage determination program is stored, and when the highway track overlap mileage determination program is executed by a processor, the steps of the highway track overlap mileage determination method as described above are implemented.
[0036] The present invention first matches the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the buffer area surface corresponding to the target highway trajectory line, and stores the multiple groups of overlapping longitude and latitude coordinates that have been successfully matched in sequence into the overlapping array set, and then obtains the adjacent distance values between each group of overlapping longitude and latitude coordinates based on the overlapping array set, and finally determines the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between each group of overlapping longitude and latitude coordinates. Compared with the prior art that uses third-party tools to calculate the overlapping mileage, but results in inaccurate data and requires a large number of internal industry personnel to verify, the present invention splits the comparison trajectory line into points, calculates a buffer area surface for the target trajectory line, and then compares each point with the buffer area surface, stores the points that fall completely into the surface separately and calculates the adjacent distances between these points, so as to accurately obtain the overlapping mileage of the two highway trajectory lines, thereby improving the calculation efficiency of the overlapping mileage. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a structural schematic diagram of a highway track overlap mileage determination device in a hardware operating environment involved in an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a flow chart of a first embodiment of a method for determining the coincident mileage of highway tracks according to the present invention;
[0039] Figure 3 This is a structural block diagram of the first embodiment of the highway track overlap mileage determination system of the present invention.
[0040] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0042] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of a device for determining the overlapped mileage of highway tracks in the hardware operating environment involved in the embodiment of the present invention.
[0043] like Figure 1As shown, the highway track overlap mileage determination device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage system independent of the aforementioned processor 1001.
[0044] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the device for determining the coincident mileage of highway tracks, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0045] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a highway track overlap mileage determination program.
[0046] exist Figure 1 In the highway trajectory overlap mileage determination device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the highway trajectory overlap mileage determination device of the present invention can be set in the highway trajectory overlap mileage determination device, and the highway trajectory overlap mileage determination device calls the highway trajectory overlap mileage determination program stored in the memory 1005 through the processor 1001, and executes the highway trajectory overlap mileage determination method provided by the embodiment of the present invention.
[0047] The embodiment of the present invention provides a method for determining the coincident mileage of a highway track, referring to Figure 2 , Figure 2 Schematic diagram of the flow chart of the first embodiment of the method for determining the overlapped mileage of highway tracks of the present invention.
[0048] In this embodiment, the method for determining the overlapped mileage of highway tracks includes the following steps:
[0049] Step S10: Matching the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the buffer area surface corresponding to the target highway trajectory line respectively, and sequentially storing the multiple groups of overlapping longitude and latitude coordinates that have been successfully matched into the overlapping array set.
[0050] It is easy to understand that the execution subject of this embodiment can be a highway trajectory overlap mileage determination system with functions such as data processing, network communication and program running, or other computer equipment with similar functions, etc., and this embodiment is not limited.
[0051] It should also be noted that the comparison road trajectory line and the target road trajectory line can be collected through sensors or devices built into the vehicle when driving, and the comparison road trajectory line and the target road trajectory line may be two road trajectory lines with partially overlapping trajectories.
[0052] Furthermore, a processing method for matching multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the cache area surface corresponding to the target highway trajectory line is as follows: the comparison highway trajectory line is coordinate-splitting to obtain multiple groups of longitude and latitude coordinates, and the multiple groups of longitude and latitude coordinates are sequentially stored in a comparison coordinate array set based on the trajectory sequence; the cache area surface corresponding to the target highway trajectory line is determined according to the cache distance; and each group of longitude and latitude coordinates in the comparison coordinate array set is matched with the cache area surface by the st_contains method of postgis.
[0053] It should be understood that since the highway trajectories are all connected by points, this embodiment will loop through multiple sets of longitude and latitude coordinates of the comparison highway trajectories, and store the multiple sets of longitude and latitude coordinates in the comparison coordinate array set in sequence according to the trajectory order of the comparison highway trajectories.
[0054] Each set of longitude and latitude coordinates is a point on the highway trajectory.
[0055] Furthermore, a processing method for determining the cache area surface corresponding to the target highway trajectory line according to the cache distance is as follows: obtaining the cache area corresponding to the target highway trajectory line through the st_buffer method in postgis according to the cache distance; determining the cache boundary according to the cache area; and determining the cache area surface corresponding to the target highway trajectory line based on the cache boundary.
[0056] The cache distance may be the distance of the incoming target highway trajectory line for comparison with the cache, which may be 10 m, 20 m, etc., and this embodiment is not limited thereto.
[0057] It should also be noted that the cache boundary can be determined according to the cache area, and the cache boundary can be a geometric shape, and the surface within the cache boundary is used as the cache area surface.
[0058] In the specific implementation, each group of longitude and latitude coordinates in the comparison coordinate array set is matched with the cache area surface respectively, and it is determined whether each group of longitude and latitude coordinates in the comparison coordinate array set is within the cache area surface. Then, the Boolean value of each group of longitude and latitude coordinates matching the cache area surface is obtained respectively (that is, the matching result, true means inclusion, false means exclusion), and finally, the longitude and longitude coordinates with the Boolean value of true are selected from the multiple groups of longitude and latitude coordinates as the multiple groups of overlapping longitude and latitude coordinates that are successfully matched.
[0059] It should be understood that the multiple sets of overlapping latitude and longitude coordinates that are successfully matched also need to be stored separately and sequentially in the overlapping array set according to the trajectory order.
[0060] Step S20: based on the set of coincident arrays, respectively obtain the adjacent distance values between each set of coincident longitude and latitude coordinates.
[0061] It should also be noted that, based on the coincident array set, multiple groups of coincident longitude and latitude coordinates are traversed in sequence; the adjacent distance values between each group of coincident longitude and latitude coordinates are determined respectively by the st_distance method of postgis.
[0062] In this embodiment, the distance value between each two sets of overlapping longitude and latitude coordinates can be calculated in sequence by the st_distance method of postgis. Assuming that the multiple sets of overlapping longitude and latitude coordinates are point A, point B, point C, etc., the distance value between point A and point B can be calculated in sequence by the st_distance method of postgis, and then the distance value between point B and point C can be calculated, etc., until the multiple sets of overlapping longitude and latitude coordinates in the overlapping array set are traversed.
[0063] Step S30: determining the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between each set of overlapping longitude and latitude coordinates.
[0064] Furthermore, the adjacent distance values between the overlapping longitude and latitude coordinates are accumulated to obtain an accumulated total distance value; and the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line is determined according to the accumulated total distance value.
[0065] It should also be noted that the accumulated total distance value can be used as the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line, and then the overlap rate between the two highway trajectory lines can be calculated based on the overlapping mileage, thereby providing underlying support for subsequent other business analyses.
[0066] In this embodiment, the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory are first matched with the buffer area surface corresponding to the target highway trajectory, and the multiple groups of overlapping longitude and latitude coordinates that are successfully matched are sequentially stored in the overlapping array set, and then the adjacent distance values between each group of overlapping longitude and latitude coordinates are obtained based on the overlapping array set, and finally the overlapping mileage between the comparison highway trajectory and the target highway trajectory is determined according to the adjacent distance values between each group of overlapping longitude and latitude coordinates. Compared with the prior art, the overlapping mileage is calculated by a third-party tool, but the data is inaccurate and a large number of internal personnel are required to check. In this embodiment, the comparison trajectory is split into points, and a buffer area surface is calculated for the target trajectory. Then, each point is compared with the buffer area surface, and the points that fall completely into the surface are stored separately and the adjacent distances between these points are calculated, so as to accurately obtain the overlapping mileage and overlap rate between the two trajectory lines, and provide underlying support for subsequent other business analysis.
[0067] Reference Figure 3 , Figure 3 This is a structural block diagram of the first embodiment of the highway track overlap mileage determination system of the present invention.
[0068] like Figure 3 As shown, the highway track overlap mileage determination system proposed in the embodiment of the present invention includes:
[0069] The matching module 3001 is used to match the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the buffer area surface corresponding to the target highway trajectory line, and store the multiple groups of overlapping longitude and latitude coordinates that are successfully matched in sequence into the overlapping array set;
[0070] A calculation module 3002 is used to obtain adjacent distance values between each set of coincident longitude and latitude coordinates based on the coincident array set;
[0071] The determination module 3003 is used to determine the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between each set of overlapping longitude and latitude coordinates.
[0072] Other embodiments or specific implementations of the highway trajectory overlap mileage determination system of the present invention can refer to the above-mentioned method embodiments and will not be described in detail here.
[0073] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0074] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0076] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for determining the coincident mileage of highway tracks, characterized in that: The method for determining the coincident mileage of highway tracks comprises the following steps: Matching the multiple sets of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the cache area surface corresponding to the target highway trajectory line, and sequentially storing the multiple sets of overlapping longitude and latitude coordinates that have been successfully matched into the overlapping array set; Based on the coincident array set, respectively obtain the adjacent distance values between each set of coincident longitude and latitude coordinates; The overlapping mileage between the comparison highway trajectory line and the target highway trajectory line is determined according to the adjacent distance values between each set of overlapping longitude and latitude coordinates.
2. The method according to claim 1, characterized in that The step of matching the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the cache area surface corresponding to the target highway trajectory line includes: Splitting the coordinates of the comparison highway trajectory line to obtain multiple groups of longitude and latitude coordinates, and storing the multiple groups of longitude and latitude coordinates in sequence into a comparison coordinate array set based on the trajectory sequence; Determine the cache area surface corresponding to the target highway trajectory line according to the cache distance; Each set of longitude and latitude coordinates in the comparison coordinate array set is matched with the cache area surface respectively through the st_contains method of postgis.
3. The method according to claim 1 or 2, characterized in that The step of determining the cache area surface corresponding to the target highway trajectory line according to the cache distance includes: According to the cache distance, the cache area corresponding to the target highway trajectory line is obtained through the st_buffer method in postgis; Determining a cache boundary according to the cache area; A cache area surface corresponding to the target highway trajectory line is determined based on the cache boundary line.
4. The method according to claim 3, characterized in that After the step of matching each set of longitude and latitude coordinates in the comparison coordinate array set with the buffer area surface respectively, the method further includes: Obtaining respectively the Boolean value of each set of longitude and latitude coordinates matching the cache area surface; The multiple sets of overlapping longitude and latitude coordinates that are successfully matched are determined according to the Boolean value.
5. The method according to claim 3, characterized in that The step of respectively obtaining adjacent distance values between each set of overlapping longitude and latitude coordinates based on the overlapping array set comprises: Based on the coincident array set, traverse a plurality of sets of coincident longitude and latitude coordinates in sequence; The st_distance method of PostGIS is used to determine the adjacent distance values between each set of overlapping longitude and latitude coordinates.
6. The method according to claim 5, characterized in that The step of determining the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between the overlapping longitude and latitude coordinates includes: Accumulate the adjacent distance values between the coincident longitude and latitude coordinates to obtain the accumulated total distance value; The overlapping mileage between the comparison highway trajectory line and the target highway trajectory line is determined according to the accumulated total distance value.
7. A highway track overlap mileage determination system, characterized in that: The highway track coincidence mileage determination system comprises: A matching module, used to match the multiple groups of longitude and latitude coordinates corresponding to the comparison highway trajectory line with the buffer area surface corresponding to the target highway trajectory line, and store the multiple groups of overlapping longitude and latitude coordinates that are successfully matched in sequence into the overlapping array set; A calculation module, used for respectively obtaining the adjacent distance values between each set of coincident longitude and latitude coordinates based on the coincident array set; The determination module is used to determine the overlapping mileage between the comparison highway trajectory line and the target highway trajectory line according to the adjacent distance values between each set of overlapping longitude and latitude coordinates.
8. A device for determining the coincidence mileage of a highway track, characterized in that: The device includes: a memory, a processor, and a highway track overlap mileage determination program stored in the memory and executable on the processor, wherein the highway track overlap mileage determination program is configured to implement the steps of the highway track overlap mileage determination method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a highway track overlap mileage determination program, and when the highway track overlap mileage determination program is executed by the processor, the steps of the highway track overlap mileage determination method according to any one of claims 1 to 6 are implemented.