A method and device for drawing a water system section

By fitting the cross-sectional lines of the water system using the least squares method and random sampling consensus algorithm, and combining linear interpolation and the design centerline, the cross-sectional and longitudinal cross-sectional diagrams of the water system are automatically drawn. This solves the problems of cumbersome operation and low efficiency in the existing technology and realizes efficient cross-sectional diagram production.

CN115170751BActive Publication Date: 2025-12-30URBAN RURAL INST (GUANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210739576.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2025-12-30
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

Existing methods for drawing cross-sections of water systems are cumbersome and have low output efficiency.

Method used

The least squares method and random sampling consensus algorithm are used to fit straight lines to the marked elevation points to generate water system cross-section lines. The elevation is calculated by linear interpolation. Combined with the positional relationship between the design centerline and the intersection point, the cross-sectional and longitudinal sections are automatically drawn.

Benefits of technology

It enables automated batch drawing of water system cross-section diagrams, greatly improving production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115170751B_ABST
    Figure CN115170751B_ABST
Patent Text Reader

Abstract

The application discloses a water system section drawing method and device, comprising: obtaining a plurality of to-be-marked elevation points of a to-be-drawn water system topographic map; performing straight line fitting on the plurality of to-be-marked elevation points based on a least square method and a random sample consensus algorithm to obtain a plurality of section lines and marked elevation points; determining each intersection point of a line connecting each adjacent two vertices of a design centerline and each section line, and calculating each mileage of each intersection point; projecting each first elevation point onto a corresponding section line, and calculating each distance between each first elevation point after projection and each intersection point based on the positional relationship between each first elevation point and the design centerline; calculating each elevation of each intersection point by linear interpolation; and drawing a section map of the section line according to each mileage, each distance and each elevation. The embodiment of the application can realize automatic batch drawing of the water system section map, is simple to operate, and improves drawing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water conservancy engineering technology, and in particular to a method and apparatus for drawing cross-sections of water systems. Background Technology

[0002] Water systems are vital channels for urban runoff and stormwater discharge, serving as receiving and regulating spaces that play a crucial role in flood control, drainage, and maintaining regional ecological stability. Cross-sectional mapping of water systems not only provides a data foundation for establishing hydrodynamic mathematical models but also offers precise data support for specialized planning and construction projects such as water supply and drainage planning, sponge city planning, soil and water conservation planning, and flood control and drainage. Therefore, it is essential to research a method for drawing water system cross-sections to provide strong data support for urban planning and construction. However, existing methods for drawing water system cross-sections are cumbersome and have low mapping efficiency. Summary of the Invention

[0003] This invention provides a method and apparatus for drawing cross-sections of water systems, which solves the problems of cumbersome operation and low drawing efficiency of existing methods for drawing cross-sections of water systems. This invention automatically generates cross-section diagrams of water systems by using elevation points, realizing the automated batch drawing of cross-sectional and longitudinal cross-section diagrams of water systems. The operation is simple and greatly improves the efficiency of producing cross-section diagrams of water systems.

[0004] To achieve the above objectives, embodiments of the present invention provide a method for drawing cross-sections of water systems, comprising:

[0005] Obtain several elevation points to be marked on the topographic map of the river system to be drawn;

[0006] Based on the least squares method and random sampling consensus algorithm, straight line fitting is performed on several elevation points to be marked to obtain several cross-sectional lines and marked elevation points.

[0007] Determine each intersection point where the line connecting each pair of adjacent vertices of the design centerline intersects each of the said cross-section lines, and calculate each mileage of each said intersection point;

[0008] Each first elevation point is projected onto the corresponding cross-section line, and based on the positional relationship between each first elevation point and the design centerline, each distance between each first elevation point and each intersection point after projection is calculated; wherein, the first elevation point is an elevation point within a third preset buffer distance from the cross-section line;

[0009] Calculate each elevation at each of the aforementioned intersection points using linear interpolation;

[0010] A cross-sectional view of the cross-section line is drawn based on each of the stated mileages, each of the stated distances, and each of the stated elevations.

[0011] As an improvement to the above scheme, the method based on least squares and random sampling consensus algorithm performs straight line fitting on several of the elevation points to be marked, resulting in several cross-sectional lines and marked elevation points, including:

[0012] Randomly select one elevation point from all the elevation points to be marked as the second elevation point;

[0013] The least squares method is used to fit all the elevation points to be marked in the initial point set to obtain a first fitted line; wherein, the initial point set includes all the elevation points to be marked that are within a first preset distance from the second elevation point;

[0014] The random sampling consensus algorithm is used to fit all the elevation points to be marked in the first point set, and the second fitted line is obtained by iterative calculation; wherein, the first point set includes all the elevation points to be marked that are within a first preset buffer distance from the first fitted line;

[0015] All elevation points to be marked within the second point set are sorted according to the slope of the second fitted line; wherein, the second point set includes all elevation points to be marked that are within a second preset buffer distance from the second fitted line;

[0016] Based on the first preset distance threshold between two adjacent elevation points to be marked, the sorted second set of points is divided to obtain several subsets of points;

[0017] The number of unmarked elevation points in each of the aforementioned subsets is counted to obtain the subset with the largest number of elevation points. The random sampling consensus algorithm is used to fit all unmarked elevation points in the subset to obtain the third fitted line, and all unmarked elevation points in the subset are then marked.

[0018] Determine whether any of the aforementioned elevation points to be marked still exist. If so, return to the step of randomly selecting an elevation point from all the aforementioned elevation points to be marked as the second elevation point.

[0019] As an improvement to the above scheme, the step of sorting all the elevation points to be marked in the second point set according to the slope of the second fitted line includes:

[0020] Determine whether the absolute value of the slope of the second fitted line is greater than a preset value. If so, sort all the elevation points to be marked in the second point set according to the size of their y-values. Otherwise, sort all the elevation points to be marked in the second point set according to the size of their x-values.

[0021] As an improvement to the above scheme, the sorted second set of points is divided according to a first preset distance threshold between two adjacent elevation points to be marked, resulting in several subsets of points, including:

[0022] Calculate the adjacent distance between the current elevation point to be marked and the previous elevation point to be marked within the sorted second set of points;

[0023] Determine whether the adjacent distance is less than a first preset distance threshold. If so, store the current elevation point to be marked into the current subset; otherwise, store it into the next subset.

[0024] As an improvement to the above scheme, after performing straight-line fitting on several elevation points to be marked based on the least squares method and random sampling consensus algorithm to obtain several cross-sectional lines and marked elevation points, the method for drawing river system cross-sections further includes:

[0025] When it is determined that the distance between any two adjacent elevation points on any cross-section line exceeds the second preset distance threshold, the elevation points of the cross-section line are remeasured, and a new cross-section line is generated by fitting the remeasured elevation points with a straight line based on the least squares method and the random sampling consensus algorithm.

[0026] As an improvement to the above scheme, determining each intersection point where the line connecting each pair of adjacent vertices of the design line intersects with each of the cross-sectional lines, and calculating each mileage of each intersection point, includes:

[0027] Obtain each vertex of the design centerline from downstream to upstream;

[0028] Determine the intersection point of the line connecting each pair of adjacent vertices with each section line;

[0029] For each intersection point, calculate the distance between the intersection point and the first vertex, the total distance of the broken line between all vertices downstream of the first vertex, and add the initial mileage of the starting point of the design line, the distance between the intersection point and the first vertex, and the total distance of the broken line to obtain the mileage of the intersection point; wherein, the first vertex is the vertex adjacent to the intersection point and located downstream of the intersection point.

[0030] As an improvement to the above scheme, the positional relationship between each first elevation point and the design centerline is determined through the following steps:

[0031] Along the direction of the design centerline, extract all elevation points within a third preset buffer distance from all marked elevation points, and use them as the first elevation points;

[0032] For each section line, determine the two second vertices of the line segment of the design centerline that intersects with that section line;

[0033] Calculate the first vector between the two second vertices and each second vector between any second vertex and each first elevation point of the cross section line. Perform a vector cross product operation between the first vector and each second vector to obtain the result of each vector cross product operation.

[0034] Based on the result of the cross product of each vector, the positional relationship of each first elevation point of the cross section line relative to the corresponding design centerline is obtained.

[0035] As an improvement to the above scheme, the step of calculating each elevation of each intersection point using linear interpolation includes:

[0036] Extract the nearest elevation points to each intersection point from both the left and right sides of that intersection point;

[0037] Calculate each elevation of each of the aforementioned intersection points using the following formula:

[0038]

[0039] In the formula, H LeftNearest H is the elevation of the leftmost elevation point closest to the intersection point. RightNearest D is the elevation of the rightmost elevation point closest to the intersection point. LeftNearest D is the distance between the projection of the nearest left elevation point to the intersection point and the intersection point. RightNearest This is the distance between the projection of the nearest right elevation point to the intersection and the intersection point.

[0040] As an improvement to the above scheme, the step of drawing a cross-sectional view of the cross-section line based on each mileage, each distance, and each elevation includes:

[0041] A cross-sectional diagram is drawn with each distance as the x-axis and its corresponding elevation as the y-axis.

[0042] Using each mileage as the horizontal axis and its corresponding elevation as the vertical axis, a longitudinal profile is drawn.

[0043] To achieve the above objectives, embodiments of the present invention also provide a water system cross-section drawing device, comprising:

[0044] The module for acquiring elevation points to be marked is used to acquire several elevation points to be marked on the topographic map of the water system to be drawn;

[0045] The cross-section line generation module is used to perform straight line fitting on several elevation points to be marked based on the least squares method and random sampling consensus algorithm to obtain several cross-section lines and marked elevation points.

[0046] The mileage calculation module is used to determine each intersection point where the line connecting each pair of adjacent vertices of the design centerline intersects with each of the said cross-section lines, and to calculate each mileage of each said intersection point;

[0047] The distance calculation module is used to project each first elevation point onto the corresponding cross-section line, and calculate each distance between each first elevation point and each intersection point after projection based on the positional relationship between each first elevation point and the design centerline; wherein, the first elevation point is an elevation point within a third preset buffer distance from the cross-section line;

[0048] The elevation calculation module is used to calculate the elevation of each of the aforementioned intersection points using linear interpolation.

[0049] The cross-section drawing module is used to draw cross-section diagrams of the cross-section lines based on each mileage, each distance, and each elevation.

[0050] Compared with the prior art, the method and apparatus for drawing river system cross sections provided by the present invention automatically generate river system cross section diagrams from elevation points by combining the least squares method and the random sampling consensus algorithm. Based on the design centerline of the river and its flow direction, the mileage of the intersection point, the distance between the intersection point and the first elevation point, and the elevation of the intersection point are automatically calculated. Finally, the automated batch drawing of river system cross section diagrams is realized. The operation is simple and greatly improves the efficiency of producing river system cross section diagrams. Attached Figure Description

[0051] Figure 1 This is a flowchart of a method for drawing a cross-section of a water system provided in an embodiment of the present invention;

[0052] Figure 2 This is a schematic diagram of reading the elevation point to be marked according to an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of the cross-sectional line provided in an embodiment of the present invention;

[0054] Figure 4 This is a flowchart of a method for linear fitting of elevation points to be marked, provided in an embodiment of the present invention;

[0055] Figure 5 This is a schematic diagram of the second point set segmentation provided in an embodiment of the present invention;

[0056] Figure 6 This is a schematic diagram of an abnormal cross-section line provided in an embodiment of the present invention;

[0057] Figure 7 This is a schematic diagram of intersection point mileage calculation provided by an embodiment of the present invention;

[0058] Figure 8This is a schematic diagram showing the positional relationship between the design centerline and the first elevation point provided in an embodiment of the present invention;

[0059] Figure 9 This is a cross-sectional view provided in an embodiment of the present invention;

[0060] Figure 10 This is a longitudinal section view provided in an embodiment of the present invention;

[0061] Figure 11 This is a structural block diagram of a water system cross-section drawing device provided in an embodiment of the present invention. Detailed Implementation

[0062] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0063] See Figure 1 , Figure 1 This is a flowchart of a method for drawing a cross-section of a water system according to an embodiment of the present invention. The method for drawing a cross-section of a water system includes:

