Method for rapidly adjusting contour line direction based on boundary and starting point coordinate sequence

By automatically detecting the contour direction based on the boundary and starting point coordinate sequence, the problem of high complexity of the contour direction adjustment algorithm is solved, and fast and accurate contour direction adjustment is achieved, which is suitable for different types of landforms and Scale data.

CN119228945APending Publication Date: 2024-12-31SUZHOU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411277055.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing contour direction adjustment algorithm is complex and lacks effective verification. The boundary is only used as an auxiliary to construct "pseudo-closed contours" in direction adjustment, and the negative landforms are not effectively considered.

Method used

Using a method based on the coordinate sequence of boundaries and starting points, a new contour layer is formed by breaking discontinuous fracture contours, and according to the ordered contour boundary set and corner point set and the principle of "left high and right low" , automatically detect the contour direction and quickly adjust the wrong contour direction.

Benefits of technology

The algorithm complexity of contour direction adjustment is reduced, efficiency is improved, and through data verification of different landform types and scales, rapid and accurate adjustment of contour direction is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228945A_ABST
    Figure CN119228945A_ABST
Patent Text Reader

Abstract

The invention discloses a contour line direction rapid adjustment method based on a boundary and starting point coordinate sequence, and the method comprises the following steps: S1, breaking a discontinuous fracture contour line, forming a new contour line layer, and setting attributes; s2, orderly constructing a contour boundary set and a corner point set of a new contour layer; and S3, according to the ordered contour line boundary set, the corner point set and the principle of'high left and low right ', automatically detecting the contour line direction and quickly adjusting the wrong contour line direction. According to the method, the efficiency of adjusting the contour line direction is improved, and universality is achieved; compared with a traditional contour line direction adjusting method in which the proximity relation of contour lines and a contour line tree are established firstly and then the contour line direction is processed according to various conditions, the method has the advantage that the overall algorithm complexity is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of map making, and in particular relates to a method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences. Background Art

[0002] Contour lines express landforms in groups and are one of the important forms of landform expression. In cartography, the focus is generally on studying the multi-scale generalization of contour lines, the determination of spatial relationships, and the extraction of terrain features. The important premise for the above research is that the contour lines have the correct digital direction. It can be seen that the direction of contour lines has important research value in cartography.

[0003] There are few studies on the adjustment of contour line direction by scholars at home and abroad, which are mainly divided into two parts: the first part is to determine the neighboring relationship of contour lines according to the characteristics of contour lines, and then establish a contour line tree and adjust its digital direction. For example, Li Chengming proposed a method for judging the neighboring relationship and automatically adjusting the direction of contour lines [application number is CN201710039603.6]. In this method, it is first necessary to judge the various spatial neighboring relationships between closed contour lines and "pseudo-closed contour lines" (composed of broken contour lines and map boundaries, where we refer to "map boundaries" as "boundaries"), and then construct a contour line tree. Finally, by designing an automatic adjustment model for contour line direction, the adjustment of contour line direction is divided into five parts: contour line closed surface (including single broken contour lines and multiple broken contour lines), highest contour line group, adjacent contour lines of the same elevation, adjacent high elevation contour lines and adjacent low elevation contour lines. The adjustment order is carried out in the order of elevation from high to low or from low to high. Since this method is based on the judgment of the neighboring relationship of contour lines, and the judgment of the neighboring relationship of contour lines involves more judgment rules, and the direction of contour lines is grouped more. Therefore, this method increases the algorithm complexity of contour line direction adjustment. The second part is to reasonably close the contour lines first, then determine the spatial relationship of contour lines, and establish a contour tree [Zhang Linlin, Wu Fang, Wang Huilian. Determination and application of spatial relationship of contour lines [J]. Bulletin of Surveying and Mapping, 2005, (08): 19-22+46]. In this method, the reasonable closing of contour lines is based on the topological relationship of contour lines of adjacent elevations. The closing direction of each contour line that intersects with the map outline (map boundary) is determined by the spatial position of its adjacent higher and lower contour lines, thereby determining a unique closing direction of the contour line. Since this method is mainly aimed at positive landforms, and it is necessary to judge and compare three elevation values ​​to determine the closing direction of the contour line, negative landforms are not considered. Therefore, the rationality of the algorithm lacks further verification.

