Data storage method and device of vector map, computer device and storage medium
By dividing and fitting the vector line point set in the vector map into line segments, the problems of large storage space and data redundancy are solved, realizing efficient storage of vector maps and accurate construction of high-precision maps.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA AUTOMOTIVE INNOVATION CORP
- Filing Date
- 2023-09-21
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for storing vector maps suffer from data redundancy, cumbersome representation, and large storage space requirements. Furthermore, existing fitting operations cannot accurately simplify vector lines, affecting the accuracy of high-precision map construction.
By acquiring the set of vector line points in the vector map, determining the attributes of line segment points, dividing the vector points into line segments, performing line segment fitting, obtaining the fitting model, and storing the endpoints of the line segments and the fitting model, the representation of vectorized lines is simplified.
It reduces storage space usage, improves the accuracy of vector map data, and ensures the precision of high-precision map construction.
Smart Images

Figure CN117194695B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology, and in particular to a method, apparatus, computer device, and storage medium for storing vector maps. Background Technology
[0002] In recent years, with the rapid development of intelligent driving technology, high-precision maps have become an important component of intelligent driving technology. High-precision maps are usually based on pre-stored vector maps. Vector maps are typically composed of several vector lines, and each vector line is composed of several vector points. Therefore, in practical applications, when storing the data that makes up the vector map, all vector points in the vector map are usually stored, which requires a large amount of storage space.
[0003] To address the issues of redundant organization, cumbersome representation, and large storage space consumption in vector line sequence point data, existing technologies often perform a simple fitting operation on each vector point constituting a vector line in the vector map, simplifying the vector line and thus reducing the storage footprint of the vector map. However, since vector lines are not simply straight lines or curves and are highly complex, existing fitting operations cannot accurately simplify vector lines. Consequently, the simplified vector map data cannot be accurately reconstructed from the original vector map, thus affecting the accuracy of high-precision map construction. Summary of the Invention
[0004] Therefore, it is necessary to provide a data storage method, apparatus, computer equipment, and storage medium that can improve the accuracy of simplified vector map data while reducing the storage space required for vector map data.
[0005] Firstly, this application provides a method for storing vector map data. The method includes:
[0006] Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the vector line point set; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0007] Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0008] Based on the line segment properties, each line segment in the line segment set is fitted to obtain the fitting model corresponding to each fitted line segment;
[0009] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0010] In one embodiment, determining the line segment point attributes corresponding to each vector point in the vector line point set includes:
[0011] Take the first vector point in the vector line point set as the starting sequence point, and determine whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship;
[0012] If the first preset relationship is satisfied, then the line segment point attributes of the starting sequence point, the first vector point after the starting sequence point, and the second vector point are all determined to be straight line points. The first vector point is then used as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
[0013] If the first preset relationship is not satisfied, then determine whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points;
[0014] If all points are straight lines, then the second vector point is taken as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is performed.
[0015] If they are not all straight line points, then the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are determined to be curve points, and it is determined whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the second preset relationship.
[0016] If the second preset relationship is satisfied, the second vector point is taken as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
[0017] If the second preset relationship is not satisfied, the line segment point attribute of the second vector point is determined to be a curve point, and the first vector point is taken as the new starting sequence point. Then, the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
[0018] In one embodiment, determining whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies a first preset relationship includes:
[0019] Determine the first distance between the starting sequence point and the first vector point after the starting sequence point, the second distance between the first vector point and the second vector point after the starting sequence point, and the third distance between the starting sequence point and the second vector point;
[0020] Determine the sum of the first distance and the second distance, and determine the difference between the sum of the distances and the third distance;
[0021] If the difference in distance is less than the first distance threshold, then the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0022] In one embodiment, determining whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies a second preset relationship includes:
[0023] If the difference in distance is greater than the second distance threshold, then the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point is determined to satisfy the second preset relationship;
[0024] The second distance threshold is greater than the first distance threshold.
[0025] In one embodiment, based on the line segment attributes, each line segment in the line segment set is fitted to obtain a fitting model corresponding to each fitted line segment, including:
[0026] For each line segment in the set of line segments, if the line segment attribute is a straight line, then the line segment is fitted with a straight line based on the vector points of the start and end positions of the line segment to obtain the straight line model parameter values of the fitted line segment.
[0027] The general model of a straight line is initialized using the parameter values of the straight line model to obtain the straight line fitting model corresponding to the fitted line segment.
[0028] In one embodiment, based on the line segment attributes, each line segment in the line segment set is fitted to obtain a fitting model corresponding to each fitted line segment, and the method further includes:
[0029] For each line segment in the set of line segments, if the line segment attribute is a curve, then the first curve model parameter value of the fitted line segment corresponding to the line segment is determined based on the vector point of the starting position of the line segment.
[0030] Based on the parameter values of the first curve model, the reference point of the line segment, and the distance between the reference point and the vector point at the starting position, a residual term function containing the parameter values of the second curve model is constructed; where the reference point is any vector point in the line segment other than the vector point at the starting position.
[0031] The parameter values of the second curve model corresponding to the minimum function value of the residual term function are obtained by iteratively solving the least squares method;
[0032] The general curve model is initialized using the parameter values of the first curve model and the parameter values of the second curve model to obtain the curve fitting model corresponding to the fitted line segment.
[0033] In one embodiment, after fitting each line segment in the line segment set according to the line segment attributes to obtain a fitting model corresponding to each fitted line segment, the process includes:
[0034] For adjacent line segments in a set of line segments, fit a model for the connecting line segments between adjacent line segments;
[0035] Accordingly, based on the order of the line segments in the line segment set, the endpoints and fitting model corresponding to each fitted line segment are stored, including:
[0036] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment, as well as the fitting model of the connecting line segments between adjacent line segments; wherein, the fitting model of each connecting line segment is stored after the endpoints and fitting model of the starting connecting line segment of the connecting line segment, and the starting connecting line segment is the line segment that comes first in the order of the adjacent line segments corresponding to the connecting line segment.
[0037] In one embodiment, fitting a model for the connecting line segments between adjacent line segments includes:
[0038] Based on the connection points of adjacent line segments, determine the parameter values of the third curve model of the connecting line segment between adjacent line segments; the connection points are the two closest vector points in the adjacent line segments, and the two vector points are located on different line segments;
[0039] Based on the parameter values of the third curve model, the direction vectors of the two connection points, and the distance between the two connection points, determine the parameter values of the fourth curve model for the connecting line segment;
[0040] Based on the parameter values of the third and fourth curve models, the general curve model is initialized to obtain the fitting model of the connecting line segments between adjacent line segments.
[0041] Secondly, this application also provides a data storage device for vector maps. The device includes:
[0042] The attribute determination module is used to obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the set of vector line points; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0043] The line segment division module is used to divide each vector point in the vector point set into several line segments according to the line segment point attributes corresponding to each vector point. Several line segments sequentially form a line segment set. Each line segment contains at least two consecutive vector points with the same line segment point attributes. The line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0044] The line segment fitting module is used to fit each line segment in the line segment set according to the line segment attributes, and obtain the fitting model corresponding to each fitted line segment.
[0045] The fitting storage module is used to store the endpoints and fitting model corresponding to each fitted line segment according to the order of the line segments in the line segment set; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segment belongs.
[0046] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0047] Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the vector line point set; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0048] Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0049] Based on the line segment properties, each line segment in the line segment set is fitted to obtain the fitting model corresponding to each fitted line segment;
[0050] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0051] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0052] Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the vector line point set; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0053] Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0054] Based on the line segment properties, each line segment in the line segment set is fitted to obtain the fitting model corresponding to each fitted line segment;
[0055] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0056] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0057] Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the vector line point set; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0058] Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0059] Based on the line segment properties, each line segment in the line segment set is fitted to obtain the fitting model corresponding to each fitted line segment;
[0060] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0061] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0062] The aforementioned vector map data storage method, apparatus, computer equipment, and storage medium, for each vector point corresponding to a vectorized line in the vector map, determine the line segment point attributes of each vector point, and divide each vector point into several line segments based on these attributes. These line segments can sequentially form a line segment set. The attributes of each line segment are determined by the line segment point attributes of the vector points it contains. Then, for each line segment in the line segment set, line segment fitting is performed based on its corresponding line segment attributes to obtain a fitting model for each line segment. Finally, according to the position of each line segment in the line segment set, the endpoints corresponding to each line segment and the fitting model are stored sequentially. This simplifies the vectorized line into the endpoints of the fitted line segments and the fitting model for representation and storage. Compared to existing technologies that store all vector points corresponding to a vectorized line, this solution reduces storage space usage and improves the accuracy of simplified vector map data by simplifying the representation of the vectorized line. Attached Figure Description
[0063] Figure 1 This embodiment provides an application environment diagram for a vector map data storage method.
[0064] Figure 2 A flowchart illustrating the first vector map data storage method provided in this embodiment;
[0065] Figure 3 This is a schematic diagram of a vector line composed of several vector points, provided for this embodiment.
[0066] Figure 4 This is a flowchart illustrating the first method for determining the attributes of line segment points in this embodiment.
[0067] Figure 5 This is a schematic diagram of a linearly sorted vector point provided in this embodiment;
[0068] Figure 6 This is a schematic diagram of a triangular sorting vector point provided in this embodiment;
[0069] Figure 7 This is a schematic diagram of a sliding window provided in this embodiment;
[0070] Figure 8 This is a flowchart illustrating the process of determining a straight-line fitting model, as provided in this embodiment.
[0071] Figure 9 This is a schematic diagram of a process for determining a curve fitting model provided in this embodiment;
[0072] Figure 10 This is a schematic diagram of a line segment to be fitted in this embodiment;
[0073] Figure 11This embodiment provides a schematic diagram of a coordinate system including vectorized lines;
[0074] Figure 12 This is a schematic diagram of a fitted line segment and a connecting line segment provided in this embodiment;
[0075] Figure 13 Provided for this example Figure 3 The diagram shows a fitting result for a vector line.
[0076] Figures 14A-14B This is a flowchart illustrating the second vector map data storage method provided in this embodiment;
[0077] Figure 15 This is a structural block diagram of the first type of vector map data storage device provided in this embodiment;
[0078] Figure 16 This is a structural block diagram of the data storage device for the second type of vector map provided in this embodiment;
[0079] Figure 17 This is a structural block diagram of the third type of vector map data storage device provided in this embodiment;
[0080] Figure 18 This is a structural block diagram of the fourth type of vector map data storage device provided in this embodiment;
[0081] Figure 19 This is an internal structural diagram of a computer device provided in this embodiment. Detailed Implementation
[0082] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0083] The vector map data storage method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, in one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows. Figure 1As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the endpoints corresponding to each fitted line segment and the fitted model, i.e., it stores simplified representation data of the vectorized lines for subsequent reconstruction of a vector map based on this simplified representation data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a method for storing vector map data.
[0084] In one embodiment, such as Figure 2 As shown, a data storage method for vector maps is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0085] S201, Obtain the set of vector line points corresponding to the vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the set of vector line points.
[0086] In a vector map, a vector line represents any map element. A vector map can be a simplified display of spatial elements composed of several vector lines, such as roads, buildings, lane lines, and obstacles. Each vector line in this vector map is typically composed of several vector points, for example... Figure 3 This diagram illustrates the effect of a vectorized line composed of several vector points. The vector points can be points with directional two-dimensional or three-dimensional coordinates.
[0087] A vector point set in this application can be a collection of vector points that constitute a vectorized line. It should be noted that each vectorized line in a vector map corresponds to a vector point set. In this embodiment, when simplifying the vector point map data, the vector point set corresponding to each vectorized line is simplified. That is to say, the following descriptions in this embodiment will use the example of how to simplify the vector point set of a vectorized line in a vector map.
[0088] The line segment point attribute can characterize the straightness or curvature of the line segment formed by the vector points. Optionally, this line segment point attribute can be a straight line point or a curved line point.
[0089] Optionally, for each set of vector points, starting from the first vector point, three consecutive vector points are sequentially grouped as judgment points. It is determined whether the positions of this group of judgment points form a triangle. If so, the line segment point attribute of this group of judgment points is determined to be a curve point; otherwise, the line segment point attribute of this group of judgment points is determined to be a straight line point. For example, ... Figure 3 As shown, the positions of the first three vector points form a triangle, so the line segment point attribute of the first three vector points is determined to be a curve point. The positions of the fourth to sixth vector points do not form a triangle, so the line segment point attribute of the fourth to sixth vector points is determined to be a straight line point.
[0090] S202, based on the line segment point attributes corresponding to each vector point, divide each vector point in the vector line point set into several line segments, and the several line segments sequentially form a line segment set.
[0091] Each line segment contains at least two consecutive vector points with the same line segment point attributes. The line segment attributes are determined by the line segment point attributes of the vector points it contains.
[0092] Optionally, the line segment point attributes of each vector point in each vector point set are identified sequentially, and vector points with the same line segment point attributes are selected and assigned to a line segment. When two consecutive vector points are identified with different line segment point attributes, the division of a line segment is completed, and the line segment point attributes corresponding to each vector point in the line segment are used as the line segment attributes of the line segment. At the same time, the division of a new line segment begins, until all vector points in the vector point set are divided. The line segments are then sorted according to the division order, and the sorted line segments are used as a line segment set.
[0093] For example, if there are vector points P1-P10 in the vector line point set, where P1-P3 and P8-P10 are line points with straight line attributes, and P4-P7 are curve points with straight line attributes, then P1-P3 is divided into line segment 1, which has a straight line attribute; P4-P7 is divided into line segment 2, which has a curve attribute; and P8-P10 is divided into line segment 3, which has a straight line attribute. Line segments 1, 2, and 3 are then arranged in sequence to form a line segment set.
[0094] S203, based on the line segment attributes, fit each line segment in the line segment set to obtain the endpoints and fitting model corresponding to each fitted line segment.
[0095] Here, the endpoints are the vector points representing the starting and ending positions of the line segment. A fitted line segment can be a line segment whose vector points are represented by a functional expression. The fitting model can be a mathematical model used to characterize the fitted line segment.
[0096] Optionally, for each line segment, the position information of each vector point in the line segment is input into the line segment fitting tool corresponding to the line segment attribute of that line segment, thus obtaining the mathematical model of the fitted line segment fitted by the fitting tool. For example, if the line segment attribute is a straight line, the position information of each vector point in the line segment is input into the straight line fitting tool to obtain the function expression (i.e., the fitting model) of the fitted line segment corresponding to that line segment. If the line segment attribute is a curve, the position information of each vector point in the line segment is input into the curve fitting tool to obtain the function expression (i.e., the fitting model) of the fitted line segment corresponding to that line segment. After determining the fitted line segment corresponding to each line segment, the mathematical model corresponding to the fitted line segment is used as the fitting model, and the first and last vector points in the fitted line segment are selected as endpoints according to the extension direction of the vector lines.
[0097] S204 stores the endpoints and fitting model corresponding to each fitted line segment according to the order of the line segments in the line segment set.
[0098] In this model, the endpoints of all fitted line segments and the fitted model are simplified representations of vectorized lines. The endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0099] Optionally, according to the order of the line segments in the line segment set, the endpoints corresponding to each fitted line segment and the fitted model are stored in the local device in sequence. Optionally, the endpoints of the fitted line segments can be determined by sorting and selecting the first and last vector points in the fitted line segments as endpoints according to the direction of vector line extension.
[0100] It should be noted that the purpose of storing the endpoints and fitting models of the fitted line segments corresponding to each vectorized line in this embodiment is so that when a high-precision map needs to be constructed later, each vectorized line can be restored based on the endpoints and fitting models of the fitted line segments corresponding to each vectorized line, and then a vector map can be constructed based on each vectorized line. Finally, the high-precision map can be constructed based on the vector map.
[0101] The aforementioned data storage method for vector maps involves determining the line segment attributes of each vector point corresponding to a vectorized line in the vector map. Based on these attributes, each vector point is divided into several line segments, which sequentially form a line segment set. The attributes of each line segment are determined by the line segment attributes of the vector points it contains. Then, for each line segment in the set, line segment fitting is performed based on its corresponding attributes to obtain a fitting model for each line segment. Finally, according to the position of each line segment in the line segment set, the endpoints and fitting models of each line segment are stored sequentially. This simplifies the vectorized line into a representation of the endpoints and fitting models of the fitted line segments, which are then stored. Compared to existing technologies that store all vector points corresponding to a vectorized line, this solution reduces storage space usage and improves the accuracy of the simplified vector map data by simplifying the representation of the vectorized line.
[0102] Figure 4 This is a flowchart illustrating the process of determining line segment point attributes in one embodiment. To ensure accurate fitting of the vectorized line subsequently, based on the above embodiment, the segmentation of vector points into line segments is introduced. This ensures more accurate segmentation of vector points with determined line segment attributes. Therefore, this embodiment provides an optional method for determining line segment attributes, including the following steps:
[0103] S401 uses the first vector point in the vector line point set as the starting sequence point.
[0104] Optionally, for each set of vector line points in the vector map, the first vector point in that set is selected as the starting sequence point.
[0105] S402 Determine whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship. If yes, proceed to step S403; otherwise, proceed to step S404.
[0106] The first preset relationship can refer to whether a straight line can be formed between the starting sequence point, the first vector point, and the second vector point.
[0107] Optionally, a first distance is determined between the starting sequence point and the first vector point after the starting sequence point, a second distance is determined between the first vector point and the second vector point after the starting sequence point, and a third distance is determined between the starting sequence point and the second vector point; the sum of the first distance and the second distance is determined, and the difference between the sum of the distances and the third distance is determined; if the difference in distances is less than the first distance threshold, then the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0108] Specifically, the first and second vector points following the starting sequence point are selected. Based on the position information of the starting sequence point and the first vector point following it, the distance between the starting sequence point and the first vector point is calculated according to formula (1-1) as the first distance. The distance between the first vector point and the second vector point following it is calculated according to formula (1-1) as the second distance. The distance between the starting sequence point and the second vector point is calculated according to formula (1-1) as the third distance. Furthermore, it is determined whether the determined first, second, and third distances satisfy formula (1-2). If they do, the positional relationship between the starting sequence point and the first and second vector points following it satisfies the first preset relationship; otherwise, the first preset relationship is not satisfied.
[0109]
[0110] Where L represents the distance between any two vector points, x b Let x be the coordinate value of vector point b in the X-axis direction. a Let y be the coordinates of vector point a in the X-axis direction. b Let y be the coordinates of vector point b along the Y-axis. a Let be the coordinates of vector point a in the Y-axis direction.
[0111] l 12 +l 23 -l 13 <thresh1 (1-2)
[0112] Among them, l 12 The first distance, l, represents the distance between the starting sequence point and the first vector point. 23 The second distance, l, represents the distance between the first vector point and the second vector point. 13 The third distance is represented by the starting sequence point and the second vector point, and thresh1 represents the first distance threshold.
[0113] For example, such as Figure 5 The diagram shows the sorting of line vector points. Point p1 is the starting point, point p2 is the first vector point, point p3 is the second vector point, and line segment l... 12 Indicates the first distance, line segment l 23 The second distance indicates that the starting sequence point, the first vector point, and the second vector point can form a straight line, which satisfies the first preset relationship corresponding to the above formula (1-2). At this time, S403 is executed.
[0114] like Figure 6 The diagram shows the sorting of triangular vector points. Point p4 is the starting sequence point, point p5 is the first vector point, point p6 is the second vector point, and line segment l... 12 Indicates the first distance, line segment l 23 Indicates the second distance, line segment l 13 The third distance indicates that the first, second, and third distances form a triangle, which does not satisfy the first preset relationship corresponding to the above formula (1-2). At this time, S404 is executed.
[0115] If the first preset relationship is satisfied, S403 determines that the line segment point attributes of the starting sequence point, the first vector point after the starting sequence point, and the second vector point are all straight line points, and takes the first vector point as the new starting sequence point, and returns to execute the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0116] Optionally, if the first preset relationship is satisfied, it proves that a straight line can be formed between the determined starting sequence point, the first vector point after the starting sequence point, and the second vector point. Therefore, the line segment point attribute of the determined starting sequence point, the first vector point, and the second vector point can be determined as a straight line point, and the first vector point can be used as the new starting sequence point. Then, the operation of S402 is returned.
[0117] If the first preset relationship is not satisfied, then determine whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points. If yes, then execute step S405; otherwise, execute step S406.
[0118] Optionally, if the first preset relationship is not satisfied, it proves that the starting sequence point, the first vector point after the starting sequence point, and the second vector point cannot form a straight line. Therefore, it can be further determined whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points.
[0119] It should be noted that for each iteration of the judgment process, the line segment attributes of the starting sequence point and the first vector point thereafter are already determined. For example, if this iteration is the first iteration, the line segment attribute of the starting sequence point and the first vector point thereafter is a straight line point by default. If it is not the first iteration, the line segment attribute of the starting sequence point and the first vector point thereafter can be determined from the previous iteration.
[0120] If all points are straight lines, then the second vector point is used as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is performed.
[0121] If S406 are not all straight line points, then the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are all curve points.
[0122] Optionally, if the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are not all straight line points, then only the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are determined to be curve points. For the second vector point, its line segment point attributes are further determined through subsequent steps.
[0123] S407 Determine whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the second preset relationship. If it satisfies, proceed to step S408; otherwise, proceed to step S409.
[0124] The second preset relationship can be used to determine whether the first vector point after the starting sequence point is a breakpoint. The second distance threshold is greater than the first distance threshold.
[0125] Optionally, this step can, based on the above steps, determine whether the difference in distances determined in the above steps is greater than a second distance threshold (i.e., as shown in Formulas 1-3 below). If the difference in distances is greater than the second distance threshold, then the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point is determined to satisfy the second preset relationship. That is, if the difference is greater than the second distance threshold, then the positional relationship between the starting sequence point, the first vector point, and the second vector point is considered to satisfy the second preset relationship. At this time, it is proven that the angle between the first connecting line (i.e., the connecting line between the starting sequence point and the first vector point) and the second connecting line (i.e., the connecting line between the first vector point and the second vector point) is too large (usually greater than 90°), so the first vector point is a breakpoint. If the difference is not greater than the first distance threshold, then the positional relationship between the starting sequence point, the first vector point, and the second vector point is considered not to satisfy the second preset relationship.
[0126] l 12 +l 23 -l 13 >thresh2 (1-3)
[0127] Among them, l 12 The first distance, l, represents the distance between the starting sequence point and the first vector point. 23 The second distance, l, represents the distance between the first vector point and the second vector point. 13The third distance is represented by thresh2, which represents the second distance threshold.
[0128] It should be noted that in this embodiment, the second distance threshold is greater than the first distance threshold. The specific values of the two thresholds can be determined in advance based on experience.
[0129] If the second preset relationship is satisfied, S408 will take the second vector point as the new starting sequence point and return to perform the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0130] Optionally, if the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the second preset relationship, then it is proven that the first vector point is a breakpoint, that is, the first vector point is the end point of a line segment. At this time, its next vector point can be directly set as the second vector point, and the operation of S402 is returned.
[0131] If the second preset relationship is not satisfied, S409 determines that the line segment point attribute of the second vector point is a curve point, and takes the first vector point as the new starting sequence point, and returns to execute the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0132] Optionally, if the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point does not satisfy the second preset relationship, it proves that the first vector point is not a breakpoint at this time, and the second vector point can be used as the new starting sequence point, and the operation of S402 is returned.
[0133] For example, this embodiment can construct the sequence for the starting point, the first vector point after the starting point, and the second vector point. Figure 7 The sliding window P shown f In this context, the initial sequence point is v1 in the sliding window, the first vector point is v2 in the sliding window, and the second vector point is v3 in the sliding window. Assume v1 is point p1, v2 is point p2, and v3 is point p3. If the sliding window P at this point... f If the first preset condition in S402 is met, the sliding window slides one position to the right and then returns to execute S402, meaning that v1 becomes p2 at this point; if the sliding window P f If the starting sequence point and the first vector point after the starting sequence point in S404 are both straight line points (i.e., v1 and v2 are both straight line points), then the sliding window slides two positions to the right and returns to execute S402; if the sliding window P at this time... fIf the second preset condition in S407 is met, the sliding window slides one position to the right and then returns to execute S402, meaning that v1 becomes p2 at this point; if the sliding window P f If the first vector point after the starting sequence point in S404 is the breakpoint (i.e., v2 is the breakpoint), then the sliding window slides two positions to the right and returns to execute S402.
[0134] S403, S405, S408, and S409 all involve returning to execute S402. It should be noted that before each return operation, it is necessary to determine whether the second vector point is the last vector point in the vector line point set. If not, return to execute S402. If so, for the return to execute S402 operations in S403 and S408, the line segment point attributes of the new starting sequence point and the first vector point after the starting sequence point can be directly set to straight line points; for the return to execute S402 operations in S405, the line segment point attribute of the new starting sequence point can be directly set to straight line points; and for the return to execute S402 operations in S409, the line segment point attribute of the new starting sequence point can be directly set to curve points.
[0135] The above method for determining line segment attributes checks whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies a first preset relationship. If it does, then the starting sequence point, the first vector point, and the second vector point can be directly determined to be straight line points. If the first preset condition is not met, then it is necessary to further determine whether the starting sequence point and the first vector point are both straight line points. If they are not straight line points, then it is necessary to further determine whether the positional relationship between the starting sequence point, the first vector point, and the second vector point satisfies a second preset relationship. If it is determined that the second preset relationship is not met, then the starting sequence point, the first vector point, and the second vector point can be directly determined to be curve points. This method can more accurately and reasonably determine the line segment attributes of the starting sequence point, the first vector point, and the second vector point, further providing data support for subsequent segment division based on the line segment attributes of vector points.
[0136] Figure 8 This is a flowchart illustrating the process of determining a linear fitting model in one embodiment. Based on the above embodiments, this embodiment provides an alternative method for determining a linear fitting model, including the following steps:
[0137] For each line segment in the line segment set, if the line segment attribute is a straight line, S801 performs a straight line fitting on the line segment based on the vector points of the starting and ending positions of the line segment to obtain the straight line model parameter values of the fitted line segment.
[0138] The linear model parameter values can be the independent variable coefficients or constant terms in the linear fitting model. That is, the linear model parameter values corresponding to A, B, and C in the following formula.
[0139] Optionally, for each line segment in the line segment set, if the line segment attribute is a straight line, then the first vector point in the line segment is taken as the starting vector point (i.e., the starting vector point), and the last vector point in the line segment is taken as the ending vector point (i.e., the ending vector point). The position information of the starting vector point and the ending vector point can be calculated according to the pre-set straight line fitting calculation logic (i.e., formulas 1-4 to 1-7 below) to obtain the straight line model parameter values of the fitted line segment (i.e., the straight line model parameter values corresponding to A, B, and C).
[0140] For example, the logic for calculating the line fitting is shown in the following formulas (1-4 to 1-7).
[0141]
[0142] When Δx = 0 (1-5)
[0143] When Δy = 0 (1-6)
[0144] When Δy≠0 and Δx≠0 (1-7)
[0145] Where Δx can be the distance difference in the x-direction between the starting vector point and the ending vector point, Δy can be the distance difference in the y-direction between the starting vector point and the ending vector point, xb is the x-value of the ending vector point, xa is the x-value of the starting vector point, yb is the y-value of the ending vector point, ya is the y-value of the starting vector point, and A, B, and C are the linear model parameter values.
[0146] S802 initializes the general linear model using linear model parameter values to obtain the linear fitting model corresponding to the fitted line segment.
[0147] Optionally, the parameter values of the straight line model can be substituted into the pre-set general straight line model (i.e., formulas 1-8 below) to complete the initialization of the general straight line model, and further obtain the straight line fitting model corresponding to the fitted line segment.
[0148] An exemplary, exemplary, general model of a straight line is shown in the following formula (1-8).
[0149] Ax + By + C = 0 (1-8)
[0150] Where A, B, and C are all linear model parameter values, x is the value of any point on the fitted line in the X-axis direction, and y is the value of any point on the fitted line in the Y-axis direction.
[0151] The above-described method for determining the straight line fitting model, for line segments whose attribute is straight line, performs straight line segment fitting on the line segment based on the vector points of the starting and ending positions of the line segment, obtains the straight line model parameter values of the fitted line segment, and initializes the general straight line model based on the straight line model parameter values to obtain the straight line fitting model corresponding to the fitted line segment. This method, for line segments whose attribute is straight line, determines the straight line model parameter values, and further determines the fitting model of the straight line segment more accurately based on the straight line model parameter values and the general straight line model.
[0152] Figure 9 This is a flowchart illustrating the process of determining a curve fitting model in one embodiment. Based on the above embodiments, this embodiment provides an optional method for determining a curve fitting model, including the following steps:
[0153] For each line segment in the line segment set, if the line segment attribute is a curve, S901 determines the first curve model parameter value of the fitted line segment corresponding to the line segment based on the vector point of the starting position of the line segment.
[0154] Optionally, for each line segment in the set of line segments, if the line segment attribute is a curve, then the first vector point in the line segment is taken as the starting vector point (i.e., the starting vector point), and the last vector point in the line segment is taken as the ending vector point (i.e., the ending vector point) (for example, Figure 10 The line segment shown is a curve, where point pa represents the starting vector point and point pb represents the ending vector point. Using formula 1-9 below, the parameter values of the first curve model (i.e., the zero-order coefficients A1 and A2) are determined based on the position information of the starting vector point. Specifically, as shown in formula 1-9 below, the abscissa position of the starting vector point is used as the zero-order coefficient A1 in the x-expression of the curve general model, and the ordinate position of the starting vector point is used as the zero-order coefficient A2 in the y-expression of the curve general model.
[0155]
[0156] Where A1 and A2 are the parameter values of the first curve model, xa is the x value of the starting vector point, and yb is the y value of the starting vector point.
[0157] S902 constructs a residual term function containing the parameter values of the second curve model based on the parameter values of the first curve model, the reference point of the line segment, and the distance between the reference point and the vector point at the starting position.
[0158] The reference point is any vector point in the line segment other than the vector point at the starting position.
[0159] Optionally, each vector point in the line segment, except for the starting and ending vector points, is sequentially used as a reference point. The distance tn between the reference point and the ending vector point is calculated based on the formulas 1-10 below. The first curve model parameter values A1 and A2, the position information (xn, yn) of the reference points in the line segment, and the distance tn between the reference points and the ending vector point are all substituted into a pre-set residual term function containing the second curve model parameter values (i.e., as shown in formulas 1-11 below) to complete the construction of the residual term function.
[0160] For example, the distance calculation logic is shown in the following formula (1-10).
[0161]
[0162] Where tn represents the distance from the nth reference point to the termination vector point, Δx represents the difference between the x-values of the reference point and the termination vector point, and Δy represents the difference between the y-values of the reference point and the termination vector point.
[0163] For example, the residual term function is shown in the following formula (1-11).
[0164]
[0165] in, This represents the x-value of the nth estimated coordinate. Let represent the y-value of the nth estimated coordinate, A1 and A2 be the parameter values of the first curve model, and B1, B2, C1, C2, D1, and D2 be the parameter values of the second curve model. n This represents the distance from the nth reference point to the termination vector point.
[0166] S903 is based on the least squares method to iteratively solve the residual term function and find the second curve model parameter value corresponding to the minimum function value.
[0167] Optionally, based on the constructed residual term function, the estimated coordinates corresponding to the residual term function are determined. Then, using a pre-set residual calculation logic (i.e., as shown in Formula 1-13 below), the residual value loss between the estimated coordinates and the reference point is calculated. n Based on the residual value loss corresponding to each reference point nThe residual values are added sequentially (as shown in Formula 1-14 below) to obtain the summation result. The summation result is compared with the preset residual threshold. The iteration can be stopped when the summation result is less than the residual threshold, or when the number of summations reaches the number threshold. The first intermediate parameter (Dr1) and the second intermediate parameter (Dr2) corresponding to the minimum summation result in the iteration process are solved based on the least squares method. The first intermediate parameter and the second intermediate parameter are substituted into the solution formulas (as shown in Formulas 1-14 to 1-19 below) corresponding to the second curve model parameter values (B1, B2, C1, C2, D1 and D2) to obtain the second curve model parameter values.
[0168] Alternatively, another way to determine the parameter values of the second curve model in this embodiment is to determine the unit vector V1(x3, y3) of the starting vector point and the unit vector v2(x4, y4) of the ending vector point, such as... Figure 10 The diagram shows a line segment to be fitted. Arrows V1 and V2 in the diagram represent the unit vectors of the starting and ending vector points, respectively.
[0169] For example, the residual value calculation logic is shown in the following formula (1-13).
[0170]
[0171] Where, loss n x represents the residual value between the estimated coordinates and the reference point. n Represents the x-value and y-value of the nth reference point. n This represents the y-value of the nth reference point. This represents the x-value of the nth estimated coordinate. This represents the y-value of the nth estimated coordinate.
[0172] For example, the residual values are summed sequentially as shown in the following formula (1-14).
[0173] loss all = loss1 + loss2 + loss3 + ... + loss n (1-14)
[0174] Where, loss all This represents the sum of the residual values, where loss1 represents the residual value obtained in the first iteration, loss2 represents the residual value obtained in the second iteration, and loss3 represents the residual value obtained in the third iteration. n This represents the residual value obtained in the nth iteration.
[0175] The derivative formula for the general model of the curve is determined based on the following formula (1-15).
[0176]
[0177] in, This represents the formula for differentiating x in the general model of a curve. The formula for the derivative of y in the general curve model is given. B1, B2, C1, C2, D1, and D2 are all parameter values of the second curve model. t represents the distance from the reference point to the termination vector point, and T represents the distance from the starting vector point to the termination vector point.
[0178] The relationship between vector points and unit vectors is based on the following formula (1-16).
[0179]
[0180] Where x3 represents the x-value of the unit vector of the starting vector point, y3 represents the y-value of the unit vector of the starting vector point, x4 represents the x-value of the unit vector of the ending vector point, and y4 represents the y-value of the unit vector of the ending vector point.
[0181] The coefficients B1 and B2 of the linear term in the parameter values of the second curve model are determined at t=0 based on the following formula (1-17).
[0182]
[0183] Where B1 and B2 represent the coefficients of the first term in the parameter values of the second curve model, x3 represents the x-value of the unit vector at the starting vector point, y3 represents the y-value of the unit vector at the starting vector point, and Dr1 represents the first intermediate parameter. The coefficients C1 and C2 of the quadratic term in the parameter values of the second curve model are determined using the following formula (1-18).
[0184]
[0185] Where C1 and C2 both represent the quadratic coefficients in the parameter values of the second curve model, xb is the x-value of the termination vector point, yb is the y-value of the termination vector point, A1 and A2 are the parameter values of the first curve model, B1 and B2 both represent the linear coefficients in the parameter values of the second curve model, T represents the distance from the starting vector point to the termination vector point, x4 represents the x-value of the unit vector of the termination vector point, y4 represents the y-value of the unit vector of the termination vector point, and Dr2 represents the second intermediate parameter.
[0186] The cubic coefficients D1 and D2 in the parameter values of the second curve model are determined based on the following formula (1-19).
[0187]
[0188] Where D1 and D2 both represent the cubic coefficients in the parameter values of the second curve model, xb is the x-value of the termination vector point, yb is the y-value of the termination vector point, A1 and A2 are the parameter values of the first curve model, B1 and B2 both represent the linear coefficients in the parameter values of the second curve model, T represents the distance from the starting vector point to the termination vector point, x4 represents the x-value of the unit vector of the termination vector point, y4 represents the y-value of the unit vector of the termination vector point, and Dr2 represents the second intermediate parameter.
[0189] S904 uses the parameter values of the first curve model and the parameter values of the second curve model to initialize the general curve model and obtain the curve fitting model corresponding to the fitted line segment.
[0190] Optionally, the obtained first curve model parameter values and second curve model parameter values are substituted into the general curve model (i.e., as shown in Formula 1-20 below) to complete the initialization of the general curve model and obtain the curve fitting model corresponding to the fitted line segment.
[0191] For example, a general model of a curve is shown in the following formula (1-20).
[0192]
[0193] Where x represents the x-value of any vector point on the fitted curve, y represents the y-value of any vector point on the fitted curve, A1 and A2 are the parameter values of the first curve model, B1, B2, C1, C2, D1 and D2 are the parameter values of the second curve model, t represents the distance from the reference point to the termination vector point, and T represents the distance from the starting vector point to the termination vector point.
[0194] It should be noted that during actual curve fitting, the following may occur: Figure 11 The diagram illustrates a scenario where one x-coordinate corresponds to multiple y-coordinates. Specifically, vector points P1, P2, and P3 have the same x-value (x1), but their y-values are different. Existing technologies using simple curve fitting methods cannot adequately address this issue of one x-coordinate corresponding to multiple y-coordinates, potentially leading to missing vector points. Therefore, this embodiment employs a cubic polynomial (i.e., the general curve model shown in Equation 1-20) to represent the curve fitting, enabling the simultaneous acquisition of multiple y-values based on a single x-value, thus better resolving the problem of one x-coordinate corresponding to multiple y-values.
[0195] The above-described method for determining the curve fitting model, for line segments whose attribute is curve, performs curve fitting on the line segment based on the vector points of the start and end positions of the line segment, obtaining the first curve model parameter values and the second curve model parameter values of the fitted line segment. Then, the general curve model is initialized based on the first curve model parameter values and the second curve model parameter values to obtain the curve fitting model corresponding to the fitted line segment. This method, for line segments whose attribute is curve, determines the first curve model parameter values and the second curve model parameter values, and further determines the fitting model of the curve line segment more accurately based on the first curve model parameter values, the second curve model parameter values, and the general curve model.
[0196] It should be noted that, in this embodiment, after fitting each line segment in the line segment set according to the line segment attributes to obtain the endpoints and fitting model corresponding to each fitted line segment, adjacent line segments can also be connected. Optionally, based on the connection points of adjacent line segments, the third curve model parameter values of the connecting line segment between adjacent line segments are determined; based on the third curve model parameter values, the direction vectors of the two connection points, and the distance between the two connection points, the fourth curve model parameter values of the connecting line segment are determined; based on the third curve model parameter values and the fourth curve model parameter values, the general curve model is initialized to obtain the fitting model of the connecting line segment between adjacent line segments. Here, the connection points are the two closest vector points among adjacent line segments, and the two vector points are located on different line segments.
[0197] Specifically, for every two adjacent fitted line segments, they need to be connected to ensure that the vector lines can be completely connected. Therefore, two adjacent fitted line segments are determined, and the line segment ranked first in the line segment set is taken as the first line segment, and the other line segment in the adjacent line segment is taken as the second line segment. The termination vector point of the first fitted line segment is taken as the connection start point, and the starting vector point of the second fitted line segment is taken as the connection end point. The connection start point is taken as the starting vector point, and the connection end point is taken as the termination vector point. Substituting these values into the above formulas 1-9, the third curve model parameter values are determined. At the same time, Dr1 and Dr2 are assumed to be 1. Based on the above formulas 1-17 to 1-19, the fourth curve model parameter values are determined. The specific details are not elaborated here.
[0198] For example, such as Figure 12The diagram shows the fitted line segments and connecting line segments. In the diagram, white dots represent vector points with curve attributes, black dots represent vector points with straight line attributes, L1 represents curve fitting, and L3 represents straight line fitting. In this embodiment, based on two adjacent fitted line segments (i.e., L1 and L3), the connecting start point represented by vector point p1 and the connecting end point represented by vector point p2 are determined. The connecting line segment represented by L2 is formed by connecting the two adjacent fitted line segments according to the vector points p1 and p2, thus completing the connection between the two adjacent fitted line segments.
[0199] Preferably, since the fitted line segments can include straight line segments, curved line segments, and connecting line segments, the process of storing the endpoints and fitting models corresponding to each fitted line segment according to the order of the line segments in the line segment set in this embodiment may further include: storing the endpoints and fitting models corresponding to each fitted line segment, as well as the fitting models of the connecting line segments between adjacent line segments, according to the order of the line segments in the line segment set. Specifically, the fitting model of each connecting line segment is stored after the endpoints and fitting models of the starting connecting line segment of that connecting line segment, where the starting connecting line segment is the line segment that appears first in the order among the adjacent line segments corresponding to the connecting line segment.
[0200] For example, such as Figure 13 The diagram shows the fitting results of the vector lines. Black dots represent the endpoints of straight line segments, white dots represent the endpoints of curved line segments, short dashed lines represent the fitted line segments of straight line segments, dotted dashed lines represent the fitted line segments of curved line segments, and dotted-dashed lines represent the connecting line segments between adjacent fitted line segments. In the diagram, L1, L3, L7, L11, and L13 represent the fitted line segments of straight line segments; L5 and L9 represent the fitted line segments of curved line segments; and L2, L4, L6, L8, L10, and L12 represent the connecting line segments between adjacent fitted line segments. Correspondingly, storage... Figure 13 When simplifying the data for the corresponding vectorized lines, the endpoints and fitting models of L1, L2, L3, and so on can be stored sequentially.
[0201] In one embodiment, this embodiment provides an optional method for data simplification of vector maps, illustrated by applying the method to a server as an example. Figures 14A-14B As shown, the method includes the following steps:
[0202] S1401 obtains the set of vector line points corresponding to the vectorized lines in the vector map, and takes the first vector point in the set of vector line points as the starting sequence point.
[0203] Among them, vectorized lines represent any map element in a vector map; line segment point attributes represent the straightness or curvature of the line segments formed by vector points.
[0204] S1402 determines the first distance between the starting sequence point and the first vector point after the starting sequence point, the second distance between the first vector point and the second vector point after the starting sequence point, and the third distance between the starting sequence point and the second vector point.
[0205] S1403 determines the sum of the first distance and the second distance, and determines the difference between the sum of the distances and the third distance.
[0206] S1404 Determine whether the distance difference is less than the first distance threshold. If yes, determine that the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship, and execute step S1405. If no, execute step S1406.
[0207] S1405 determines that the line segment point attributes of the starting sequence point, the first vector point after the starting sequence point, and the second vector point are all straight line points, and takes the first vector point as the new starting sequence point, and returns to the execution step S1402.
[0208] If S1406 is not satisfied, then determine whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points.
[0209] If all points in step S1407 are straight lines, then the second vector point will be used as the new starting point of the sequence, and the process will return to step S1402.
[0210] If S1408 is not a straight line point, then determine that the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are all curve points, and continue to execute step S1409.
[0211] S1409 Determine whether the distance difference is greater than the second distance threshold. If yes, determine that the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the second preset relationship, and continue to execute step S1410. If no, continue to execute step S1411.
[0212] The second distance threshold is greater than the first distance threshold.
[0213] If S1410 is true, then the second vector point is used as the new starting sequence point, and the process returns to step S1402.
[0214] If not, then determine the line segment point attribute of the second vector point as a curve point, and take the first vector point as the new starting sequence point, and return to step S1402.
[0215] S1412 divides each vector point in the vector point set into several line segments based on the line segment point attributes corresponding to each vector point. These line segments sequentially form a line segment set.
[0216] Each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0217] S1413 Determine whether the line segment attribute of each line segment in the line segment set is a straight line. If yes, continue to execute step S1414; otherwise, continue to execute step S1416.
[0218] For each line segment in the line segment set, if the line segment attribute is a straight line, then based on the vector points of the start and end positions of the line segment, a straight line segment fitting is performed on the line segment to obtain the straight line model parameter values of the fitted line segment.
[0219] S1415 initializes the general linear model using linear model parameter values to obtain the linear fitting model corresponding to the fitted line segment.
[0220] S1416 For each line segment in the line segment set, if the line segment attribute is a curve, then determine the first curve model parameter value of the fitted line segment corresponding to the line segment based on the vector point of the starting position of the line segment.
[0221] S1417 constructs a residual term function containing the parameter values of the second curve model based on the parameter values of the first curve model, the reference point of the line segment, and the distance between the reference point and the vector point at the starting position.
[0222] The reference point is any vector point in the line segment other than the vector point at the starting position.
[0223] S1418 is based on the least squares method to iteratively solve the residual term function and find the second curve model parameter value corresponding to the minimum function value.
[0224] S1419 uses the parameter values of the first curve model and the parameter values of the second curve model to initialize the general curve model and obtain the curve fitting model corresponding to the fitted line segment.
[0225] The endpoints are the vector points at the beginning and end positions of the line segment.
[0226] S1420 fits a model for the connecting segments between adjacent line segments in a set of line segments.
[0227] S1421 stores the endpoints and fitting model corresponding to each fitted line segment, as well as the fitting model of the connecting line segments between adjacent line segments, according to the order of the line segments in the line segment set.
[0228] The fitting model for each connecting line segment is stored after the endpoints of the starting connecting line segment and the fitting model. The starting connecting line segment is the line segment that appears first in the sequence among the adjacent line segments corresponding to the connecting line segment. The endpoints of the fitting line segment are the vector points of the starting and ending positions of the line segment to which the fitting line segment belongs.
[0229] It should be noted that, due to the large number of steps in this embodiment, the flowchart of this embodiment is divided into... Figure 14A and Figure 14B It is represented in two parts.
[0230] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0231] Based on the same inventive concept, this application also provides a vector map data storage device for implementing the vector map data storage method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more vector map data storage device embodiments provided below can be found in the limitations of the vector map data storage method described above, and will not be repeated here.
[0232] In one embodiment, such as Figure 15 As shown, a data storage device 1 for a vector map is provided, comprising: an attribute determination module 10, a line segment division module 11, a line segment fitting module 12, and a fitting storage module 13, wherein:
[0233] The attribute determination module 10 is used to obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the set of vector line points; wherein the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segments formed by the vector points;
[0234] The line segment division module 11 is used to divide each vector point in the vector point set into several line segments according to the line segment point attributes corresponding to each vector point. The several line segments sequentially form a line segment set. Each line segment contains at least two consecutive vector points with the same line segment point attributes. The line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0235] The line segment fitting module 12 is used to fit each line segment in the line segment set according to the line segment attributes, and obtain the fitting model corresponding to each fitted line segment.
[0236] The fitting storage module 13 is used to store the endpoints and fitting models corresponding to each fitted line segment according to the order of the line segments in the line segment set; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0237] In one embodiment, Figure 15 The attribute determination module 10 includes:
[0238] The first determination unit is used to take the first vector point in the vector line point set as the starting sequence point, and determine whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0239] The line determination unit is used to determine that if the first preset relationship is satisfied, the line segment point attributes of the starting sequence point, the first vector point after the starting sequence point, and the second vector point are all line points, and the first vector point is used as the new starting sequence point. Then, it returns to perform the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0240] The straight line judgment unit is used to determine whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points if the first preset relationship is not satisfied.
[0241] The first starting point determination unit is used to determine whether the positional relationship between the starting point, the first vector point after the starting point, and the second vector point satisfies the first preset relationship if all of them are straight line points.
[0242] The curve determination unit is used to determine that the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are all curve points if they are not all straight line points, and to determine whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the second preset relationship.
[0243] The second starting point determination unit is used to determine whether the positional relationship between the second vector point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship if the second preset relationship is satisfied.
[0244] The third starting point determination unit is used to determine the line segment point attribute of the second vector point as a curve point if the second preset relationship is not satisfied, and to take the first vector point as the new starting sequence point, and return to perform the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point and the second vector point satisfies the first preset relationship.
[0245] In one embodiment, the first determination unit includes:
[0246] The distance determination subunit is used to determine the first distance between the starting sequence point and the first vector point after the starting sequence point, the second distance between the first vector point and the second vector point after the starting sequence point, and the third distance between the starting sequence point and the second vector point.
[0247] The distance difference determination subunit is used to determine the sum of the first distance and the second distance, and to determine the difference between the sum of the distances and the third distance;
[0248] The first determination subunit is used to determine that if the difference in distances is less than a first distance threshold, the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies a first preset relationship.
[0249] In one embodiment, the curve determination unit is further configured to determine that the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies a second preset relationship if the difference in distances is greater than a second distance threshold; wherein the second distance threshold is greater than a first distance threshold.
[0250] In one embodiment, such as Figure 16 As shown, Figure 15 The line segment fitting module 12 includes:
[0251] The line parameter determination unit 120 is used to perform line segment fitting on each line segment in the line segment set. If the line segment attribute of the line segment is a line, then the line segment is fitted with a line segment based on the vector points of the start and end positions of the line segment to obtain the line model parameter values of the fitted line segment.
[0252] The straight line model determination unit 121 is used to initialize the general straight line model using the straight line model parameter values to obtain the straight line fitting model corresponding to the fitted line segment.
[0253] In one embodiment, such as Figure 17As shown, the line segment fitting module 12 in Figure 14 also includes:
[0254] The first curve parameter determination unit 122 is used to determine the first curve model parameter value of the fitted line segment corresponding to each line segment in the line segment set if the line segment attribute of the line segment is a curve, based on the vector point of the starting position of the line segment.
[0255] The residual function determination unit 123 is used to construct a residual term function containing the parameter values of the second curve model based on the parameter values of the first curve model, the reference point of the line segment, and the distance between the reference point and the vector point at the starting position; wherein, the reference point is the vector point in the line segment other than the vector point at the starting position.
[0256] The second curve parameter determination unit 124 is used to solve the second curve model parameter value corresponding to the minimum function value of the residual term function based on the least squares method iterative solution.
[0257] The curve model determination unit 125 is used to initialize the general curve model using the first curve model parameter values and the second curve model parameter values to obtain the curve fitting model corresponding to the fitted line segment.
[0258] In one embodiment, Figure 15 The line segment fitting module 12 is also used to fit a fitting model of the connecting line segments between adjacent line segments in the line segment set.
[0259] Correspondingly, the fitting storage module 13 can also be used to store the endpoints and fitting models corresponding to each fitted line segment, as well as the fitting models of the connecting line segments between adjacent line segments, according to the order of the line segments in the line segment set; wherein, the fitting model of each connecting line segment is stored after the endpoints and fitting models of the starting connecting line segment of the connecting line segment, and the starting connecting line segment is the line segment that comes first in the order among the adjacent line segments corresponding to the connecting line segment.
[0260] In one embodiment, such as Figure 18 As shown, Figure 15 The line segment fitting module 12 in the middle also includes:
[0261] The third curve parameter determination unit 126 is used to determine the third curve model parameter value of the connecting line segment between adjacent line segments based on the connection point of the adjacent line segments; the connection point is the two vector points that are closest to each other in the adjacent line segments, and the two vector points are located on different line segments;
[0262] The fourth curve parameter determination unit 127 is used to determine the fourth curve model parameter value of the connecting line segment based on the third curve model parameter value, the direction vector of the two connecting points, and the distance between the two connecting points.
[0263] The connection model determination unit 128 is used to initialize the general curve model based on the parameter values of the third curve model and the fourth curve model to obtain the fitting model of the connection line segment between adjacent line segments.
[0264] The modules in the data storage device for the aforementioned vector map can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0265] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 19 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a vector map data storage method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0266] Those skilled in the art will understand that Figure 19 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0267] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0268] Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the vector line point set; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0269] Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0270] Based on the line segment attributes, each line segment in the line segment set is fitted to obtain the fitting model corresponding to each fitted line segment;
[0271] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0272] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0273] Take the first vector point in the vector line point set as the starting sequence point, and determine whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship;
[0274] If the first preset relationship is satisfied, then the line segment point attributes of the starting sequence point, the first vector point after the starting sequence point, and the second vector point are all determined to be straight line points. The first vector point is then used as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
[0275] If the first preset relationship is not satisfied, then determine whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points;
[0276] If all points are straight lines, then the second vector point is taken as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
[0277] If they are not all straight line points, then the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are determined to be curve points, and it is determined whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the second preset relationship.
[0278] If the second preset relationship is satisfied, the second vector point is used as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
[0279] If the second preset relationship is not satisfied, the line segment point attribute of the second vector point is determined to be a curve point, and the first vector point is taken as the new starting sequence point. Then, the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
[0280] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0281] Determine the first distance between the starting sequence point and the first vector point after the starting sequence point, the second distance between the first vector point and the second vector point after the starting sequence point, and the third distance between the starting sequence point and the second vector point;
[0282] Determine the sum of the first distance and the second distance, and determine the difference between the sum of the distances and the third distance;
[0283] If the difference in distance is less than the first distance threshold, then the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship.
[0284] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0285] If the difference in distance is greater than the second distance threshold, then the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point is determined to satisfy the second preset relationship;
[0286] The second distance threshold is greater than the first distance threshold.
[0287] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0288] For each line segment in the set of line segments, if the line segment attribute is a straight line, then the line segment is fitted with a straight line based on the vector points of the start and end positions of the line segment to obtain the straight line model parameter values of the fitted line segment.
[0289] The general model of a straight line is initialized using the parameter values of the straight line model to obtain the straight line fitting model corresponding to the fitted line segment.
[0290] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0291] For each line segment in the set of line segments, if the line segment attribute is a curve, then the first curve model parameter value of the fitted line segment corresponding to the line segment is determined based on the vector point of the starting position of the line segment.
[0292] Based on the parameter values of the first curve model, the reference point of the line segment, and the distance between the reference point and the vector point at the starting position, a residual term function containing the parameter values of the second curve model is constructed; where the reference point is any vector point in the line segment other than the vector point at the starting position.
[0293] The parameter values of the second curve model corresponding to the minimum function value of the residual term function are obtained by iteratively solving the least squares method;
[0294] The general curve model is initialized using the parameter values of the first curve model and the parameter values of the second curve model to obtain the curve fitting model corresponding to the fitted line segment.
[0295] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0296] For adjacent line segments in a set of line segments, fit a model for the connecting line segments between adjacent line segments;
[0297] Accordingly, based on the order of the line segments in the line segment set, the endpoints and fitting model corresponding to each fitted line segment are stored, including:
[0298] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment, as well as the fitting model of the connecting line segments between adjacent line segments; wherein, the fitting model of each connecting line segment is stored after the endpoints and fitting model of the starting connecting line segment of the connecting line segment, and the starting connecting line segment is the line segment that comes first in the order of the adjacent line segments corresponding to the connecting line segment.
[0299] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0300] Based on the connection points of adjacent line segments, determine the parameter values of the third curve model of the connecting line segment between adjacent line segments; the connection points are the two closest vector points in the adjacent line segments, and the two vector points are located on different line segments;
[0301] Based on the parameter values of the third curve model, the direction vectors of the two connection points, and the distance between the two connection points, determine the parameter values of the fourth curve model for the connecting line segment;
[0302] Based on the parameter values of the third and fourth curve models, the general curve model is initialized to obtain the fitting model of the connecting line segments between adjacent line segments.
[0303] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0304] Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the vector line point set; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0305] Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0306] Based on the line segment properties, each line segment in the line segment set is fitted to obtain the fitting model corresponding to each fitted line segment;
[0307] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0308] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0309] Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the vector line point set; where the vectorized line represents any map element in the vector map; the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points;
[0310] Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of a line segment are determined by the line segment point attributes of the vector points it contains.
[0311] Based on the line segment properties, each line segment in the line segment set is fitted to obtain the fitting model corresponding to each fitted line segment;
[0312] Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment; the endpoints and fitting models of all fitted line segments serve as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points of the starting and ending positions of the line segments to which the fitted line segments belong.
[0313] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, and displayed data) are all information and data authorized by the user or fully authorized by all parties.
[0314] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0315] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0316] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for storing vector maps, characterized in that, The method includes: Obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the set; wherein the vectorized line represents any map element in the vector map; and the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points. Based on the line segment point attributes corresponding to each vector point, the vector points in the vector point set are divided into several line segments, and the several line segments sequentially form a line segment set; each line segment contains at least two consecutive vector points with the same line segment point attributes; the line segment attributes of the line segment are determined by the line segment point attributes of the vector points it contains. Based on the line segment attributes, each line segment in the line segment set is fitted to obtain a fitting model corresponding to each fitted line segment; Based on the order of the line segments in the set of line segments, the endpoints and the fitting model corresponding to each fitted line segment are stored; the endpoints and fitting models of all fitted line segments are used as simplified representations of vectorized lines; the endpoints of the fitted line segments are the vector points at the start and end positions of the line segments to which the fitted line segments belong. The determination of the line segment point attributes corresponding to each vector point in the vector line point set includes: taking the first vector point in the vector line point set as the starting sequence point, and determining a first distance between the starting sequence point and the first vector point after the starting sequence point, a second distance between the first vector point and the second vector point after the starting sequence point, and a third distance between the starting sequence point and the second vector point; determining the sum of the first distance and the second distance, and determining the difference between the sum of the distances and the third distance; if the difference in distances is less than a first distance threshold, then determining the starting sequence point, the starting sequence... The positional relationship between the first vector point and the second vector point after the starting point satisfies a first preset relationship; if the first preset relationship is not satisfied, it is determined whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points; if they are not both straight line points, it is determined that the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both curve points, and if the difference in distance is greater than a second distance threshold, it is determined that the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies a second preset relationship; wherein, the second distance threshold is greater than the first distance threshold.
2. The method according to claim 1, characterized in that, Determining the line segment point attributes corresponding to each vector point in the vector line point set includes: If the first preset relationship is satisfied, then the line segment point attributes of the starting sequence point, the first vector point after the starting sequence point, and the second vector point are all determined to be straight line points, and the first vector point is taken as the new starting sequence point. Then, the operation of judging whether the positional relationship of the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned. If all points are straight lines, then the second vector point is taken as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
3. The method according to claim 2, characterized in that, The method further includes: If the second preset relationship is satisfied, the second vector point is taken as the new starting sequence point, and the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned. If the second preset relationship is not satisfied, the line segment point attribute of the second vector point is determined to be a curve point, and the first vector point is taken as the new starting sequence point. Then, the operation of judging whether the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies the first preset relationship is returned.
4. The method according to claim 1, characterized in that, The step of fitting each line segment in the line segment set according to the line segment attributes to obtain a fitting model corresponding to each fitted line segment includes: For each line segment in the set of line segments, if the line segment attribute of the line segment is a straight line, then based on the vector points of the starting and ending positions of the line segment, a straight line segment fitting is performed on the line segment to obtain the straight line model parameter values of the fitted line segment. The general model of a straight line is initialized using the parameter values of the straight line model to obtain the straight line fitting model corresponding to the fitted line segment.
5. The method according to claim 4, characterized in that, The step of fitting each line segment in the line segment set according to the line segment attributes to obtain a fitting model corresponding to each fitted line segment further includes: For each line segment in the set of line segments, if the line segment attribute of the line segment is a curve, then the first curve model parameter value of the fitted line segment corresponding to the line segment is determined based on the vector point of the starting position of the line segment. Based on the first curve model parameter values, the reference point of the line segment, and the distance between the reference point and the vector point at the starting position, a residual term function containing the second curve model parameter values is constructed; wherein, the reference point is any vector point in the line segment other than the vector point at the starting position. The parameter values of the second curve model are obtained by iteratively solving the residual term function using the least squares method, which are the values corresponding to the minimum function value. The curve general model is initialized using the first curve model parameter values and the second curve model parameter values to obtain the curve fitting model corresponding to the fitted line segment.
6. The method according to any one of claims 1 to 5, characterized in that, After fitting each line segment in the line segment set according to the line segment attributes to obtain a fitting model corresponding to each fitted line segment, the process includes: For adjacent line segments in the set of line segments, fit a fitting model for the connecting line segments between the adjacent line segments; Accordingly, based on the order of the line segments in the set of line segments, the endpoints corresponding to each fitted line segment and the fitted model are stored, including: Based on the order of the line segments in the line segment set, store the endpoints and fitting model corresponding to each fitted line segment, as well as the fitting model of the connecting line segments between adjacent line segments; wherein, the fitting model of each connecting line segment is stored after the endpoints of the starting connecting line segment of the connecting line segment and the fitting model, and the starting connecting line segment is the line segment that comes first in the order among the adjacent line segments corresponding to the connecting line segment.
7. The method according to claim 6, characterized in that, The fitting model for the connecting line segments between adjacent line segments includes: Based on the connection points of the adjacent line segments, determine the third curve model parameter values of the connecting line segments between the adjacent line segments; the connection points are the two closest vector points among the adjacent line segments, and the two vector points are located on different line segments; Based on the third curve model parameter value, the direction vectors of the two connection points, and the distance between the two connection points, determine the fourth curve model parameter value of the connecting line segment; Based on the parameter values of the third curve model and the fourth curve model, the general curve model is initialized to obtain the fitting model of the connecting line segment between the adjacent line segments.
8. A data storage device for a vector map, characterized in that, The device includes: The attribute determination module is used to obtain the set of vector line points corresponding to vectorized lines in the vector map, and determine the line segment point attributes corresponding to each vector point in the set of vector line points; wherein the vectorized line represents any map element in the vector map; and the line segment point attributes represent the straightness or curvature of the line segment formed by the vector points. The line segment division module is used to divide each vector point in the vector point set into several line segments according to the line segment point attributes corresponding to each vector point. The several line segments sequentially form a line segment set. Each line segment contains at least two consecutive vector points with the same line segment point attributes. The line segment attributes of the line segment are determined by the line segment point attributes of the vector points it contains. The line segment fitting module is used to fit each line segment in the line segment set according to the line segment attributes of the line segment, so as to obtain a fitting model corresponding to each fitted line segment. The fitting storage module is used to store the endpoints and fitting models corresponding to each fitted line segment according to the order of the line segments in the line segment set; the endpoints and fitting models of all fitted line segments are simplified representations of vectorized lines; the endpoints of the fitted line segment are the vector points at the start and end positions of the line segment to which the fitted line segment belongs. The determination of the line segment point attributes corresponding to each vector point in the vector line point set includes: taking the first vector point in the vector line point set as the starting sequence point, and determining a first distance between the starting sequence point and the first vector point after the starting sequence point, a second distance between the first vector point and the second vector point after the starting sequence point, and a third distance between the starting sequence point and the second vector point; determining the sum of the first distance and the second distance, and determining the difference between the sum of the distances and the third distance; if the difference in distances is less than a first distance threshold, then determining the starting sequence point, the starting sequence... The positional relationship between the first vector point and the second vector point after the starting point satisfies a first preset relationship; if the first preset relationship is not satisfied, it is determined whether the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both straight line points; if they are not both straight line points, it is determined that the line segment point attributes of the starting sequence point and the first vector point after the starting sequence point are both curve points, and if the difference in distance is greater than a second distance threshold, it is determined that the positional relationship between the starting sequence point, the first vector point after the starting sequence point, and the second vector point satisfies a second preset relationship; wherein, the second distance threshold is greater than the first distance threshold.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Point cloud data processing method and device
CN114693855A
Linear fitting method and device for point cloud data
CN115222897A