[0064] S1. Obtain several elevation points to be marked on the topographic map of the water system to be drawn;

[0065] S2. Based on the least squares method and random sampling consensus algorithm, straight line fitting is performed on several elevation points to be marked to obtain several cross-sectional lines and marked elevation points;

[0066] S3. Determine each intersection point where the line connecting each pair of adjacent vertices of the design centerline intersects with each of the said cross-section lines, and calculate each mileage of each of the said intersection points;

[0067] S4. Project each first elevation point onto the corresponding cross-section line, and calculate each distance between each first elevation point and each intersection point after projection based on the positional relationship between each first elevation point and the design centerline; wherein, the first elevation point is an elevation point within a third preset buffer distance from the cross-section line.

[0068] S5. Calculate each elevation of each intersection point using linear interpolation;

[0069] S6. Draw a cross-sectional view of the cross-section line based on each mileage, each distance, and each elevation.

[0070] In this embodiment of the invention, by using ObjectARX.Net as the basic framework and combining the least squares algorithm and the Random Sample Consensus (RANSAC) algorithm to automatically generate cross-sectional planar diagrams, batch automated generation of water system cross-sectional diagrams is achieved.

[0071] Specifically, in step S1, by reading the dwg file of the topographic map of the water system to be drawn, several elevation points to be marked are obtained. The obtained elevation points to be marked are as follows: Figure 2 As shown.