[0004] The above-mentioned algorithm for adjusting the direction of contour lines is relatively complex and lacks more data for effective verification. In addition, the boundary only plays the role of assisting in constructing a "pseudo-closed contour line" in its direction adjustment. Therefore, the present invention proposes a method for quickly adjusting the direction of contour lines based on the coordinate sequence of the boundary and the starting point of the contour line, which is conducive to reducing the algorithm complexity of the direction adjustment of contour lines and improving its efficiency. Summary of the invention

[0005] To solve the above problems, the present invention proposes a method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences, characterized in that it comprises the following steps:

[0008] S1. Interrupt discontinuous and broken contour lines, form a new contour line layer and set its properties;

[0009] S2, orderly constructing the contour boundary set and its corner point set of the new contour layer;

[0010] S3. According to the ordered contour line boundary set and corner point set and the principle of "high on the left and low on the right", the contour line direction is automatically detected and the wrong contour line direction is quickly adjusted.

[0011] As a further improvement of the present invention, the step S1 is to first break the contour line at the discontinuity to divide it into multiple curve segments, then form new contour line data and set attributes.

[0012] Wherein, the step S1 specifically includes:

[0013] S1.1. Traverse the original contour lines and determine the number of geometry segments of each contour line, that is, the number of path segments, where path refers to a connected and continuous segment segment; a contour line is a polyline, and a polyline is composed of one or more paths; if GeometryCount>1, it means that the root contour line is composed of multiple paths and is discontinuous at the breakpoints. Based on the start and end points of each partial path, the root contour line is interrupted; if GeometryCount=1, it means that the root contour line is a continuous contour line;

[0014] S1.2. Determine whether the coordinates of the first and end points of each contour line, including the interrupted contour line, are approximately equal, that is, |(firstPoint.X-endPoint.X)<0.001&&|(firstPoint.Y-endPoint.Y)|<0.001. If so, it means that the contour line is a closed contour line; otherwise, it means that it is a broken contour line. At the same time, set the three attributes {elev, mark, adjustedMark} for the newly generated contour line data, where elev represents the elevation value of the contour line, mark marks whether the contour line is closed or broken, if closed, it is assigned a value of 0, otherwise it is assigned a value of 1, and adjustedMark indicates whether the contour line has been adjusted, adjustedMark=0 indicates unadjusted, and adjustedMark=1 indicates adjusted.

[0015] As a further improvement of the present invention, the step S2 is to regenerate the ordered boundary and its inflection point according to the contour lines of the new contour layer newContourd, or to reconstruct a new boundary according to the existing boundary data.

[0016] Wherein, the step S2 specifically includes:

[0017] S2.1. Generate a new boundary based on the newContour contour line, which is to traverse the contour line set, calculate the minimum envelope line (xMin, yMin, xMax, yMax) of each contour line, and obtain the minimum envelope line (xMin, yMin, xMax, yMax) of the contour line of the entire study area through circular comparison, that is, construct the boundary set Boundaries and its inflection point set Points in an orderly manner in a counterclockwise or clockwise direction;

[0018] S2.2. If the original contour line has ready-made boundary data, the boundary data needs to be reconstructed, that is, first convert the boundary data into point set data, and delete the duplicate points in the point set data, that is, obtain the new point set data ptsCollection; then compare the x, y coordinates of each point in the ptsCollection point set to obtain xMin, yMin, xMax, yMax, and then obtain the four corner points; finally, use the method of step S2.1 to obtain a new boundary set.

[0019] As a further improvement of the present invention, in step S3, the "high on the left and low on the right" principle means that along the contour line direction, the elevation value of any point close to the left side of the contour line is higher than the elevation value of the contour line itself, and the elevation value of any point close to the right side of the contour line is lower than the elevation value of the contour line itself.

