Intersection determination method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202510476062.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2026-10-23
AI Technical Summary
然而,对于道路宽度突变的情况,会使得普通电子地图中生成的道路形状较差,因此需要一种交点确定方法来确定道路线左右两侧边线上的一些交点,以基于交点在普通电子地图中显示道路线的两侧边线
[0050]本申请实施例提供了一种交点确定方法,该方法为道路线设置了多条相交的切割线,通过这多条切割线和边线条件,来得到每条道路线的多个第一距离和多个第二距离,由于这多个第一距离和多个第二距离分别指示左侧边线和右侧边线上的交点相对于切割线的距离,进而基于第一距离和第二距离就能够确定左侧边线和右侧边线分别与切割线相交的第一交点和第二交点。而确定第一交点和第二交点后,在电子地图中生成边线时,就能够基于第一交点生成左侧边线以及基于第二交点生成右侧边线。并且,由于该方法是基于边线条件来确定边线上的交点,进而使得生成的边线符合边线条件,因此在电子地图中基于边线显示的道路就能够避免由于道路宽度突变等原因而导致道路形状较差的情况,提高电子地图中道路的显示效果,也即提高电子地图的质量。
Smart Images

Figure CN122967530A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for determining intersection points. Background Technology
[0002] Electronic maps are divided into high-resolution electronic maps and standard electronic maps. In standard electronic maps, roads are represented by road lines without width, while in high-resolution electronic maps, roads are represented by road surfaces with width. For areas where only standard electronic maps exist and no high-resolution electronic maps are available, road surfaces can be expanded from the road lines in the standard electronic map to achieve the effect of a high-resolution map.
[0003] In related technologies, for ordinary electronic maps, the road surface is generally extended to the left and rear sides of the road line based on a preset road width, with the road line as the center, to display the road surface in the ordinary electronic map. However, when the road width changes abruptly, the road shape generated in the ordinary electronic map will be poor. Therefore, an intersection point determination method is needed to determine some intersection points on the left and right sides of the road line, so as to display the two sides of the road line in the ordinary electronic map based on the intersection points. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for determining intersection points. This method, by displaying roads in electronic maps based on edge lines, can avoid poor road shape due to abrupt changes in road width, thereby improving the display effect of roads in electronic maps and thus enhancing the quality of the electronic maps. The technical solution provided by this application is as follows.
[0005] According to one aspect of the embodiments of this application, a method for determining an intersection point is provided, the method comprising:
[0006] Obtain at least one road line and edge line conditions from an electronic map, wherein the edge line conditions are used to determine the intersection points on the respective edges of the at least one road line;
[0007] Determine the attribute information of each of the multiple cutting lines that intersect with the at least one road line, wherein the attribute information of each cutting line is used to indicate the position of the cutting line relative to each road line;
[0008] Based on the edge line conditions and the attribute information of each of the multiple cutting lines, multiple first distances and multiple second distances are determined for each road line. The multiple first distances are used to indicate the distance of the intersection point of the left edge line of the road line with the multiple cutting lines relative to the multiple cutting lines. The multiple second distances are used to indicate the distance of the intersection point of the right edge line of the road line with the multiple cutting lines relative to the multiple cutting lines.
[0009] For each road line, based on the plurality of first distances and the plurality of second distances, a plurality of first intersection points and a plurality of second intersection points are determined. The plurality of first intersection points are used to generate the left side line of the road line in the electronic map, and the plurality of second intersection points are used to generate the right side line of the road line in the electronic map.
[0010] According to another aspect of the embodiments of this application, an intersection point determination apparatus is provided, the apparatus comprising:
[0011] The acquisition module is used to acquire at least one road line and edge line conditions in the electronic map, wherein the edge line conditions are used to determine the edge line of each of the at least one road line;
[0012] The first determining module is used to determine the attribute information of each of the multiple cutting lines that intersect with the at least one road line, wherein the attribute information of each cutting line is used to indicate the position of the cutting line relative to each road line;
[0013] The second determining module is used to determine multiple first distances and multiple second distances for each road line based on the edge line conditions and the attribute information of each of the multiple cutting lines. The multiple first distances are used to indicate the intersection point of the left edge line of the road line with the multiple cutting lines, and the multiple second distances are used to indicate the intersection point of the right edge line of the road line with the multiple cutting lines.
[0014] The third determining module is used to determine, for each road line, a plurality of first intersection points and a plurality of second intersection points based on the plurality of first distances and the plurality of second distances. The plurality of first intersection points are used to generate the left side line of the road line in the electronic map, and the plurality of second intersection points are used to generate the right side line of the road line in the electronic map.
[0015] In some embodiments, the second determining module is configured to:
[0016] Based on the attribute information of each of the multiple cutting lines, the objective function is determined;
[0017] Based on the edge conditions, the objective function is solved to obtain multiple first distances and multiple second distances for each road line.
[0018] In some embodiments, the edge condition includes at least one sub-condition, the objective function includes an objective sub-function corresponding to each of the at least one sub-condition, and the second determining module is configured to:
[0019] Based on the attribute information of each of the multiple cutting lines, each objective sub-function in the objective function is determined.
[0020] In some embodiments, the at least one sub-condition includes a first sub-condition, which is used to minimize the distance between every two adjacent intersections on every edge of every road line;
[0021] The second determining module is used for:
[0022] Based on the attribute information of each of the multiple cutting lines, a distance function is determined between each pair of adjacent intersection points on each edge of each road line. The distance function is used to measure the distance between the two adjacent intersection points.
[0023] Based on the distance function between each two adjacent intersections on each edge of each road line, the objective sub-function corresponding to the first sub-condition is determined. The objective sub-function corresponding to the first sub-condition is the sum of multiple distance functions for each road line.
[0024] In some embodiments, the at least one sub-condition includes a second sub-condition, which is used to minimize the angle of inclination between the two straight lines formed by every three adjacent intersections on each side of each road line;
[0025] The second determining module is used for:
[0026] Based on the attribute information of each of the multiple cutting lines, a modulus function is determined between every three adjacent intersection points on each edge of each road line. The modulus function is used to measure the modulus of the sum of two vectors, which are the vector pointing from the second intersection point to the first intersection point and the vector pointing from the second intersection point to the third intersection point.
[0027] Based on the modulus function between every three adjacent intersection points on every edge of each road line, determine the objective sub-function corresponding to the second sub-condition. The objective sub-function corresponding to the second sub-condition is the sum of multiple modulus functions for each road line.
[0028] In some embodiments, the at least one sub-condition includes a third sub-condition, which is used to minimize the difference between the width of each road line and the reference width;
[0029] The second determining module is used for:
[0030] Based on the attribute information of each of the multiple cutting lines, a width error function is determined for each road line relative to the multiple cutting lines. The width error function is used to measure the difference between the width of the road line relative to the cutting line and the reference width. The width of each road line relative to each cutting line refers to the width between the two intersection points of the two edges of the road line on the cutting line.
[0031] Based on the width error function of each road line relative to the multiple cutting lines, a target sub-function corresponding to the third sub-condition is determined. The target sub-function corresponding to the third sub-condition is the sum of the multiple width error functions of each road line.
[0032] In some embodiments, the at least one sub-condition includes a fourth sub-condition, which is used to minimize the difference between the two widths of each road line relative to each of the two adjacent cutting lines, wherein the width of each road line relative to each cutting line refers to the width between the two edges of the road line at the two intersections on the cutting line.
[0033] The second determining module is used for:
[0034] Based on the attribute information of each of the multiple cutting lines, a width difference function is determined for each road line relative to each of the two adjacent cutting lines. The width difference function is used to measure the width difference of the road line relative to the two adjacent cutting lines.
[0035] Based on the width difference function of each road line relative to each of the two adjacent cutting lines, the target sub-function corresponding to the fourth sub-condition is determined. The target sub-function corresponding to the fourth sub-condition is the sum of multiple width difference functions of each road line.
[0036] In some embodiments, the at least one sub-condition includes a fifth sub-condition, which is used to minimize the difference between a first position and a second position of each road line relative to each cutting line, wherein the first position indicates the center of two intersection points of the two side lines of the road line on the cutting line, and the second position is the position where the road line intersects the cutting line;
[0037] The second determining module is used for:
[0038] Based on the attribute information of each of the multiple cutting lines, a center error function is determined for each road line relative to the multiple cutting lines. The center error function is used to measure the difference between the first position and the second position.
[0039] Based on the central error function of each road line relative to the multiple cutting lines, a target sub-function corresponding to the fifth sub-condition is determined. The target sub-function corresponding to the fifth sub-condition is the sum of the multiple central error functions of each road line.
[0040] In some embodiments, the at least one sub-condition includes a sixth sub-condition, which is used to minimize the difference between the intervals of every two adjacent edge lines between two adjacent road lines. The edge line interval refers to the interval between two intersection points on the same cutting line between the right edge line of the left road line and the left edge line of the right road line in two adjacent road lines.
[0041] The second determining module is used for:
[0042] Based on the attribute information of each of the multiple cutting lines, a spacing difference function is determined for each pair of adjacent road lines relative to each pair of adjacent cutting lines. The spacing difference function is used to measure the difference in the edge spacing of the two adjacent road lines relative to the two adjacent cutting lines.
[0043] Based on the interval difference function of each pair of adjacent road lines relative to each pair of adjacent cutting lines, a target sub-function corresponding to the sixth sub-condition is determined. The target sub-function is the sum of multiple interval difference functions of each pair of adjacent road lines.
[0044] In some embodiments, the edge line condition further includes at least one of a first constraint sub-condition, a second constraint sub-condition, and a third constraint sub-condition, wherein the first constraint sub-condition indicates that the width of each road line relative to each cutting line is within a preset range, the second constraint sub-condition indicates that the first intersection point of each road line is on the left side of the road line and the second intersection point is on the right side of the road line, and the third constraint sub-condition indicates that the right edge line of each road line is to the left of the left edge line of the adjacent road line on the right side of the road line.
[0045] In some embodiments, the second determining module is further configured to:
[0046] Based on the weights of the objective sub-functions corresponding to each of the at least one sub-conditions, the coefficients of each objective sub-function in the objective function are determined, and the objective function is a weighted sum of the objective sub-functions corresponding to each of the at least one sub-conditions.
[0047] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory being used to store a computer program, the computer program being loaded and executed by the processor to implement the intersection determination method in the embodiments of this application.
[0048] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the intersection determination method in the embodiments of this application.
[0049] On the other hand, a computer program product is provided, the computer program product including a computer program stored in a computer-readable storage medium, a processor of a computer device reading the computer program from the computer-readable storage medium, the processor executing the computer program, causing the computer device to perform the intersection determination method described in any of the above implementations.
[0050] This application provides a method for determining intersection points. The method sets multiple intersecting cutting lines for a road line. Using these cutting lines and edge line conditions, multiple first distances and multiple second distances are obtained for each road line. Since these multiple first distances and multiple second distances indicate the distances of the intersection points on the left and right edge lines relative to the cutting lines, the first and second intersection points of the left and right edge lines with the cutting lines can be determined based on the first and second distances. After determining the first and second intersection points, when generating edge lines in an electronic map, the left edge line can be generated based on the first intersection point, and the right edge line can be generated based on the second intersection point. Furthermore, since this method determines the intersection points on the edge lines based on edge line conditions, the generated edge lines conform to these conditions. Therefore, roads displayed on electronic maps based on edge lines can avoid poor road shapes due to abrupt changes in road width, improving the display effect of roads in electronic maps, i.e., improving the quality of electronic maps. Attached Figure Description
[0051] Figure 1 This is a structural block diagram of a computer system provided in one embodiment of this application;
[0052] Figure 2 This is a schematic diagram of an electronic map provided in one embodiment of this application;
[0053] Figure 3 This is a schematic diagram of an expanded electronic map provided in one embodiment of this application;
[0054] Figure 4 This is a flowchart of an intersection point determination method provided in one embodiment of this application;
[0055] Figure 5 This is a flowchart of an intersection point determination method provided in one embodiment of this application;
[0056] Figure 6 This is a schematic diagram of a road line and a center line provided in one embodiment of this application;
[0057] Figure 7 This is a schematic diagram of a road line and a cutting line provided in one embodiment of this application;
[0058] Figure 8 This is a schematic diagram illustrating the distance between the intersection point and the left endpoint of the cutting line, provided in one embodiment of this application.
[0059] Figure 9 This is a flowchart of an intersection point determination method provided in one embodiment of this application;
[0060] Figure 10 This is a schematic diagram of the two side lines of a road line provided in one embodiment of this application;
[0061] Figure 11 This is a block diagram of an intersection point determination device provided in one embodiment of this application;
[0062] Figure 12 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0064] Figure 1 A structural block diagram of a computer system provided in an exemplary embodiment of this application is shown. The computer system includes a terminal 10 and a server 20.
[0065] Specifically, server 20 determines the intersection points of multiple road lines in the road network database, obtaining multiple intersection points on the left and right sides of each road line. Subsequently, server 20 can provide the road data, including the intersection points, to terminal 10. Terminal 10 renders the data based on this road data, displaying the road line edges on an electronic map, thus providing roads with width.
[0066] Optionally, terminal 10 has an electronic map application installed. The server provides services to the electronic map application, and terminal 10 uses the electronic map application to display maps and provide navigation functions. Server 20 sends road data to the electronic map application. Terminal 10 displays the rendered electronic map in the electronic map application.
[0067] In one possible implementation, server 20 can be a standalone physical server, a server cluster consisting of multiple physical servers, or a distributed system. Terminal 10 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle terminal, etc.
[0068] The intersection point determination method provided in this application can be applied to various virtual map products such as high-precision virtual maps, ordinary-precision maps, and urban road models. It can be used to visualize road areas including multiple intersections. This intersection point determination method can be understood as a process of compiling raw map data. As a connecting link, it processes and manipulates the raw map data to generate more compact and easier-to-use files or data. The compiled data can then be provided to upper layers (such as map navigation, positioning technology, map rendering, etc.). For example, by determining the intersection points on the edges of an electronic map, a more aesthetically pleasing electronic map can be obtained by displaying the edges.
[0069] In this embodiment, the conversion of a standard electronic map into a high-precision electronic map is used as an example. Standard electronic maps have lower precision, and roads in them are represented by road lines without width. High-precision electronic maps, on the other hand, have higher precision, and roads in them are represented by road surfaces with width. Currently, lane-level navigation primarily uses high-precision electronic maps; however, some areas only have standard electronic maps and lack high-precision maps. To achieve a near-high-precision map effect in areas without one, it is necessary to expand road surfaces based on road information from the standard electronic map to achieve the same effect as a high-precision map.
[0070] In a typical electronic map, each road line has certain road attribute information, such as road grade and number of lanes. Based on this road attribute information, the width of the road can be determined. In this embodiment, a road line can be considered as the centerline of a road. By determining the left and right edge lines of the road line, the road line can be expanded into a road surface based on the two edge lines. Figure 2 This is a schematic diagram of an electronic map provided in one embodiment of this application, such as... Figure 2 As shown, in a typical electronic map, roads are represented by line segments with no width. Each line segment represents a road, and each line segment is composed of several discrete shape points. Figure 2 By expanding the road lines shown, the road surface can be obtained. Figure 3 This is a schematic diagram of an expanded electronic map provided in one embodiment of this application, as shown below. Figure 3 As shown, by using the road lines in the electronic map as the center line and expanding the boundaries to both sides, a road surface with width is obtained. And based on... Figure 2 get Figure 3 The process can be done through Figure 4 For implementation examples, please refer to [link / reference]. Figure 4 , Figure 4 A flowchart of an intersection point determination method according to an embodiment of this application is shown, the method including at least one of the following steps.
[0071] 1. Obtain road lines and edge conditions from the electronic map. Each road on the electronic map is represented by a road line 401 without width. Edge conditions are used to determine the edges of road line 401. The edges of road line 401 include a left edge and a right edge. By displaying the left and right edges of road line 401 on the electronic map, roads with width can be displayed on the electronic map. Edge conditions are used to restrict the generated edges, such as limiting the width between two generated edges, the smoothness, and the edge spacing between multiple road lines.
[0072] 2. Determine the attribute information of the cutting lines. Set multiple cutting lines 402 that intersect with the road line 401. The attribute information of each cutting line 402 is used to indicate the position of the cutting line 402 relative to the road line 401. The attribute information includes at least one of the following: the sequence number of the cutting line 401, its length, the coordinates of its two endpoints, and its unit vector. The sequence number of the cutting line 401 is used to indicate which cutting line it is relative to the road line 401.
[0073] 3. Determine the distance. Based on the edge line conditions and attribute information, multiple first distances 403 and multiple second distances 404 can be determined. The first distance 403 indicates the distance of the intersection point of the left edge line and multiple cutting lines relative to the cutting lines. The second distance 404 indicates the distance of the intersection point of the right edge line and multiple cutting lines relative to the cutting lines. This distance can be the distance between the intersection point and the left or right endpoint of the cutting line.
[0074] 4. Determine the intersection points. Based on multiple first distances 403 and multiple second distances 404, multiple first intersection points 405 and multiple second intersection points 406 can be determined. Based on the multiple first intersection points 405, the left edge line 407 of road line 401 can be generated in the electronic map, and based on the multiple second intersection points 406, the right edge line 408 of road line 401 can be generated in the electronic map. For example, connecting multiple first intersection points 405 in sequence in the electronic map yields the left edge line 407, and connecting multiple second intersection points 406 in sequence yields the right edge line 408.
[0075] In this embodiment, multiple intersecting cutting lines are set for the road lines. Using these cutting lines and edge line conditions, multiple first distances and multiple second distances are obtained for each road line. Since these multiple first distances and multiple second distances indicate the distances of the intersection points on the left and right edge lines relative to the cutting lines, the first and second intersection points of the left and right edge lines with the cutting lines can be determined based on the first and second distances. After determining the first and second intersection points, when generating edge lines in the electronic map, the left edge line can be generated based on the first intersection point, and the right edge line can be generated based on the second intersection point. Furthermore, since this method determines the intersection points on the edge lines based on edge line conditions, the generated edge lines conform to the edge line conditions. Therefore, roads displayed on the electronic map based on edge lines can avoid poor road shapes due to abrupt changes in road width, improving the display effect of roads in the electronic map, i.e., improving the quality of the electronic map.
[0076] Please refer to Figure 5 , Figure 5 This is a flowchart of an intersection point determination method provided in one embodiment of this application. The execution entity for each step of this method can be a computer device, such as... Figure 1The computer system shown is a server or terminal; in this embodiment, the server is used as the execution subject for illustration. The method may include at least one of the following steps 501-504.
[0077] 501. The server obtains at least one road line and edge line conditions from the electronic map. The edge line conditions are used to determine the intersection points on the respective edges of at least one road line.
[0078] In this embodiment, a common electronic map is used as an example for explanation. Each road in a common electronic map is represented by a road line with no width, which also indicates the center position of the road.
[0079] In this embodiment of the application, the intersection points of each road line in the electronic map can be determined to display the edge line of each road line on the electronic map. Alternatively, the intersection points of some road lines in the electronic map can be determined to display the edge lines of some road lines on the electronic map. The edge lines of the road lines include left and right edge lines. By displaying the edge lines on both the left and right sides of the road lines, it is possible to display the road by showing a road surface with width.
[0080] Because electronic maps contain multiple road lines indicating different types of roads, such as those indicating north-south roads and those indicating east-west roads, at least one related road line is processed at a time to facilitate the processing of road lines in electronic maps. Related road lines correspond to the same road, including uphill, downhill, and auxiliary roads within that road, such as all corresponding to "XX Road" or all corresponding to "XX Street". Furthermore, since each road can have multiple intersections, this at least one related road line can be the road line of the section of road between two adjacent intersections.
[0081] In some embodiments, if there are multiple road lines, the range of these multiple road lines is further restricted; that is, the distance between the leftmost road line and the rightmost road line cannot exceed a preset distance. Optionally, since a road is mainly a main road for both directions, the centerline between the main roads can be determined first, and then the road lines within a preset range centered on this centerline can be determined. Spatial indexing techniques can be used to determine the road lines within the preset range centered on the centerline. This technique can efficiently obtain information about other objects near an object, thus eliminating the need to guarantee parallelism and spacing with the centerline for roads that are far away, improving the efficiency of road line processing.
[0082] 502. The server determines the attribute information of multiple cutting lines that intersect with at least one road line. The attribute information of each cutting line is used to indicate the position of the cutting line relative to each road line.
[0083] The attribute information for each cutting line may include the coordinates of its two endpoints and its length, or the coordinates of one endpoint and a unit vector, thereby enabling the location of each position on the cutting line. The length can be the actual length, such as 200 meters. In this embodiment, the coordinate system of the relevant position is the coordinate system corresponding to the actual length, meaning the unit length of the coordinate system is meters. Furthermore, the attribute information also includes the cutting line's sequence number, indicating which cutting line it is relative to the road line.
[0084] In this embodiment, the multiple cutting lines intersect with each road line. Optionally, there is a preset positional relationship between the multiple cutting lines and at least one road line.
[0085] Let's take at least one road line as an example. Multiple cutting lines intersect this road line perpendicularly; that is, these cutting lines are transverse cutting lines of the road line. Furthermore, each cutting line is equally divided by the road line to the left and right; that is, the midpoint of each cutting line intersects the road line. The spacing between the multiple cutting lines should be as uniform as possible, meaning the distance between any two adjacent intersections of the road line on these cutting lines is the same. This spacing corresponds to the actual distance, such as a spacing of 10 meters for each intersection.
[0086] To illustrate this further, taking the example of at least one road line being multiple road lines, we can first determine the centerline between the multiple road lines, and then determine multiple cutting lines based on the centerline. For example... Figure 6 As shown, line segments 1, 2, 3, and 4 represent road lines, while the line segment between road line 2 and road line 3 is the center line. Optionally, road line 2 and road line 3 are paired to obtain the center line, which indicates the center position of the two road lines. For example, to ensure that multiple cutting lines intersect multiple road lines as perpendicularly as possible, all cutting lines intersect the center line perpendicularly. Furthermore, the cutting lines are bisected equally by the center line, meaning the midpoint of each cutting line intersects the center line. The spacing between multiple cutting lines is as equal as possible, ensuring that the center line is spaced equally between every two adjacent intersections on the multiple cutting lines. Since the cutting lines are bisected equally by the road lines or center line and intersect perpendicularly with the road lines or center line, and the coordinates of the road lines and center line are known, and the length of the cutting lines is fixed, the coordinates of the left and right endpoints of the cutting lines can be obtained based on the coordinates of the road lines and center line.
[0087] In this embodiment, the centerline of the road in both directions is used as the reference for generating the cutting lines. This ensures the shape and positional accuracy of the road edges relative to this reference centerline. A series of transverse cutting lines are then constructed at equal intervals along the centerline. Each cutting line intersects with a nearby road link, and each intersection corresponds to a pair of intersections. Each pair of intersections represents the intersection of the left edge of the road link with the cutting line and the intersection of the right edge of the road link with the cutting line. Figure 7 As shown.
[0088] 503. Based on the edge conditions and the attribute information of each of the multiple cutting lines, the server determines multiple first distances and multiple second distances for each road line. The multiple first distances are used to indicate the distance of the intersection point of the left edge of the road line with the multiple cutting lines relative to the multiple cutting lines. The multiple second distances are used to indicate the distance of the intersection point of the right edge of the road line with the multiple cutting lines relative to the multiple cutting lines.
[0089] Each first distance indicates the distance of the intersection point of the left edge line and a cutting line relative to that cutting line. This distance is also the distance between the indicated intersection point and one end of the cutting line, such as the distance between the intersection point and the left endpoint of the cutting line. Similarly, each second distance indicates the distance of the intersection point of the right edge line and a cutting line relative to that cutting line. This distance is also the distance between the indicated intersection point and one end of the cutting line. Since the cutting line is fixed, the intersection point of the cutting line and the edge line can only move laterally along the cutting line. Therefore, the position of the intersection point can be uniquely represented by its distance from the left endpoint of the cutting line, such as... Figure 8 As shown.
[0090] The first distance and the second distance can be actual distances or distances scaled up on an electronic map. In this embodiment, the first distance and the second distance are taken as actual distances for illustration.
[0091] 504. For each road line, the server determines multiple first intersection points and multiple second intersection points based on multiple first distances and multiple second distances. The multiple first intersection points are used to generate the left side line of the road line in the electronic map, and the multiple second intersection points are used to generate the right side line of the road line in the electronic map.
[0092] The multiple first intersection points are the intersections of the left edge of the road line with multiple cutting lines, and the multiple second intersection points are the intersections of the right edge of the road line with multiple cutting lines. Each first intersection point corresponds to a second intersection point, which is the intersection of the left edge and the right edge on the same cutting line.
[0093] Multiple first intersection points are determined based on multiple first distances, with one first distance used to determine one first intersection point. Multiple second intersection points are determined based on multiple second distances, with one second distance used to determine one second intersection point. Determining the intersection point is equivalent to determining its coordinates. Specifically, the coordinates of the intersection point can be determined based on the first distance and the coordinates of the left endpoint of the tangent line. Similarly, the coordinates of the intersection point can be determined based on the second distance and the coordinates of the left endpoint of the tangent line.
[0094] Once multiple first intersection points and multiple second intersection points are determined, the terminal can display the left side line of the road by showing the lines connecting the multiple first intersection points when displaying the electronic map. The left side line is formed by connecting the multiple first intersection points sequentially. Similarly, the right side line of the road can be displayed by showing the lines connecting the multiple second intersection points sequentially.
[0095] In this embodiment, multiple intersecting cutting lines are set for the road lines. Using these cutting lines and edge line conditions, multiple first distances and multiple second distances are obtained for each road line. Since these multiple first distances and multiple second distances indicate the distances of the intersection points on the left and right edge lines relative to the cutting lines, the first and second intersection points of the left and right edge lines with the cutting lines can be determined based on the first and second distances. After determining the first and second intersection points, when generating edge lines in the electronic map, the left edge line can be generated based on the first intersection point, and the right edge line can be generated based on the second intersection point. Furthermore, since this method determines the intersection points on the edge lines based on edge line conditions, the generated edge lines conform to the edge line conditions. Therefore, roads displayed on the electronic map based on edge lines can avoid poor road shapes due to abrupt changes in road width, improving the display effect of roads in the electronic map, i.e., improving the quality of the electronic map.
[0096] In the embodiments of this application, through the above Figure 5 The embodiments briefly introduce the process of the intersection point determination method. The following is based on... Figure 9 The embodiments described in detail illustrate this process. See also Figure 9 , Figure 9 This is a flowchart of an intersection point determination method provided in one embodiment of this application. The execution entity for each step of this method can be a computer device, such as... Figure 1 The computer system shown is a server or terminal. In this embodiment, the server is used as the execution subject for illustration. The method may include at least one of the following steps 901-905.
[0097] 901. The server obtains at least one road line and edge line conditions from the electronic map. The edge line conditions are used to determine the intersection points on the respective edges of at least one road line.
[0098] 902. The server determines the attribute information of multiple cutting lines that intersect with at least one road line. The attribute information of each cutting line is used to indicate the position of the cutting line relative to each road line.
[0099] In the embodiments of this application, steps 901-902 are the same as steps 501-502, and will not be described again here.
[0100] 903. The server determines the objective function based on the attribute information of each of the multiple cutting lines.
[0101] In some embodiments, the attribute information of each cutting line includes the coordinates of the left endpoint of the cutting line and a unit vector. The unit vector includes a horizontal unit vector and a vertical unit vector. The unit vector is determined based on the coordinates of the left endpoint, the coordinates of the right endpoint, and the length of the cutting line. The horizontal unit vector is used to indicate the distance on the cutting line corresponding to a unit length on the horizontal coordinate, and the vertical unit vector is used to indicate the distance on the cutting line corresponding to a unit length on the vertical coordinate.
[0102] Here, we will use M cutting lines as an example, where M is an integer greater than 1. For the i-th cutting line, the coordinates of its left endpoint are... The coordinates of its right endpoint are The unit vector from the left endpoint to the right endpoint is Then a unit vector can be represented as:
[0103]
[0104] in, This represents the horizontal unit vector of the cutting line. L represents the longitudinal unit vector of the cutting line. i This represents the length of the cutting line, which is a fixed value, such as 200 meters. Therefore, based on the coordinates of the left endpoint of each cutting line and the unit vector, the coordinates of the intersection points where the left and right sidelines intersect with the cutting lines can be represented.
[0105] The distance between the intersection of the j-th (j=1,…,N) road line and the i-th (i=1,…,M) cutting line and the left endpoint of the cutting line is taken as... The first distance between the first intersection point on the left edge and the first endpoint of the cutting line is The second distance between the second intersection point on the right edge and the left endpoint of the cutting line is Taking this example, N represents the number of road lines, and N is an integer greater than 0.
[0106] The coordinates of the first intersection point in the orthogonal coordinate system are: Then the coordinates can be represented as:
[0107]
[0108] The coordinates of the second intersection point in the orthogonal coordinate system are: Then the coordinates can be represented as:
[0109]
[0110] The method provided in this application is used to determine the optimal position of each intersection point on the left and right sides, that is, to determine the optimal... and
[0111] In this embodiment, the attribute information of the cutting line is used to determine the value of the parameter in the objective function. The parameter may include at least one of a coefficient and a constant. For example, for the objective function y = ax + b, the coefficient is a, the constant is b, x is a variable, that is, the solution of the objective function, and y is the objective to be optimized.
[0112] In some embodiments, the edge condition includes at least one sub-condition, and the objective function includes at least one objective sub-function corresponding to each of the sub-conditions. The process by which the server determines the objective function based on the attribute information of the multiple cutting lines includes the following steps: the server determines each objective sub-function in the objective function based on the attribute information of the multiple cutting lines.
[0113] The attribute information is used to determine the values of parameters in each objective sub-function. By constructing an objective function through multiple objective sub-functions corresponding to multiple sub-conditions, the distance determined based on the objective function can meet multiple conditions, thus further improving the quality of the generated distance and consequently the quality of the generated edge lines.
[0114] In some embodiments, at least one sub-condition includes a first sub-condition, which is used to minimize the distance between every two adjacent intersections on every edge of every road line; then the process of determining each objective sub-function in the objective function based on the attribute information of multiple cutting lines includes the following steps.
[0115] (1) Based on the attribute information of each of the multiple cutting lines, the server determines the distance function between each two adjacent intersections on each edge of each road line. The distance function is used to measure the distance between two adjacent intersections.
[0116] Minimizing the distance between two adjacent intersection points can be achieved by minimizing the distance itself or by minimizing the sum of the squares of the distances between the two intersection points. For ease of calculation, this embodiment will take minimizing the sum of the squares of the distances between the two intersection points as an example. The objective of the distance function to be optimized is the sum of the squares of the distances between two adjacent intersection points.
[0117] For the left edge of the j-th (j=1,…,N) road line, the first distance of this road line relative to the i-th cutting line is taken as... The first distance relative to the (i+1)th cutting line is The coordinates of the first intersection point indicated by the two first distances are respectively Taking this as an example, the coordinates of the two first intersection points represented by the attribute information can be as follows:
[0118]
[0119] in, and Let x and y represent the x and y coordinates of the left endpoint of the i-th cutting line, respectively. This represents the horizontal unit vector of the i-th cutting line. Represents the vertical unit vector of the i-th cutting line. and These represent the x and y coordinates of the left endpoint of the (i+1)th cutting line, respectively. This represents the horizontal unit vector of the (i+1)th cutting line. This represents the vertical unit vector of the (i+1)th cutting line.
[0120] Accordingly, from the intersection to the intersection The sum of the squares of the distances It can be represented as:
[0121]
[0122] make The distance function can then be:
[0123]
[0124] (2) The server determines the target sub-function corresponding to the first sub-condition based on the distance function between each two adjacent intersections on each edge of each road line. The target sub-function corresponding to the first sub-condition is the sum of multiple distance functions of each road line.
[0125] Here, since the objective function corresponding to the first sub-condition is the sum of the distance functions between every two adjacent intersections on every edge of every road line, the objective function includes the distance functions between every two adjacent intersections on the left edge of every road line and the distance functions between every two adjacent intersections on the right edge of every road line. The sum of the distance functions between every two adjacent first intersections on the left edge of multiple road lines can be expressed as:
[0126]
[0127] Similarly, the sum of the distance functions between every two adjacent second intersection points on the right side of multiple road lines can be expressed as:
[0128]
[0129] Summing the two distance functions yields the objective function corresponding to the first sub-condition, which can be expressed as:
[0130]
[0131] In this embodiment, the first sub-condition is used to minimize the distance between every two adjacent intersections on every edge of every road line. The optimal solution of the distance function is then the solution with the minimum sum of squared distances. By minimizing the distance between every two adjacent intersections on every edge, each edge line is made as smooth as possible. Since the shorter the distance between every two adjacent intersections, the shorter the total distance between multiple intersections on each edge line, the shorter the overall length of the edge line. The shorter the length of the edge line, the straighter the edge line is, thus making the edge line as smooth as possible.
[0132] In some embodiments, at least one sub-condition includes a second sub-condition, which is used to minimize the angle of inclination between two straight lines formed by every three adjacent intersections on each edge of each road line; then the process by which the server determines each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes the following steps.
[0133] (1) Based on the attribute information of each of the multiple cutting lines, the server determines the modulus function between each of the three adjacent intersections on each edge of each road line. The modulus function is used to measure the modulus of the sum of two vectors. The two vectors are the vector pointing from the second intersection to the first intersection and the vector pointing from the second intersection to the third intersection among the three adjacent intersections.
[0134] The second intersection point is the intersection point between the first and third intersection points. The two straight lines formed by three adjacent intersection points refer to the lines formed by the first and second intersection points, and the lines formed by the second and third intersection points. The angle of inclination between two lines refers to the angle at which one line is inclined relative to the other. Minimizing the angle of inclination between two lines means making the three adjacent points form a straight line as close as possible. This can be achieved by making the angle between the two lines as close to 180 degrees as possible, which can be achieved by minimizing the magnitude of the sum of two vectors with opposite directions corresponding to these two lines.
[0135] Taking the left sideline as an example, let's assume that the first distances of the three adjacent intersection points on the left sideline relative to the left endpoint of the cutting line are respectively... The coordinates of the first, second, and third intersection points are respectively The coordinates of the three intersection points can be expressed using the coordinates of the left endpoint of the tangent line, the unit vector, and the first distance:
[0136]
[0137]
[0138] from point to The vector representation is from point to The vector representation is The coordinates of the three intersection points of two vectors can then be represented as:
[0139]
[0140] make:
[0141] The vector pointing from the second intersection point to the first intersection point can be represented as:
[0142]
[0143] Similarly, the vector pointing from the second intersection point to the third intersection point can be represented as:
[0144]
[0145] To ensure that the angle formed by three adjacent intersection points is as close to 180 degrees as possible, we can require the vectors to... sum vector sum The magnitude of the vector should be as close to zero as possible. The sum of two vectors can be expressed as:
[0146]
[0147] make: Then we have:
[0148]
[0149] In order to make If the modulus length is as close to 0 as possible, then To be as small as possible, the modulus function between every three adjacent intersection points on the left sideline can be expressed as: Similarly, the modulus function between every three adjacent intersection points on the right sideline can be expressed as:
[0150] (2) The server determines the target sub-function corresponding to the second sub-condition based on the modulus function between every three adjacent intersections on every edge of each road line. The target sub-function corresponding to the second sub-condition is the sum of multiple modulus functions of each road line.
[0151] Here, since the objective function corresponding to the second sub-condition is the modulus function between every three adjacent intersection points on every edge of every road line, this objective function includes the modulus function between every three adjacent intersection points on the left edge of every road line and the modulus function between every three adjacent intersection points on the right edge of every road line. The sum of the modulus functions between every three adjacent intersection points on the left edge of multiple road lines can be expressed as:
[0152]
[0153] Similarly, the sum of the modulus functions between every three adjacent intersection points on the right side of multiple road lines can be expressed as:
[0154]
[0155] Summing the sums of the two modulus functions yields the objective sub-function corresponding to the second sub-condition, which can be expressed as:
[0156]
[0157] In this embodiment, the magnitude of the sum of the two vectors formed by every three adjacent intersection points is minimized to make each edge line as smooth as possible. Since the smaller the magnitude of the sum of the two vectors, the more parallel the two vectors are, that is, the smaller the angle of inclination between the two lines corresponding to the two vectors. Since these two lines are used to form the edge line, the edge line formed is straighter and the degree of inclination is smaller, which makes the edge line smoother.
[0158] In some embodiments, at least one sub-condition includes a third sub-condition, which is used to minimize the difference between the width of each road line and the reference width; then the process by which the server determines each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes the following steps.
[0159] (1) The server determines the width error function of each road line relative to the multiple cutting lines based on the attribute information of each cutting line. The width error function is used to measure the difference between the width of the road line relative to the cutting line and the reference width. The width of each road line relative to each cutting line refers to the width between the two intersection points of the two side lines of the road line on the cutting line.
[0160] Among them, on the i-th cutting line, the second distance Distance from the first The difference represents the width of the j-th road line relative to the cutting line, that is:
[0161]
[0162] The width error function can be expressed as: This represents the reference width of the j-th road line. Each road line in a typical navigation map carries attribute data, such as road class and number of lanes. The reference width of the road can be calculated from this attribute data based on relevant standards regarding road width.
[0163] (2) The server determines the target sub-function corresponding to the third sub-condition based on the width error function of each road line relative to multiple cutting lines. The target sub-function corresponding to the third sub-condition is the sum of the multiple width error functions of each road line.
[0164] The objective function corresponding to the third sub-condition can be expressed as:
[0165]
[0166] In this embodiment, the objective sub-function corresponding to the third sub-condition can make the road width as close as possible to the expected road width, that is, to minimize the deviation between the local width and the expected width between the two corresponding intersection points on the two edges.
[0167] In some embodiments, at least one sub-condition includes a fourth sub-condition, which is used to minimize the difference between the two widths of each road line relative to each of the two adjacent cutting lines. The width of each road line relative to each cutting line refers to the width between the two intersection points of the two edges of the road line on the cutting line. Then, the server determines each objective sub-function in the objective function based on the attribute information of the multiple cutting lines, including the following steps.
[0168] (1) The server determines the width difference function of each road line relative to each of the two adjacent cutting lines based on the attribute information of each of the multiple cutting lines. The width difference function is used to measure the width difference of the road line relative to the two adjacent cutting lines.
[0169] Taking the i-th cutting line and the (i+1)-th cutting line as examples, the width difference function can be expressed as follows: because The width difference function of the road line relative to each of the two adjacent cutting lines can be further expressed as:
[0170] (2) The server determines the target sub-function corresponding to the fourth sub-condition based on the width difference function of each road line relative to each of the two adjacent cutting lines. The target sub-function corresponding to the fourth sub-condition is the sum of multiple width difference functions of each road line.
[0171] The objective function corresponding to the fourth sub-condition can be expressed as:
[0172]
[0173] It's worth noting that in machine learning, if a sparse solution is desired, adding an L1 norm as a regularization term (L1) can be considered. The LASSO (Least Absolute Shrinkage and Selection Operator) problem controls the sparsity of the solution by penalizing the L1 norm of the parameters. Sparsity maximizes the number of zero values in the solution, meaning the LASSO model effectively extracts features. For some practical problems, the features themselves are not sparse, but they become sparse under certain transformations, thus requiring corresponding adjustments to the regularization term. The objective function corresponding to the fourth sub-condition requires that the local width be sparse under a certain linear transformation, meaning that the change between adjacent local widths should be sparse, ideally with the change in adjacent local widths being as close to zero as possible, to achieve the goal of making the road as wide as possible.
[0174] In this embodiment, the derivative of the objective function corresponding to the fourth sub-condition is discontinuous, which is not convenient for optimization. Therefore, the objective function corresponding to the fourth sub-condition is modified as follows:
[0175]
[0176] in,
[0177]
[0178] That is, multiple non-negative intermediate variables are introduced into the objective function corresponding to the fourth sub-condition. At the same time, constraint equations were added:
[0179] In this embodiment, the objective sub-function corresponding to the fourth sub-condition can minimize the sum of the absolute values of the difference between any two adjacent local widths of the road line, thus ensuring that the change in road width is as smooth as possible, avoiding abrupt width changes, and thereby improving the aesthetics of the generated road.
[0180] In some embodiments, at least one sub-condition includes a fifth sub-condition, which is used to minimize the difference between the first position and the second position of each road line relative to each cutting line. The first position indicates the center of the two intersection points of the two edge lines of the road line on the cutting line, and the second position is the position where the road line intersects the cutting line. The process by which the server determines each objective sub-function in the objective function based on the attribute information of the multiple cutting lines includes the following steps.
[0181] (1) Based on the attribute information of each of the multiple cutting lines, the server determines the center error function of each road line relative to the multiple cutting lines. The center error function is used to measure the difference between the first position and the second position.
[0182] In this embodiment, the fifth sub-condition is used to make the distances from the left and right edge lines to the road line as equal as possible, that is, to require that the midpoint of the first intersection point and the second intersection point on the same cutting line be on the road line as much as possible.
[0183] Taking the i-th (i = 1, ..., M) cutting line as an example, assume that the first distance between the first intersection point of the left edge line and the left endpoint of the cutting line is... The second distance between the second intersection of the right edge line and the second intersection point on the cutting line and the left endpoint of the cutting line is The intersection of the cutting line and the road line is: The distance of the first position relative to the left endpoint of the tangent line can be expressed as:
[0184] Optionally, the center error function is used to determine the sum of squares of the differences between the distances of the first position and the second position relative to the left endpoint of the cutting line, and the center error function can be expressed as follows:
[0185] (2) The server determines the target sub-function corresponding to the fifth sub-condition based on the central error function of each road line relative to multiple cutting lines. The target sub-function corresponding to the fifth sub-condition is the sum of the multiple central error functions of each road line.
[0186] The objective function corresponding to the fifth sub-condition can be expressed as:
[0187]
[0188] In this embodiment, the objective sub-function corresponding to the fifth sub-condition can make the center of the intersection point on the left and right sidelines as close as possible to the road line, that is, make the distance from the left and right sidelines to the road line as equal as possible, so as to make the generated road as smooth and beautiful as possible, and improve the road generation effect.
[0189] In some embodiments, at least one sub-condition includes a sixth sub-condition, which is used to minimize the difference between the intervals of every two adjacent edge lines between two adjacent road lines. The edge line interval refers to the interval between the two intersection points of the right edge line of the left road line and the left edge line of the right road line on the same cutting line. The process by which the server determines each objective sub-function in the objective function based on the attribute information of multiple cutting lines includes the following steps.
[0190] (1) The server determines the interval difference function between each pair of adjacent road lines and each pair of adjacent cutting lines based on the attribute information of each of the multiple cutting lines. The interval difference function is used to measure the difference between the edge intervals of the two adjacent road lines and the two adjacent cutting lines.
[0191] Taking the i-th cutting line as an example, the distance between the intersection point on the right side of the j-th road line and the intersection point on the left side of the (j+1)-th road line is:
[0192] Taking the (i+1)th cutting line as an example, the distance between the intersection point on the right side of the j-th road line and the intersection point on the left side of the (j+1)-th road line is:
[0193] Therefore, the interval difference function can be expressed as
[0194] (2) The server determines the target sub-function corresponding to the sixth sub-condition based on the interval difference function of each two adjacent road lines relative to each two adjacent cutting lines. The target sub-function is the sum of multiple interval difference functions of each two adjacent road lines.
[0195] The objective function corresponding to the sixth sub-condition can be expressed as:
[0196]
[0197] In some embodiments, the objective function corresponding to the sixth sub-condition is similar to the objective function corresponding to the fourth sub-condition, and the objective function corresponding to the sixth sub-condition can be transformed into:
[0198]
[0199] in,
[0200]
[0201] That is, multiple non-negative intermediate variables were introduced. Simultaneously add constraint equations:
[0202] In this embodiment, the objective sub-function corresponding to the sixth sub-condition can minimize the change in the edge interval between adjacent cutting lines, thereby making the edges of adjacent road lines as parallel as possible, and making adjacent roads on the electronic map as parallel as possible, thus improving the display effect of roads on the electronic map.
[0203] In some embodiments, the edge line conditions further include at least one of a first constraint sub-condition, a second constraint sub-condition, and a third constraint sub-condition. The first constraint sub-condition indicates that the width of each road line relative to each cutting line is within a preset range. The second constraint sub-condition indicates that the first intersection of each road line is on the left side of the road line and the second intersection is on the right side of the road line. The third constraint sub-condition indicates that the right edge line of each road line is to the left of the left edge line of the adjacent road line on the right side of the road line.
[0204] The first constraint sub-condition can be expressed as the following constraint equation:
[0205]
[0206] because The first constraint subcondition can also be expressed as:
[0207]
[0208] in, This represents the minimum width of the j-th road line. This represents the maximum width of the j-th road line. The minimum and maximum widths can be set as needed.
[0209] In this embodiment, the maximum and minimum widths of the local width of the road can be limited by the first constraint sub-condition to avoid the road being too narrow or too wide.
[0210] The second constraint sub-condition can be expressed as the following constraint equation:
[0211]
[0212] In this embodiment, the second constraint sub-condition prevents the road line edge from exceeding the generated road surface, and ensures that the intersection of the left edge and the cutting line is on the left side of the road line, and the intersection of the right edge and the cutting line is on the right side of the road line.
[0213] For road line j and road line (j+1), they are adjacent, meaning the right edge of road line j and the left edge of road line (j+1) are adjacent. On the cutting line i, the distance between the intersection point of the right edge of road line j and the left endpoint of the cutting line is... The distance between the intersection point on the left edge of the (j+1)th road line and the left endpoint of the tangent line is... The spacing between the two sidelines is:
[0214]
[0215] To avoid road surface overlap generated by road lines j and j+1, restrictions should be placed on... The constraint equations are non-negative, meaning they have a minimum margin.
[0216] Therefore, the third constraint subcondition can be expressed as the following constraint equation:
[0217]
[0218] In this embodiment, the third constraint sub-condition ensures sufficient spacing between the edges of multiple roads, thus avoiding the problem of overlapping and covering of road surfaces.
[0219] In some embodiments, the objective function is the sum of the objective sub-functions corresponding to at least one of the six sub-conditions. In other embodiments, the objective function is a weighted sum of the objective sub-functions corresponding to at least one sub-condition, and the coefficients of each objective sub-function are determined based on the weights of the objective sub-functions corresponding to at least one sub-condition. In this embodiment, a weight is assigned to each objective sub-function, and the coefficients of the objective sub-functions in the objective function are determined based on the weights. This way, when solving the objective function, the different importance levels of different sub-conditions are considered, so that the final generated edge lines not only comprehensively satisfy all the sub-conditions, but also allow for further detail refinement of the edge lines, thereby further improving the quality of the generated edge lines.
[0220] For example, taking the objective function as an example that includes the objective sub-functions corresponding to the above six sub-conditions, the objective function can be expressed as:
[0221] V=K1V1+K2V2+K3V3+K4V4+K5V5+K6V6
[0222] Here, K1, K2, K3, K4, K5, and V6 are the weights corresponding to the six objective sub-functions. The larger the weight, the more important the corresponding optimization objective. The weights can be set as needed. For example, K1=3, K2=3, K3=1, K4=100, K5=10, and K6=10 can be chosen, which prioritizes ensuring that the road width is uniform and centered.
[0223] Combining the above multiple constraints, the objective function can be expressed as:
[0224]
[0225]
[0226] The solutions to be found in the objective function include... and as well as
[0227] 904. The server solves the objective function based on the edge conditions, obtaining multiple first distances and multiple second distances for each road line. The multiple first distances are used to indicate the distance of the intersection point of the left edge of the road line with multiple cutting lines relative to the multiple cutting lines. The multiple second distances are used to indicate the distance of the intersection point of the right edge of the road line with multiple cutting lines relative to the multiple cutting lines.
[0228] The objective function described above is a convex quadratic programming model. In practice, it can be solved using techniques such as OSQP (Operator-Splitting Quadratic Program) or IPOPT (Interior Point Optimizer). Convex quadratic programming models possess excellent properties: because it is a convex optimization problem, the local optimum is also the global optimum, thus ensuring consistent results and guaranteeing stability. Furthermore, the solution speed is fast.
[0229] In this embodiment, steps 903-904 determine multiple first distances and multiple second distances for each road line based on edge conditions and the attribute information of multiple cutting lines. In this embodiment, the values of parameters in the objective function are determined based on the attribute information, and then the objective function is solved based on the edge conditions. This yields first and second distances that meet the edge conditions, and these distances are used to determine the intersection points on the edges, ensuring that the generated edges meet the edge conditions. Therefore, roads displayed on electronic maps based on edge conditions can avoid poor road shapes due to abrupt changes in road width, improving the display effect of roads on electronic maps, i.e., improving the quality of electronic maps. Furthermore, by solving the objective function, multiple first and second distances can be obtained simultaneously, thereby improving the efficiency of obtaining multiple first and second distances.
[0230] It should be noted that steps 903-904 are only one optional implementation of this process. Other implementation methods can also be used to implement this process, which will not be elaborated here.
[0231] 905. For each road line, the server determines multiple first intersection points and multiple second intersection points based on multiple first distances and multiple second distances. The multiple first intersection points are used to generate the left side line of the road line in the electronic map, and the multiple second intersection points are used to generate the right side line of the road line in the electronic map.
[0232] Among them, based on the first distance Second distance Determine the first and second intersection points. The coordinates of the first intersection point on the left edge of the j-th road line in the orthogonal coordinate system are: By determining the product of the first distance and the unit vector, and then summing this product with the coordinates of the left endpoint of the cutting line, we can obtain the coordinates of the first intersection point, as shown below:
[0233]
[0234] Multiple first intersections Connecting them sequentially forms the left side line of the j-th road line.
[0235] The coordinates of the shape point on the right sideline of the j-th road in the orthogonal coordinate system are: By determining the product of the second distance and the unit vector, and then summing this product with the coordinates of the left endpoint of the cutting line, we can obtain the coordinates of the second intersection point, as shown below:
[0236]
[0237] Multiple second intersections Connecting them sequentially forms the right edge of the j-th road.
[0238] The embodiment of this application ultimately generates a set of road edge lines for multiple road lines, such as... Figure 10 As shown, there are 4 road lines, and 8 road edge lines are generated for the 4 road lines.
[0239] In this embodiment, road lines can be processed in batches, meaning multiple road lines on a single road can be processed. This results in a set of road edge lines, ensuring reasonable spacing between main and auxiliary roads on the same road, preventing road overlap and ensuring sufficient parallelism, aesthetics, and smoothness, thus improving the user experience in lane-level navigation. Furthermore, it eliminates the need for separate calculations of road widths and adjustments to road centerlines; road edge lines can be generated directly.
[0240] The edge line conditions provided in this application embodiment can achieve at least one of the following road effects: the edge line itself is as smooth as possible; the road width is as close as possible to the expected width, and is neither too wide nor too narrow; the change in road width is as smooth as possible, avoiding abrupt width changes; the distance from the left and right edge lines to the road line is as equal as possible. If there are multiple nearly parallel roads in the same direction, there is sufficient spacing between the edge lines of these roads to avoid the problem of overlapping and encroaching on the road surface; if there are multiple nearly parallel roads in the same direction, these roads are as parallel as possible to each other.
[0241] The objective function in this embodiment is an optimization mathematical model. By introducing multiple objective sub-functions and constraint equations, it comprehensively considers the distance and smoothness between intersections of road edges. By solving the objective function, the optimal positions of the intersections can be obtained. Connecting these intersections sequentially yields the road edges. By generating optimal road edges, reasonable spacing and sufficient parallelism between roads are ensured, improving the rendering effect of roads and enhancing the user experience of lane-level navigation. The method provided in this embodiment makes the entire process robust, adaptable to complex scenes, and fully automated, requiring no manual intervention and significantly reducing labor costs.
[0242] This application provides a method for determining intersection points. The method sets multiple intersecting cutting lines for a road line. Using these cutting lines and edge line conditions, multiple first distances and multiple second distances are obtained for each road line. Since these multiple first distances and multiple second distances indicate the distances of the intersection points on the left and right edge lines relative to the cutting lines, the first and second intersection points of the left and right edge lines with the cutting lines can be determined based on the first and second distances. After determining the first and second intersection points, when generating edge lines in an electronic map, the left edge line can be generated based on the first intersection point, and the right edge line can be generated based on the second intersection point. Furthermore, since this method determines the intersection points on the edge lines based on edge line conditions, the generated edge lines conform to these conditions. Therefore, roads displayed on electronic maps based on edge lines can avoid poor road shapes due to abrupt changes in road width, improving the display effect of roads in electronic maps, i.e., improving the quality of electronic maps.
[0243] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0244] Please refer to Figure 11 , Figure 11 This is a block diagram of an intersection point determination apparatus according to an embodiment of this application. The apparatus has the function of implementing the above-described intersection point determination method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be the computer device described above, or it can be installed within a computer device. For example... Figure 11 As shown, the device may include:
[0245] The acquisition module 1101 is used to acquire at least one road line and edge line conditions in the electronic map. The edge line conditions are used to determine the edge lines of at least one road line.
[0246] The first determining module 1102 is used to determine the attribute information of each of the multiple cutting lines that intersect with at least one road line, wherein the attribute information of each cutting line is used to indicate the position of the cutting line relative to each road line;
[0247] The second determining module 1103 is used to determine multiple first distances and multiple second distances for each road line based on the edge line conditions and the attribute information of each of the multiple cutting lines. The multiple first distances are used to indicate the intersection of the left edge line of the road line with the multiple cutting lines, and the multiple second distances are used to indicate the intersection of the right edge line of the road line with the multiple cutting lines.
[0248] The third determining module 1104 is used to determine multiple first intersection points and multiple second intersection points for each road line based on multiple first distances and multiple second distances. The multiple first intersection points are used to generate the left side line of the road line in the electronic map, and the multiple second intersection points are used to generate the right side line of the road line in the electronic map.
[0249] In some embodiments, the second determining module 1103 is configured to:
[0250] The objective function is determined based on the individual attribute information of multiple cutting lines.
[0251] Solving the objective function based on the edge conditions yields multiple first distances and multiple second distances for each road line.
[0252] In some embodiments, the edge condition includes at least one sub-condition, and the objective function includes an objective sub-function corresponding to each of the at least one sub-condition. The second determining module 1103 is used for:
[0253] Based on the attribute information of each of the multiple cutting lines, the various objective sub-functions in the objective function are determined.
[0254] In some embodiments, at least one sub-condition includes a first sub-condition, which is used to minimize the distance between every two adjacent intersections on every edge of every road line;
[0255] The second determining module 1103 is used for:
[0256] Based on the attribute information of each of the multiple cutting lines, a distance function is determined between each two adjacent intersection points on each edge of each road line. The distance function is used to measure the distance between two adjacent intersection points.
[0257] Based on the distance function between each two adjacent intersections on each edge of each road line, the objective sub-function corresponding to the first sub-condition is determined. The objective sub-function corresponding to the first sub-condition is the sum of multiple distance functions for each road line.
[0258] In some embodiments, at least one sub-condition includes a second sub-condition, which is used to minimize the angle of inclination between the two straight lines formed by every three adjacent intersections on every edge of each road line.
[0259] The second determining module 1103 is used for:
[0260] Based on the attribute information of each of the multiple cutting lines, the modulus function between every three adjacent intersection points on each edge of each road line is determined. The modulus function is used to measure the modulus of the sum of two vectors, which are the vector pointing from the second intersection point to the first intersection point and the vector pointing from the second intersection point to the third intersection point among the three adjacent intersection points.
[0261] Based on the modulus function between every three adjacent intersection points on every edge of each road line, determine the objective sub-function corresponding to the second sub-condition. The objective sub-function corresponding to the second sub-condition is the sum of multiple modulus functions for each road line.
[0262] In some embodiments, at least one sub-condition includes a third sub-condition, which is used to minimize the difference between the width of each road line and the reference width;
[0263] The second determining module 1103 is used for:
[0264] Based on the attribute information of each of the multiple cutting lines, the width error function of each road line relative to the multiple cutting lines is determined. The width error function is used to measure the difference between the width of the road line relative to the cutting line and the reference width. The width of each road line relative to each cutting line refers to the width between the two intersection points of the two edge lines of the road line on the cutting line.
[0265] Based on the width error function of each road line relative to multiple cutting lines, the objective sub-function corresponding to the third sub-condition is determined. The objective sub-function corresponding to the third sub-condition is the sum of the multiple width error functions of each road line.
[0266] In some embodiments, at least one subcondition includes a fourth subcondition, which is used to minimize the difference between the two widths of each road line relative to each of the two adjacent cutting lines, wherein the width of each road line relative to each cutting line refers to the width between the two intersection points of the two edge lines of the road line on the cutting line.
[0267] The second determining module 1103 is used for:
[0268] Based on the attribute information of each of the multiple cutting lines, a width difference function is determined for each road line relative to each of the two adjacent cutting lines. The width difference function is used to measure the width difference of the road line relative to the two adjacent cutting lines.
[0269] Based on the width difference function of each road line relative to each of the two adjacent cutting lines, the objective sub-function corresponding to the fourth sub-condition is determined. The objective sub-function corresponding to the fourth sub-condition is the sum of multiple width difference functions of each road line.
[0270] In some embodiments, at least one sub-condition includes a fifth sub-condition, which is used to minimize the difference between a first position and a second position of each road line relative to each cutting line. The first position is used to indicate the center of the two intersection points of the two edge lines of the road line on the cutting line, and the second position is the position where the road line intersects the cutting line.
[0271] The second determining module 1103 is used for:
[0272] Based on the attribute information of each of the multiple cutting lines, the center error function of each road line relative to the multiple cutting lines is determined. The center error function is used to measure the difference between the first position and the second position.
[0273] Based on the central error function of each road line relative to multiple cutting lines, the objective sub-function corresponding to the fifth sub-condition is determined. The objective sub-function corresponding to the fifth sub-condition is the sum of the multiple central error functions of each road line.
[0274] In some embodiments, at least one sub-condition includes a sixth sub-condition, which is used to minimize the difference between the intervals of every two adjacent edge lines between two adjacent road lines. The edge line interval refers to the interval between the two intersection points of the right edge line of the left road line and the left edge line of the right road line on the same cutting line between two adjacent road lines.
[0275] The second determining module 1103 is used for:
[0276] Based on the attribute information of each of the multiple cutting lines, the interval difference function of each pair of adjacent road lines relative to each pair of adjacent cutting lines is determined. The interval difference function is used to measure the difference in the edge interval of each pair of adjacent road lines relative to each pair of adjacent cutting lines.
[0277] Based on the interval difference function of each pair of adjacent road lines relative to each pair of adjacent cutting lines, the objective sub-function corresponding to the sixth sub-condition is determined. The objective sub-function is the sum of multiple interval difference functions of each pair of adjacent road lines.
[0278] In some embodiments, the edge line conditions further include at least one of a first constraint sub-condition, a second constraint sub-condition, and a third constraint sub-condition. The first constraint sub-condition indicates that the width of each road line relative to each cutting line is within a preset range. The second constraint sub-condition indicates that the first intersection point of each road line is on the left side of the road line and the second intersection point is on the right side of the road line. The third constraint sub-condition indicates that the right edge line of each road line is to the left of the left edge line of the adjacent road line on the right side of the road line.
[0279] In some embodiments, the second determining module 1103 is further configured to:
[0280] Based on the weights of the objective sub-functions corresponding to at least one sub-condition, the coefficients of each objective sub-function in the objective function are determined. The objective function is a weighted sum of the objective sub-functions corresponding to at least one sub-condition.
[0281] This application provides an intersection point determination device. This device sets multiple intersecting cutting lines for road lines. Using these cutting lines and edge line conditions, it obtains multiple first distances and multiple second distances for each road line. Since these multiple first distances and multiple second distances respectively indicate the distances of the intersection points on the left and right edge lines relative to the cutting lines, the first and second intersection points of the left and right edge lines with the cutting lines can be determined based on the first and second distances. After determining the first and second intersection points, when generating edge lines in an electronic map, the left edge line can be generated based on the first intersection point, and the right edge line can be generated based on the second intersection point. Furthermore, since this device determines the intersection points on the edge lines based on edge line conditions, the generated edge lines conform to the edge line conditions. Therefore, roads displayed on electronic maps based on edge lines can avoid poor road shapes due to abrupt changes in road width, improving the display effect of roads in electronic maps, i.e., improving the quality of electronic maps.
[0282] Please refer to Figure 12 This diagram illustrates a structural block diagram of a computer device 1200 provided in one embodiment of this application. The computer device 1200 may be a terminal 10 or a server 20 in an implementation environment. The computer device 1200 is used to implement the intersection point determination method provided in the above embodiments. Specifically:
[0283] Typically, computer device 1200 includes a processor 1210 and a memory 1220.
[0284] Processor 1210 may include one or more processing cores, such as a quad-core processor or a twelfth-core processor. Processor 1210 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1210 may also include a main processor and a coprocessor. The main processor, also known as the central processing unit, is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1210 may include a GPU, which is responsible for executing the method steps provided in this application. In some embodiments, processor 1210 may also include an AI processor, which is used to handle computational operations related to machine learning.
[0285] The memory 1220 may include one or more computer-readable storage media, which may be non-transitory. The memory 1220 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1220 are used to store a computer program configured to be executed by one or more processors (such as a GPU) to implement the intersection determination method described above.
[0286] Those skilled in the art will understand that Figure 12 The structure shown does not constitute a limitation on the computer device 1200, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0287] This application also provides a computer-readable storage medium storing a computer program, which is loaded and executed by a processor to implement the intersection determination method of any of the above implementations.
[0288] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the intersection determination method of any of the above implementations.
[0289] In some embodiments, the computer program product involved in the present application may be deployed and executed on a computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected through a communication network.
[0290] It should be noted that the data collection and processing in this application should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0291] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.
[0292] All the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here. The above are only optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining intersection points, characterized in that, The method includes: Obtain at least one road line and edge line conditions from an electronic map, wherein the edge line conditions are used to determine the intersection points on the respective edges of the at least one road line; Determine the attribute information of each of the multiple cutting lines that intersect with the at least one road line, wherein the attribute information of each cutting line is used to indicate the position of the cutting line relative to each road line; Based on the edge line conditions and the attribute information of each of the multiple cutting lines, multiple first distances and multiple second distances are determined for each road line. The multiple first distances are used to indicate the distance of the intersection point of the left edge line of the road line with the multiple cutting lines relative to the multiple cutting lines. The multiple second distances are used to indicate the distance of the intersection point of the right edge line of the road line with the multiple cutting lines relative to the multiple cutting lines. For each road line, based on the plurality of first distances and the plurality of second distances, a plurality of first intersection points and a plurality of second intersection points are determined. The plurality of first intersection points are used to generate the left side line of the road line in the electronic map, and the plurality of second intersection points are used to generate the right side line of the road line in the electronic map.
2. The method according to claim 1, characterized in that, The determination of multiple first distances and multiple second distances for each road line based on the edge conditions and the attribute information of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, the objective function is determined; Based on the edge conditions, the objective function is solved to obtain multiple first distances and multiple second distances for each road line.
3. The method according to claim 2, characterized in that, The edge condition includes at least one sub-condition, the objective function includes an objective sub-function corresponding to each of the at least one sub-condition, and the step of determining the objective function based on the attribute information of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, each objective sub-function in the objective function is determined.
4. The method according to claim 3, characterized in that, The at least one sub-condition includes a first sub-condition, which is used to minimize the distance between every two adjacent intersections on every edge of every road line; The step of determining each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, a distance function is determined between each pair of adjacent intersection points on each edge of each road line. The distance function is used to measure the distance between the two adjacent intersection points. Based on the distance function between each two adjacent intersections on each edge of each road line, the objective sub-function corresponding to the first sub-condition is determined. The objective sub-function corresponding to the first sub-condition is the sum of multiple distance functions for each road line.
5. The method according to claim 3, characterized in that, The at least one sub-condition includes a second sub-condition, which is used to minimize the angle of inclination between the two straight lines formed by every three adjacent intersection points on every edge of each road line; The step of determining each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, a modulus function is determined between every three adjacent intersection points on each edge of each road line. The modulus function is used to measure the modulus of the sum of two vectors, which are the vector pointing from the second intersection point to the first intersection point and the vector pointing from the second intersection point to the third intersection point. Based on the modulus function between every three adjacent intersection points on every edge of each road line, determine the objective sub-function corresponding to the second sub-condition. The objective sub-function corresponding to the second sub-condition is the sum of multiple modulus functions for each road line.
6. The method according to claim 3, characterized in that, The at least one sub-condition includes a third sub-condition, which is used to minimize the difference between the width of each road line and the reference width; The step of determining each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, a width error function is determined for each road line relative to the multiple cutting lines. The width error function is used to measure the difference between the width of the road line relative to the cutting line and the reference width. The width of each road line relative to each cutting line refers to the width between the two intersection points of the two edges of the road line on the cutting line. Based on the width error function of each road line relative to the multiple cutting lines, a target sub-function corresponding to the third sub-condition is determined. The target sub-function corresponding to the third sub-condition is the sum of the multiple width error functions of each road line.
7. The method according to claim 3, characterized in that, The at least one sub-condition includes a fourth sub-condition, which is used to minimize the difference between the two widths of each road line relative to each of the two adjacent cutting lines, wherein the width of each road line relative to each cutting line refers to the width between the two edges of the road line at the two intersections on the cutting line. The step of determining each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, a width difference function is determined for each road line relative to each of the two adjacent cutting lines. The width difference function is used to measure the width difference of the road line relative to the two adjacent cutting lines. Based on the width difference function of each road line relative to each of the two adjacent cutting lines, the target sub-function corresponding to the fourth sub-condition is determined. The target sub-function corresponding to the fourth sub-condition is the sum of multiple width difference functions of each road line.
8. The method according to claim 3, characterized in that, The at least one sub-condition includes a fifth sub-condition, which is used to minimize the difference between a first position and a second position of each road line relative to each cutting line. The first position is used to indicate the center of the two intersection points of the two side lines of the road line on the cutting line, and the second position is the position where the road line intersects the cutting line. The step of determining each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, a center error function is determined for each road line relative to the multiple cutting lines. The center error function is used to measure the difference between the first position and the second position. Based on the central error function of each road line relative to the multiple cutting lines, a target sub-function corresponding to the fifth sub-condition is determined. The target sub-function corresponding to the fifth sub-condition is the sum of the multiple central error functions of each road line.
9. The method according to claim 3, characterized in that, The at least one sub-condition includes a sixth sub-condition, which is used to minimize the difference between the intervals of every two adjacent edge lines between two adjacent road lines. The edge line interval refers to the interval between the two intersection points of the right edge line of the left road line and the left edge line of the right road line on the same cutting line between two adjacent road lines. The step of determining each objective sub-function in the objective function based on the attribute information of each of the multiple cutting lines includes: Based on the attribute information of each of the multiple cutting lines, a spacing difference function is determined for each pair of adjacent road lines relative to each pair of adjacent cutting lines. The spacing difference function is used to measure the difference in the edge spacing of the two adjacent road lines relative to the two adjacent cutting lines. Based on the interval difference function of each pair of adjacent road lines relative to each pair of adjacent cutting lines, a target sub-function corresponding to the sixth sub-condition is determined. The target sub-function is the sum of multiple interval difference functions of each pair of adjacent road lines.
10. The method according to claim 3, characterized in that, The edge line conditions further include at least one of a first constraint sub-condition, a second constraint sub-condition, and a third constraint sub-condition. The first constraint sub-condition indicates that the width of each road line relative to each cutting line is within a preset range. The second constraint sub-condition indicates that the first intersection point of each road line is on the left side of the road line and the second intersection point is on the right side of the road line. The third constraint sub-condition indicates that the right edge line of each road line is to the left of the left edge line of the adjacent road line on the right side of the road line.
11. The method according to claim 3, characterized in that, The method further includes: Based on the weights of the objective sub-functions corresponding to each of the at least one sub-conditions, the coefficients of each objective sub-function in the objective function are determined, and the objective function is a weighted sum of the objective sub-functions corresponding to each of the at least one sub-conditions.
12. An intersection point determination device, characterized in that, The device includes: The acquisition module is used to acquire at least one road line and edge line conditions in the electronic map, wherein the edge line conditions are used to determine the edge line of each of the at least one road line; The first determining module is used to determine the attribute information of each of the multiple cutting lines that intersect with the at least one road line, wherein the attribute information of each cutting line is used to indicate the position of the cutting line relative to each road line; The second determining module is used to determine multiple first distances and multiple second distances for each road line based on the edge line conditions and the attribute information of each of the multiple cutting lines. The multiple first distances are used to indicate the intersection point of the left edge line of the road line with the multiple cutting lines, and the multiple second distances are used to indicate the intersection point of the right edge line of the road line with the multiple cutting lines. The third determining module is used to determine, for each road line, a plurality of first intersection points and a plurality of second intersection points based on the plurality of first distances and the plurality of second distances. The plurality of first intersection points are used to generate the left side line of the road line in the electronic map, and the plurality of second intersection points are used to generate the right side line of the road line in the electronic map.
13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store a computer program, the computer program being loaded by the processor and executed as the intersection determination method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the intersection determination method according to any one of claims 1 to 11.
15. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, a processor of a computer device reading the computer program from the computer-readable storage medium, and the processor executing the computer program to cause the computer device to perform the intersection determination method according to any one of claims 1 to 11.