[0072] In an optional embodiment, step S2, which involves performing straight-line fitting on a plurality of the elevation points to be marked based on the least squares method and a random sampling consensus algorithm, to obtain a plurality of cross-sectional lines and marked elevation points, includes:

[0073] S21. Randomly select one elevation point from all the elevation points to be marked as the second elevation point;

[0074] S22. Fit all the elevation points to be marked in the initial point set using the least squares method to obtain the first fitted line; wherein, the initial point set includes all the elevation points to be marked that are within a first preset distance from the second elevation point;

[0075] S23. Use the random sampling consensus algorithm to fit all the elevation points to be marked in the first point set, and iteratively calculate to obtain the second fitted line; wherein, the first point set includes all the elevation points to be marked that are within a first preset buffer distance from the first fitted line;

[0076] S24. Sort all the elevation points to be marked in the second point set according to the slope of the second fitted line; wherein, the second point set includes all the elevation points to be marked that are within a second preset buffer distance from the second fitted line;

[0077] S25. Based on the first preset distance threshold between two adjacent elevation points to be marked, the sorted second set of points is divided to obtain several subsets of points.

[0078] S26. Count the number of elevation points to be marked in each of the aforementioned sub-point sets, obtain the sub-point set with the largest number of elevation points, use the random sampling consensus algorithm to fit all the elevation points to be marked in the sub-point set to obtain the third fitted line, and mark all the elevation points to be marked in the sub-point set.