[0020] Wherein, the step S3 specifically includes:

[0021] S3.1: Traverse the new contour layer newContour, and according to the elev and mark attributes, where elev represents the elevation value of the contour line and mark marks whether the contour line is closed or broken, obtain the closed contour line with the largest elevation value through elevation comparison; if the contour line with the largest elevation value is a broken contour line, it is combined with the boundary set Boundaries to form a counterclockwise "pseudo-closed contour line";

[0022] S3.2: Starting from any point P on the contour line C, draw a radial line m in the horizontal direction. When drawing the radial line to the right, obtain the first broken contour line C that intersects with the radial line m and is closest to it. i , and determine the contour line C i The intersection with the boundary set Boundaries; since the contour line has been segmented in step S2, the broken contour line can only intersect with one boundary or two different boundaries; regardless of the contour line C i When intersecting with several boundaries, it is necessary to construct a "pseudo-closed contour line" with the intersection points of the intersecting boundaries. The principle in the construction process is that the "pseudo-closed contour line" must include the point P on the contour line C with the maximum elevation value; if it does not include it, the "pseudo-closed contour line" needs to be constructed in the opposite direction;

[0023] S3.3, if the broken contour line C i It intersects with the first boundary B1 at points M1 and M2. According to the principle in step S3.2, C i Together with the boundary B1, it forms a "pseudo-closed contour line" including point P, and adjusts it to the counterclockwise direction. If the direction is correct, no adjustment is made, and adjustedMark = 1; the adjusted contour line C i The end point is M2. At this time, the X coordinate range of the end point M2 and the second inflection point P2 is constructed, that is, [M2.X, P2.X];

[0024] S3.4. Establish a data storage structure table S = {contour, firstPtOrEndPt.X, firstPtOrEndPt.Y, firstOrEndPtMark, Z}, where contour represents the current contour data, firstPtOrEndPt.X represents the X coordinate of the starting point or end point of the contour, firstPtOrEndPt.X represents the Y coordinate of the starting point or end point of the contour, firstOrEndPtMark is the mark of the starting point or end point of the contour, if it is the starting point, it is marked as 0, otherwise it is marked as 1, and Z represents the elevation value;

[0025] S3.5. Calculate the contour set contoursCollection from the remaining unadjusted fracture contours that intersect the first boundary B1 and whose starting or ending point X coordinates are within the range of [M2.X, P2.X], and store the X coordinates of the starting or ending points of the contours in contoursCollection, and sort them from small to large. On this basis, adjust the directions of the contours in S.

[0026] S3.6, construct the remaining ordered boundaries and inflection point sets except for the contour line direction adjustment based on the first boundary B1; at the same time, according to the above steps, obtain the node structure information of the last adjusted contour line;

[0027] S3.7. Based on the ordered boundary and inflection point information, the same method as step S3.6 is used to calculate the contour lines that intersect with boundary B2 and whose Y coordinates are within the coordinate range of [P2.Y, P3.Y]. The Y coordinates of the starting or ending points of the contour lines are stored and sorted from high to low. The directions of the contour lines are then adjusted based on the principle of "high on the left and low on the right". The directions of the contour lines that have already been adjusted are not adjusted. This is done by analogy, completing the adjustment of the directions of all contour lines based on the ordered boundaries and inflection points in step S3.6.

[0028] S3.8. After the direction of all fracture contour lines is adjusted, adjust the direction of the remaining closed contour lines, including the adjustment of the hill line and the bottom line of the depression. That is, starting from any point on the closed curve, draw a horizontal radial line to obtain its nearest contour line, and then adjust its direction according to the principle of "high on the left and low on the right". At this point, the adjustment of all contour lines including the positive and negative landform directions is completed.

[0029] As a further improvement of the present invention, in step S3.1, if there are several maximum closed contour lines with the same elevation value, one of the contour lines C is selected and adjusted to a counterclockwise direction.