[0079] S27. Determine whether any of the above-mentioned elevation points to be marked still exist. If so, return to the step of randomly selecting an elevation point to be marked from all the above-mentioned elevation points to be marked as the second elevation point.

[0080] In an optional embodiment, step S24, which involves sorting all the elevation points to be labeled within the second point set according to the slope of the second fitted straight line, includes:

[0081] Determine whether the absolute value of the slope of the second fitted line is greater than a preset value. If so, sort all the elevation points to be marked in the second point set according to the size of their y-values. Otherwise, sort all the elevation points to be marked in the second point set according to the size of their x-values.

[0082] Preferably, the preset value is 1.

[0083] It is understood that elevation points are three-dimensional coordinates, specifically represented as (x, y, h). In this embodiment of the invention, when the absolute value of the slope of the second fitted line is less than or equal to a preset value, all elevation points to be marked within the second point set are sorted according to the magnitude of their x-coordinate values; when the absolute value of the slope of the second fitted line is greater than the preset value, all elevation points to be marked within the second point set are sorted according to the magnitude of their y-coordinate values.

[0084] In an optional embodiment, step S25, which involves dividing the sorted second set of points into several subsets based on a first preset distance threshold between two adjacent elevation points to be marked, includes:

[0085] S251. Calculate the adjacent distance between the current elevation point to be marked and the previous elevation point to be marked in the sorted second point set;

[0086] S252. Determine whether the adjacent distance is less than the first preset distance threshold. If yes, store the current elevation point to be marked into the current subset; otherwise, store it into the next subset.

[0087] For example, such as Figure 4 As shown, in the drawing software, the maximum distance M between adjacent elevation points on the same cross-section line is preset, and the buffer distance N of the fitted cross-section line is determined. This maximum distance M can be used as a first preset distance threshold or as a second preset distance threshold for the next step. The fitted cross-section line buffer distance M can be used as a first preset buffer distance, a second preset buffer distance, and a third preset buffer distance. In this embodiment, the first preset distance threshold and the second preset distance threshold can be set to the same distance or different distances. The first preset buffer distance, the second preset buffer distance, and the third preset buffer distance can be set to the same distance or different distances; no limitation is made here. Preferably, M = 50 meters and N = 5 meters.

[0088] Randomly select one elevation point from all the elevation points to be marked as the second elevation point;

[0089] Extract all the elevation points to be marked from all the elevation points to be marked that are within a first preset distance from the second elevation point, and use them as the initial point set P0; fit all the elevation points to be marked in the initial point set P0 using the least squares method to obtain the first fitted line L1; preferably, the first preset distance is greater than 5 meters and less than 15 meters.

[0090] Extract all elevation points within 5 meters of both sides of the first fitted line L1 from all the elevation points to be marked, and use them as the first point set P1; use the random sampling consensus algorithm to fit all the elevation points to be marked in the first point set P1, and iterate to obtain the second fitted line L2.

[0091] Extract all elevation points within 5 meters of both sides of the second fitted line L2 from all the elevation points to be marked, and form a second point set P2; sort all elevation points in the second point set P2 according to the slope of the second fitted line;

[0092] Based on a first preset distance threshold between two adjacent elevation points to be marked, the sorted second point set P2 is divided into several subsets. The number of elevation points to be marked in each subset is counted, and the subset with the largest number of elevation points is obtained. A random sampling consensus algorithm is used to fit all elevation points to be marked within this subset to obtain a third fitted line, and all elevation points to be marked within this subset are then marked. Specifically, the adjacent distance between the current elevation point to be marked and the previous elevation point to be marked within the sorted second point set P2 is calculated. It is determined whether the adjacent distance is less than the first preset distance threshold; if so, the current elevation point to be marked is stored in the current subset NPL. j j is an integer, initially set to 0; otherwise, it is stored in the next subset NPL. j+1 This process continues until all elevation points to be labeled in the second point set P2 are segmented. To better understand the segmentation of the second point set P2, as follows... Figure 5 As shown, at the bend of the water system, multiple cross-sectional lines will appear on the same fitted straight line. After sorting all the elevation points to be marked in the second point set P2, the distance between adjacent points is calculated. As long as the distance is greater than the first preset distance threshold, the points are segmented. Finally, three point sets NPL1, NPL2 and NPL3 are segmented. Then, the point set with the most points is selected as NPL2 for fitting.

[0093] Determine if any of the aforementioned elevation points still exist. If so, repeat all the above steps until all elevation points have been marked, resulting in several cross-sectional lines, such as... Figure 3 As shown.

[0094] For example, in an optional embodiment, after step S2, which involves performing straight-line fitting on several of the elevation points to be marked based on the least squares method and the random sampling consensus algorithm to obtain several cross-sectional lines and the marked elevation points, the water system cross-section drawing method further includes:

[0095] When it is determined that the distance between any two adjacent elevation points on any cross-section line exceeds the second preset distance threshold, the elevation points of the cross-section line are remeasured, and a new cross-section line is generated by fitting the remeasured elevation points with a straight line based on the least squares method and the random sampling consensus algorithm.

[0096] Preferably, the second preset distance threshold is 50 meters.

[0097] In this embodiment of the invention, when the distance between any two adjacent elevation points on any cross-section line exceeds a second preset distance threshold, it indicates that the cross-section line lacks too many sample points, such as... Figure 6 As shown, the fitted cross-section lines 1 and 2, and 3 and 4 are the same cross-section line, and there is a situation where the distance between any two adjacent elevation points exceeds the second preset distance threshold. In order to protect the accuracy of the cross-section diagram and to prevent different cross-section lines from being connected in series at bends, for cross-section lines with this situation, it is necessary to conduct additional elevation measurements in the field, and repeat step S2 for the newly measured elevation points to generate new cross-section lines.

[0098] In an optional embodiment, step S3, which involves determining each intersection point where the line connecting each pair of adjacent vertices of the design line intersects with each of the cross-sectional lines, and calculating each mileage at each intersection point, includes:

[0099] Obtain each vertex of the design centerline from downstream to upstream;

[0100] Determine the intersection point of the line connecting each pair of adjacent vertices with each section line;

[0101] For each intersection point, calculate the distance between the intersection point and the first vertex, the total distance of the broken line between all vertices downstream of the first vertex, and add the initial mileage of the starting point of the design line, the distance between the intersection point and the first vertex, and the total distance of the broken line to obtain the mileage of the intersection point; wherein, the first vertex is the vertex adjacent to the intersection point and located downstream of the intersection point.

[0102] For example, such as Figure 7 As shown, after obtaining the coordinates of any intersection point cp between the cross-section line and the design centerline, the distance between the intersection point cp and the first vertex v3 is calculated. Then, the initial mileage L0 and the total distance of the polyline from vertex v1 to vertex v3 are added to obtain the mileage L of the intersection point cp. cp =L0+d 12 +d23 +d 3c The mileage calculation for the remaining intersection points follows the same principle.

[0103] Understandably, the design centerline refers to the design centerline of a river system. It is drawn according to requirements. For example, the location of the middle of the river to be surveyed can be found based on orthophotos, and then the points are connected one by one, forming a multi-segment line.

[0104] It is understood that the initial mileage refers to the mileage of the starting point. In this embodiment of the invention, the mileage is calculated in the order from downstream to upstream. Therefore, the mileage corresponding to the starting point of the downstream is the initial mileage. Generally, the client will provide this information. If not, the default value is 0.

[0105] In an optional embodiment, step S4 involves determining the positional relationship between each first elevation point and the design centerline through the following steps:

[0106] Along the direction of the design centerline, extract all elevation points within a third preset buffer distance from all marked elevation points, and use them as the first elevation points;

[0107] For each section line, determine the two second vertices of the line segment of the design centerline that intersects with that section line;

[0108] Calculate the first vector between the two second vertices and each second vector between any second vertex and each first elevation point of the cross section line. Perform a vector cross product operation between the first vector and each second vector to obtain the result of each vector cross product operation.

[0109] Based on the result of the cross product of each vector, the positional relationship of each first elevation point of the cross section line relative to the corresponding design centerline is obtained.