[0030] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0031] The present invention not only improves the efficiency of contour line direction adjustment, but also has universal applicability, and has been verified by contour line data of different landform types and scales; compared with the traditional contour line direction adjustment method of first establishing the neighboring relationship of contour lines and contour line trees, and then processing the contour line directions in various situations, this method effectively reduces the overall algorithm complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 The overall flow chart of the present invention.

[0033] Figure 2Schematic diagram of the process of contour line interruption, where (a) is the composition diagram of polyline, and (b) is an example diagram of the path formed after the contour line is segmented.

[0034] Figure 3 Schematic diagram of contour line boundaries and their inflection points.

[0035] Figure 4 Comparison diagram before and after the contour line direction adjustment, where (a) is the schematic diagram before the contour line direction adjustment, and (b) is the result diagram after the contour line direction adjustment.

[0036] Figure 5 These are topographic maps of different scales and landform types, where (a) is the 1:10,000 Loess Plateau landform and (b) is the 1:50,000 hilly landform.

[0037] Figure 6 These are the contour line direction adjustment results for two different landforms, where (a) is the contour line direction adjustment result for the Loess Plateau, and (b) is the contour line direction adjustment result for the hilly landform. DETAILED DESCRIPTION

[0038] The present invention is further described in detail below in conjunction with the accompanying drawings and implementation examples. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0039] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0040] The purpose of the present invention is to reduce the algorithm complexity of contour line direction adjustment and propose a method for quickly adjusting the contour line direction based on the boundary and starting point coordinate sequence, which includes the following contents:

[0041] S1. Interrupt discontinuous fracture contour lines, form a new contour layer newContour and set properties;

[0042] S2. Orderly construct the newContour contour boundary set Boundaries = {B1, B2, B3, B4} and its corner point set Points = {P1, P2, P3, P4};

[0043] S3. According to the ordered boundary set and corner point set and the principle of "high on the left and low on the right", the contour line direction is automatically detected and the wrong contour line direction is quickly adjusted.

[0044] To facilitate those skilled in the art to understand and implement the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and implementation examples. The implementation examples described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.

[0045] like Figure 1 As shown, the present invention provides a method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences, comprising the following specific implementation steps:

[0046] S1. Theoretically, on a contour map, the contour data is closed, but due to the limitation of regional data production, the contour data needs to be clipped, thus forming broken and discontinuous contour lines. To this end, the present invention first needs to interrupt the contour lines at the discontinuity, thereby dividing them into multiple curve segments, forming new contour data, and setting attributes. The specific implementation includes the following steps:

[0047] Step 1.1: Traverse the original contour lines and determine the number of geometry segments (GeometryCount) of each contour line, that is, the number of paths. A path refers to a connected and continuous segment. Generally, a contour line is a polyline, and a polyline consists of one or more paths, such as Figure 2 (a). If GeometryCount>1, it means that the root contour line is composed of multiple paths and is discontinuous at the breakpoints. The root contour line is broken based on the start and end points of each partial path; if GeometryCount=1, it means that the root contour line is a continuous contour line. Figure 2 As shown in (b), the original contour lines are clipped, forming three discontinuous paths, and the contour lines are segmented to generate three independent paths.

[0048] Step 1.2: Determine whether the coordinates of the first and end points of each contour line (including the broken contour line) are approximately equal, that is, |(firstPoint.X-endPoint.X)<0.001&&|(firstPoint.Y-endPoint.Y)|<0.001. If so, it means that the contour line is a closed contour line; otherwise, it means that it is a broken contour line. At the same time, set the three attributes {elev, mark, adjustedMark} for the newly generated contour line data, where elev represents the elevation value of the contour line, mark marks whether the contour line is closed or broken, if closed, it is assigned a value of 0, otherwise it is assigned a value of 1, and adjustedMark indicates whether the contour line has been adjusted, adjustedMark = 0 means not adjusted, and adjustedMark = 1 means adjusted.

[0049] S2, constructing the ordered boundary of the contour line and its inflection point set, including regenerating the ordered boundary and its inflection point according to the newContour contour line, or reconstructing a new boundary according to the existing boundary data. The specific implementation includes the following steps:

[0050] Step 2.1: Generate a new boundary based on the newContour contour line. This is to traverse the contour line set, calculate the minimum envelope line (xMin, yMin, xMax, yMax) of each contour line, and obtain the minimum envelope line (xMin, yMin, xMax, yMax) of the contour line of the entire study area through cyclic comparison. That is, construct the boundary set Boundaries and its inflection point set Points in an orderly manner in a counterclockwise or clockwise direction. Taking clockwise as an example, Figure 3 As shown, the inflection points are P1(xMin,yMax), P2(xMax,yMax), P3(xMax,yMin), P4(xMin,yMin), and the boundaries B1=|P1P2|, B2=|P2P3|, B3=|P3P4|, B1=|P4P1|.

[0051] Step 2.2: If the original contour line has ready-made boundary data, it is necessary to reconstruct the boundary data, that is, first convert the boundary data into point set data, and delete the duplicate points in the point set data to obtain the new point set data ptsCollection; then compare the x, y coordinates of each point in the ptsCollection point set to obtain xMin, yMin, xMax, yMax, and then obtain the four corner points; finally, use a method similar to step 2.1 to obtain a new boundary set.

[0052] S3. Automatically detect the direction of contour lines and quickly adjust the wrong direction of contour lines based on the ordered boundary set and corner point set and the principle of "high on the left and low on the right". The principle of "high on the left and low on the right" means that along the direction of contour lines, the elevation value of any point close to the left side of the contour line is higher than the elevation value of the contour line itself, and the elevation value of any point close to the right side of the contour line is lower than the elevation value of the contour line itself. Figure 4 , the specific implementation includes the following steps:

[0053] Step 3.1: Traverse the newContour contour layer, and obtain the closed contour with the maximum elevation value by comparing the elevation according to the elev and mark attributes. There may be several closed contours with the same maximum elevation value. We can select any one of the contours C and adjust it to the counterclockwise direction (closed contours have positive and negative landforms, where the closed contours of positive landforms are counterclockwise, and the closed contours of negative landforms are clockwise. There are similar situations for broken contours, but they need to be processed by boundaries [application number CN201710039603.6]). If the contour with the maximum elevation value is a broken contour, it will be combined with the boundary set Boundaries to form a counterclockwise "pseudo-closed contour".

[0054] Step 3.2: Starting from any point P on the contour line C, draw a radial line m in the horizontal direction. We take the radial line to the right as an example to obtain the first broken contour line C that intersects with the radial line m and is closest to it. i , and determine the contour line C i Intersection with the boundary set Boundaries. Since the contour line has been segmented in S1, the broken contour line can only intersect with one boundary or two different boundaries. i When intersecting with several boundaries, it is necessary to construct a "pseudo-closed contour line" with the intersection points of the intersecting boundaries. An important principle in the construction process is that the "pseudo-closed contour line" must include point P on the contour line C with the maximum elevation value; if it does not include it, the "pseudo-closed contour line" needs to be constructed in the opposite direction.

[0055] Step 3.3: If Figure 4 As shown in (a), the fracture contour line C i It intersects with the boundary B1 at points M1 and M2. According to the principle in step 3.2, C i Together with the boundary B1, it forms a "pseudo-closed contour line" that includes point P, and adjusts it to the counterclockwise direction. If the direction is correct, no adjustment is made, and adjustedMark = 1. The adjusted contour line C i The end point is M2. At this time, we construct the X coordinate range of the end point M2 and the second inflection point P2, that is, [M2.X, P2.X].

[0056] Step 3.4: Establish a data storage structure table S = {contour, firstPtOrEndPt.X, firstPtOrEndPt.Y, firstOrEndPtMark, Z}, where contour represents the current contour data, firstPtOrEndPt.X represents the X coordinate of the starting point or end point of the contour line, firstPtOrEndPt.X represents the Y coordinate of the starting point or end point of the contour line, firstOrEndPtMark is the mark of the starting point or end point of the contour line, if it is the starting point, it is marked as 0, otherwise it is marked as 1, and Z represents the elevation value.