[0110] For example, such as Figure 8 As shown, line AB is the design centerline, A is the downstream vertex, B is the upstream vertex, and point P is the first elevation point. Its left and right positions can be determined by the cross product (cross product) of vectors AB and AP. The result of the cross product is expressed as AB × AP.

[0111] When it is determined that AB×AP>0, point P is to the left of line segment AB, as shown below. Figure 8 (a);

[0112] When it is determined that AB×AP<0, point P is to the right of line segment AB, as shown below. Figure 8 (b);

[0113] When it is determined that AB × AP = 0, point P lies on the extension of line segment AB, as shown below. Figure 8 (c) Figure 8 (d) Figure 8 (e).

[0114] Using the intersection point (also known as the center stake) as the boundary, after determining the left and right positions of the elevation points within the buffer zone of the same cross-section line, that is, within the third preset buffer distance of the same cross-section line relative to the design centerline, the first elevation point is projected onto the cross-section line. Then, the distance between each first elevation point after projection and the intersection point is calculated. The distance of the first elevation point on the left is defined as a negative value, and the distance of the first elevation point on the right is defined as a positive value. This achieves the sorting of the first elevation points from left to right, that is, sorting them according to the distance from smallest to largest. This distance is also the distance between the first elevation point and the center stake.

[0115] In an optional embodiment, step S5, which involves calculating each elevation of each of the intersection points using linear interpolation, includes:

[0116] Extract the nearest elevation points to each intersection point from both the left and right sides of that intersection point;

[0117] Calculate each elevation of each of the aforementioned intersection points using the following formula:

[0118]

[0119] In the formula, H LeftNearest H is the elevation of the leftmost elevation point closest to the intersection point. RightNearest D is the elevation of the rightmost elevation point closest to the intersection point. LeftNearest D is the distance between the projection of the nearest left elevation point to the intersection point and the intersection point. RightNearest This is the distance between the projection of the nearest right elevation point to the intersection and the intersection point.

[0120] In an optional embodiment, step S6, based on each mileage, each distance, and each elevation, draws a cross-sectional view of the cross-section line, including:

[0121] A cross-sectional diagram is drawn with each distance as the x-axis and its corresponding elevation as the y-axis.

[0122] Using each mileage as the horizontal axis and its corresponding elevation as the vertical axis, a longitudinal profile is drawn.

[0123] Understandably, for a cross-section, the distance between the elevation points on the left and right sides and the intersection point is used as the abscissa for each cross-section line, with the left side being positive and the right side negative. Finally, the elevation is used as the ordinate, and a cross-section diagram is drawn in conjunction with the scale. For example, a cross-section diagram would look like this: Figure 9 As shown in (a), where, Figure 9 (b), (c), and (d) respectively Figure 9 (a) is a magnified view of a portion of the image. Figure 9(b) Specific mileage information (ZCSX4+468.70 is the mileage of this cross section; T=36 is the number of elevation points in this cross section, corresponding to the maximum value of the serial number; L=19 indicates that there are 19 elevation points on the left side of the cross section; the following five columns represent the serial number of the elevation points from left to right, the distance from the first elevation point on the left to each elevation point on the right, the distance from all elevation points on both sides to the center stake, the elevation of each elevation point, and remarks). Figure 9 (c) shows the coordinate axes and cross-sectional view (the vertical axis represents elevation; the horizontal axis represents distance; the origin is the center stake). Figure 9 (d) is the drawing table information, which includes information such as units, project, and scale.

[0124] For the longitudinal profile, the mileage of each intersection point of the design centerline and the section line is used as the abscissa, and the elevation is used as the ordinate, combined with the scale to draw the longitudinal profile diagram; for example, the longitudinal profile diagram is as follows: Figure 10 As shown in (a), Figure 10 (b) and (c) are respectively Figure 10 (a) is a magnified view of a portion of the image. Figure 10 (b) shows the coordinate axes and cross-sectional view (the horizontal axis represents mileage, where the upper scale is the standard mileage scale and the lower scale is the specific elevation value; the vertical axis represents elevation; the values ​​on the cross-sectional lines are the elevation values ​​of the elevation points). Figure 10 (c) is the drawing table information, which specifically includes information such as units, project, and scale.

[0125] The present invention provides a method for drawing river system cross-sections, which automatically generates river system cross-section diagrams from elevation points by combining the least squares method and the random sampling consensus algorithm. Based on the design centerline of the river and its flow direction, the method automatically calculates the mileage of the intersection point, the distance between the intersection point and the first elevation point, and the elevation of the intersection point. Ultimately, it realizes the automated batch drawing of river system cross-section diagrams, which is simple to operate and greatly improves the efficiency of producing river system cross-section diagrams.

[0126] See Figure 11 , Figure 11 This is a structural block diagram of a water system cross-section drawing device 10 provided in an embodiment of the present invention. The water system cross-section drawing device 10 includes:

[0127] The module 11 for acquiring elevation points to be marked is used to acquire several elevation points to be marked on the topographic map of the water system to be drawn.

[0128] The cross-section line generation module 12 is used to perform straight line fitting on a number of elevation points to be marked based on the least squares method and random sampling consensus algorithm to obtain a number of cross-section lines and marked elevation points.

[0129] The mileage calculation module 13 is used to determine each intersection point where the line connecting each pair of adjacent vertices of the design centerline intersects with each of the cross-sectional lines, and to calculate each mileage of each intersection point;

[0130] The distance calculation module 14 is used to project each first elevation point onto the corresponding cross-section line, and calculate each distance between each first elevation point and each intersection point after projection based on the positional relationship between each first elevation point and the design centerline; wherein, the first elevation point is an elevation point within a third preset buffer distance from the cross-section line.

[0131] Elevation calculation module 15 is used to calculate each elevation of each of the said intersection points using linear interpolation;

[0132] The cross-section drawing module 16 is used to draw a cross-section diagram of the cross-section line based on each mileage, each distance and each elevation.

[0133] It is worth noting that the working process of each module in the water system cross-section drawing device 10 described in the embodiments of the present invention can refer to the working process of the water system cross-section drawing method described in the above embodiments, and will not be repeated here.

[0134] The water system cross-section drawing device 10 provided in this embodiment of the invention automatically generates water system cross-section diagrams from elevation points by combining the least squares method and the random sampling consensus algorithm. Based on the design centerline of the river and its flow direction, it automatically calculates the mileage of the intersection point, the distance between the intersection point and the first elevation point, and the elevation of the intersection point. Finally, it realizes the automated batch drawing of water system cross-section diagrams, which is simple to operate and greatly improves the efficiency of water system cross-section diagram production.

[0135] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A water system cross section drawing method characterized by, The method comprises the following steps: acquiring a plurality of to-be-labeled elevation points of a to-be-drawn water system topographic map; performing linear fitting on the plurality of to-be-labeled elevation points based on a least square method and a random sample consensus algorithm to obtain a plurality of section lines and labeled elevation points; determining each intersection point of a line connecting each adjacent two vertices of a design centerline and each section line, and calculating a distance of each intersection point from a starting point; wherein the design centerline is a line connecting the middle positions of rivers on the to-be-drawn water system topographic map; projecting each first elevation point onto a corresponding section line, and calculating a distance between each projected first elevation point and each intersection point based on a positional relationship between each first elevation point and the design centerline; wherein the first elevation point is an elevation point within a third preset buffer distance from the section line; calculating an elevation of each intersection point by linear interpolation; drawing a section map of the section line according to each distance, each distance and each elevation.

2. The watercourse profile drawing method according to Claim 1, wherein The performing linear fitting on the plurality of to-be-labeled elevation points based on the least square method and the random sample consensus algorithm comprises the following steps: randomly selecting a to-be-labeled elevation point from all the to-be-labeled elevation points as a second elevation point; performing fitting on all the to-be-labeled elevation points in an initial point set by a least square method to obtain a first fitting straight line; wherein the initial point set comprises all the to-be-labeled elevation points within a first preset distance from the second elevation point; performing fitting on all the to-be-labeled elevation points in a first point set by a random sample consensus algorithm and iteratively calculating to obtain a second fitting straight line; wherein the first point set comprises all the to-be-labeled elevation points within a first preset buffer distance from the first fitting straight line; sorting all the to-be-labeled elevation points in a second point set according to a slope of the second fitting straight line; wherein the second point set comprises all the to-be-labeled elevation points within a second preset buffer distance from the second fitting straight line; segmenting the sorted second point set according to a first preset distance threshold between adjacent to-be-labeled elevation points to obtain a plurality of sub-point sets; counting the number of to-be-labeled elevation points in each sub-point set to obtain a sub-point set with the largest number of to-be-labeled elevation points, performing fitting on all the to-be-labeled elevation points in the sub-point set by the random sample consensus algorithm to obtain a third fitting straight line, and labeling all the to-be-labeled elevation points in the sub-point set; determining whether there is any to-be-labeled elevation point, and if yes, returning to the step of randomly selecting a to-be-labeled elevation point from all the to-be-labeled elevation points as a second elevation point.

3. The watercourse profile drawing method according to claim 2, wherein The sorting all the to-be-labeled elevation points in the second point set according to the slope of the second fitting straight line comprises: determining whether an absolute value of the slope of the second fitting straight line is greater than a preset value, and if yes, sorting all the to-be-labeled elevation points in the second point set according to the size of their y values, otherwise, sorting all the to-be-labeled elevation points in the second point set according to the size of their x values.