[0057] Step 3.5: Calculate the contour collection contoursCollection from the remaining unadjusted broken contours that intersect with the boundary B1 and whose starting or ending point X coordinates are in the range [M2.X, P2.X] (because the boundary B1 is horizontal), and store the X coordinates of the starting or ending points of the contours in contoursCollection, and sort them from small to large. Figure 4 (a) Take the contour lines L1 and L2 as an example, that is, S = {{L1, endtPt.X, endtPt.Y, 1, 80}, {L2, endtPt.X, endtPt.Y, 1, 90}. On this basis, adjust the direction of the contour lines in S. The specific steps are as follows: 1) Start from {L1, endtPt.X, endtPt.Y, 1, 80} in the sorted S. Since the endPt in the contour line L1 is the same as the contour line C i The end point M2 is closest to the contour line, and the elevation values ​​of the two points are the same, which shows that the contour line L1 is close to the contour line C. i should be the same contour line, then their directions should be the same, but contour line C i Point M2 on the contour line is the end point, and endPt in the contour line L1 is also the end point, which means that they are in opposite directions. Therefore, it is necessary to adjust the direction of the contour line L1, that is, firstly build a "pseudo-closed contour line" containing point P in combination with the boundary, such as Figure 4 The polygon A0A1P1P4P3A0 in (a) shows that the polygon is counterclockwise, so it should be adjusted to a clockwise direction. At this time, the direction of the contour line L1 is adjusted and marked adjustedMark = 1, such as Figure 4 (b) 2) Detection data {L2, endtPt.X, endtPt.Y, 1, 90}, since the contour line L2 and the contour line L1 differ by one contour distance, and according to the coordinate sequence, the two are closest, the directions of the contour lines L2 and L1 should be consistent. Similar to step 1), first construct a "pseudo-closed contour line" containing point P, such as Figure 4 In the polygon A2A3P1P4P3A2, the direction of the contour line L2 is adjusted according to the principle of "high on the left and low on the right". Since the directions of the contour lines L1 and L2 have been adjusted, {L1,endtPt.X,endtPt.Y,1,80} in S is replaced by {L1,firstPt.X,firstPt.Y,0,80}, and {L2,endtPt.X,endtPt.Y,1,90} is replaced by {L2,firstPt.X,firstPt.Y,0,90}. So far, we have completed the adjustment of the directions of all the broken contour lines that intersect with the boundary B1 and are within the coordinate range of [M2.X,P2.X].

[0058] Step 3.6: Based on content (2) and the above steps, we construct the remaining ordered boundaries and inflection point sets, except for the contour line direction adjustment based on the first boundary B1, as {B2, B3, B4, B1} and {P2, P3, P4, P1, M2}. At the same time, according to the above steps, we obtain the node structure information of the last adjusted contour line L2.

[0059] Step 3.7: Based on the ordered boundary and inflection point information, use a method similar to step 3.6 to calculate the contour lines that intersect with boundary B2 and whose Y coordinates are within the coordinate range of [P2.Y, P3.Y], store the Y coordinates of the starting or ending points of the contour lines and sort them from high to low, and then adjust the direction of the contour lines according to the principle of "high on the left and low on the right", and do not adjust the direction of the contour lines that have been adjusted. By analogy, we have completed the adjustment of the directions of all contour lines based on the ordered boundaries and inflection points in step 3.6.

[0060] Step 3.8: After all the fracture contour lines are adjusted, we adjust the directions of the remaining closed contour lines, including the adjustment of the hill line and the bottom line of the depression. That is, starting from any point on the closed curve, we draw a horizontal radial line to obtain its nearest contour line, and then adjust its direction according to the principle of "high on the left and low on the right". So far, we have completed the adjustment of the directions of all contour lines (including positive and negative landforms), such as Figure 4 (b) as shown.