4. The watercourse profile drawing method according to claim 2, wherein The second point set is segmented according to a first preset distance threshold between two adjacent to-be-labeled elevation points, to obtain a plurality of sub-point sets, including: The adjacent distance between a current to-be-labeled elevation point and a previous to-be-labeled elevation point in the sorted second point set is calculated; It is judged whether the adjacent distance is less than the first preset distance threshold, if yes, the current to-be-labeled elevation point is stored in the current sub-point set, otherwise, it is stored in the next sub-point set.

5. The watercourse profile drawing method according to Claim 1, wherein After the least square method and the random sample consensus algorithm are used to perform straight line fitting on the plurality of to-be-labeled elevation points, to obtain a plurality of section lines and labeled elevation points, the water system section drawing method further includes: When it is judged that the distance between any two adjacent elevation points on any section line exceeds a second preset distance threshold, the elevation points of the section line are supplemented, and the least square method and the random sample consensus algorithm are used to perform straight line fitting on the supplemented elevation points, to generate a new section line.

6. The watercourse profile drawing method according to Claim 1, wherein Each intersection point where the line segment between each two adjacent vertices of the design center line intersects with each section line is determined, and the mileage of each intersection point is calculated, including: Each vertex of the design center line from downstream to upstream is obtained; The intersection point where the line segment between each two adjacent vertices intersects with each section line is determined; For each intersection point, the distance between the intersection point and a first vertex, the total distance of the polyline between all vertices downstream of the first vertex, and the initial mileage of the starting point of the design center line are added, to obtain the mileage of the intersection point; wherein the first vertex is adjacent to the intersection point and downstream of the intersection point.

7. The watercourse profile drawing method according to Claim 1, wherein The positional relationship of each first elevation point with respect to the design center line is determined by the following steps, including: All elevation points within a third preset buffer distance from the section line are extracted from all labeled elevation points as first elevation points along the direction of the design center line; For each section line, two second vertices of the line segment of the design center line intersecting with the section line are determined; The first vector between the two second vertices, each second vector between any second vertex and each first elevation point of the section line, and the vector outer product operation result of each vector outer product operation are calculated by performing vector outer product operation on the first vector and each second vector, respectively; According to each vector outer product operation result, each positional relationship of each first elevation point of the section line with respect to the corresponding design center line is obtained.

8. The watercourse profile drawing method according to Claim 1, wherein Each elevation of each intersection point is calculated by linear interpolation, including: The elevation points closest to the intersection point are extracted from the left and right sides of each intersection point, respectively; Each elevation of each intersection point is calculated according to the following formula: where H LeftNearest is the elevation of the left-most elevation point from the intersection, H RightNearest is the elevation of the right-most elevation point from the intersection, D LeftNearest is the distance between the projection of the left-most elevation point from the intersection and the intersection, D RightNearest is the distance between the projection of the right-most elevation point from the intersection and the intersection.

9. The watercourse profile drawing method according to Claim 1, wherein According to each mileage, each distance, and each elevation, a section view of the section line is drawn, including: The cross-sectional view is drawn with each distance as the horizontal coordinate and the corresponding elevation as the vertical coordinate; The vertical section view is drawn with each mileage as the horizontal coordinate and the corresponding elevation as the vertical coordinate.

10. A watercourse cross section drawing device characterized by comprising: ​ The elevation point to be marked acquisition module is configured to acquire a plurality of elevation points to be marked of a water system topographic map to be drawn; The section line generation module is configured to perform linear fitting on the plurality of elevation points to be marked based on a least square method and a random sample consensus algorithm to obtain a plurality of section lines and marked elevation points; The mileage calculation module is configured to determine each intersection point of a line connecting each adjacent two vertices of a design centerline and each section line, and calculate each mileage of each intersection point, wherein the design centerline is a line connecting the middle positions of rivers of the water system topographic map to be drawn, specifically, the middle positions of the rivers in the water system topographic map to be drawn; The distance calculation module is configured to project each first elevation point to a corresponding section line, and calculate each distance between each first elevation point and each intersection point after projection based on the positional relationship between each first elevation point and the design centerline, wherein the first elevation point is an elevation point within a third preset buffer distance from the section line; The elevation calculation module is configured to calculate each elevation of each intersection point by linear interpolation; The section drawing module is configured to draw a section drawing of the section line according to each mileage, each distance and each elevation.

Citation Information

Patent Citations

  • Method for automatically generating plane-section drawing of underground cable duct lines

    CN104008252A

  • Roadbed gutter automatic calculation and rapid drawing method

    CN111859513A