[0061] Example: To verify the effectiveness and feasibility of the method of the present invention, the present invention takes contour data of two different landform types and scales as examples, such as Figure 5 As shown in the figure, the area of ​​each landform type is different in size. At the same time, these data are a mixture of closed contours, broken contours, positive and negative landforms. The data processing status and consumption time are shown in Table 1. It can be seen from the table that even if the area size and number of contour lines in the study area are different, the digitized direction of the contour line can be effectively adjusted in a relatively short time, and the accuracy rate is 100%. Figure 6The black arrows on the contour lines indicate the direction of the contour lines after adjustment. In addition, the correctness of the contour line direction can be determined from the extracted terrain feature lines. Figure 6 The red and blue lines in the figure are the topographic feature lines of two different landform types, where the red line represents the ridge line and the blue line represents the valley line. Figure 6 It can be seen that all terrain feature line types correspond to the positive and negative landforms where they are located, which illustrates the effectiveness and feasibility of the method of the present invention.

[0062] Table 1 Experimental data statistics

[0063]

[0064] The exemplary embodiments described above only express several embodiments of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences, characterized in that: The following steps are involved: S1. Interrupt discontinuous and broken contour lines, form a new contour line layer and set its properties; S2, orderly constructing the contour boundary set and its corner point set of the new contour layer; S3. According to the ordered contour line boundary set and corner point set and the "high on the left and low on the right" principle, the contour line direction is automatically detected and the wrong contour line direction is quickly adjusted.

2. A method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences according to claim 1, characterized in that: The step S1 is to first break the contour line at the discontinuity to divide it into multiple curve segments, then form new contour line data and set attributes.

3. The method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences according to claim 1, characterized in that: The step S1 specifically includes: S1.

1. Traverse the original contour lines and determine the number of geometry segments of each contour line, that is, the number of path segments, where path refers to a connected and continuous segment segment; a contour line is a polyline, and a polyline is composed of one or more paths; if GeometryCount>1, it means that the root contour line is composed of multiple paths and is discontinuous at the breakpoints. Based on the start and end points of each partial path, the root contour line is interrupted; if GeometryCount=1, it means that the root contour line is a continuous contour line; S1.

2. Determine whether the coordinates of the first and end points of each contour line, including the interrupted contour line, are approximately equal, that is, |(firstPoint.X-endPoint.X)<0.001&&|(firstPoint.Y-endPoint.Y)|<0.

001. If so, it means that the contour line is a closed contour line; otherwise, it means that it is a broken contour line. At the same time, set the three attributes {elev, mark, adjustedMark} for the newly generated contour line data, where elev represents the elevation value of the contour line, and mark marks whether the contour line is closed or broken. If it is closed, it is assigned a value of 0, otherwise it is assigned a value of 1. adjustedMark indicates whether the contour line has been adjusted. adjustedMark=0 indicates no adjustment, and adjustedMark=1 indicates adjustment.

4. The method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences according to claim 1, characterized in that: The step S2 is to regenerate the ordered boundary and its inflection point according to the contour lines of the new contour layer newContourd, or to reconstruct a new boundary according to the existing boundary data.

5. The method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences according to claim 1, characterized in that: The step S2 specifically includes: S2.

1. Generate a new boundary based on the newContour contour line, which is to traverse the contour line set, calculate the minimum envelope line (xMin, yMin, xMax, yMax) of each contour line, and obtain the minimum envelope line (xMin, yMin, xMax, yMax) of the contour line of the entire study area through circular comparison, that is, construct the boundary set Boundaries and its inflection point set Points in an orderly manner in a counterclockwise or clockwise direction; S2.

2. If the original contour line has ready-made boundary data, the boundary data needs to be reconstructed, that is, first convert the boundary data into point set data, and delete the duplicate points in the point set data, that is, obtain the new point set data ptsCollection; then compare the x, y coordinates of each point in the ptsCollection point set to obtain xMin, yMin, xMax, yMax, and then obtain the four corner points; finally, use the method of step S2.1 to obtain a new boundary set.

6. The method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences according to claim 1, characterized in that: In step S3, the "high on the left and low on the right" principle means that along the contour line, the elevation value of any point close to the left side of the contour line is higher than the elevation value of the contour line itself, and the elevation value of any point close to the right side of the contour line is lower than the elevation value of the contour line itself.

7. The method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences according to claim 1, characterized in that: The step S3 specifically includes: S3.1: Traverse the new contour layer newContour, and according to the elev and mark attributes, where elev represents the elevation value of the contour line and mark marks whether the contour line is closed or broken, obtain the closed contour line with the largest elevation value through elevation comparison; if the contour line with the largest elevation value is a broken contour line, it will be combined with the boundary set Boundaries to form a counterclockwise "pseudo-closed contour line"; S3.2: Starting from any point P on the contour line C, draw a radial line m in the horizontal direction. When drawing the radial line to the right, obtain the first broken contour line C that intersects with the radial line m and is closest to it. i , and determine the contour line C i The intersection with the boundary set Boundaries; since the contour line has been segmented in step S1, the broken contour line can only intersect with one boundary or two different boundaries; regardless of the contour line C i When intersecting with several boundaries, it is necessary to construct a "pseudo-closed contour line" with the intersection points of the intersecting boundaries. The principle in the construction process is that the "pseudo-closed contour line" must include the point P on the contour line C with the maximum elevation value; if it does not include it, it is necessary to construct a "pseudo-closed contour line" in the opposite direction; S3.3, if the broken contour line C i It intersects with the first boundary B1 at points M1 and M2. According to the principle in step S3.2, C i Together with the boundary B1, it forms a "pseudo-closed contour line" including point P, and adjusts it to the counterclockwise direction. If the direction is correct, no adjustment is made, and adjustedMark = 1; the adjusted contour line C i The end point is M2. At this time, the X coordinate range of the end point M2 and the second inflection point P2 is constructed, that is, [M2.X, P2.X]; S3.

4. Establish a data storage structure table S = {contour, firstPtOrEndPt.X, firstPtOrEndPt.Y, firstOrEndPtMark, Z}, where contour represents the current contour data, firstPtOrEndPt.X represents the X coordinate of the starting point or end point of the contour, firstPtOrEndPt.X represents the Y coordinate of the starting point or end point of the contour, firstOrEndPtMark is the mark of the starting point or end point of the contour, if it is the starting point, it is marked as 0, otherwise it is marked as 1, and Z represents the elevation value; S3.

5. Calculate the contour set contoursCollection from the remaining unadjusted fracture contours that intersect the first boundary B1 and whose starting or ending point X coordinates are within the range of [M2.X, P2.X], and store the X coordinates of the starting or ending points of the contours in contoursCollection, and sort them from small to large. On this basis, adjust the directions of the contours in S. S3.6, construct the remaining ordered boundaries and inflection point sets except for the contour line direction adjustment based on the first boundary B1, and obtain the node structure information of the last adjusted contour line according to the above steps; S3.

7. According to the ordered boundary and inflection point information, the same method as step S3.6 is used to calculate the contour lines that intersect with boundary B2 and whose Y coordinates are within the coordinate range of [P2.Y, P3.Y]. The Y coordinates of the starting or ending points of the contour lines are stored and sorted from high to low. Then, the directions of the contour lines are adjusted according to the principle of "high on the left and low on the right". The directions of the contour lines that have been adjusted are not adjusted. By analogy, the adjustment of the directions of all contour lines based on the ordered boundaries and inflection points in step S3.6 is completed. S3.

8. After the direction of all fracture contour lines is adjusted, adjust the direction of the remaining closed contour lines, including the adjustment of the hill line and the bottom line of the depression. That is, starting from any point on the closed curve, make a horizontal radial line to obtain its nearest contour line, and then adjust its direction according to the principle of "high on the left and low on the right". At this point, the adjustment of all contour lines including the positive and negative landform directions is completed.

8. The method for quickly adjusting the direction of contour lines based on boundary and starting point coordinate sequences according to claim 1, characterized in that: In step S3.1, if there are several maximum closed contour lines with the same elevation value, one of the contour lines C is selected and adjusted to a counterclockwise direction.