A water system vector direction logic detection method and system

CN122925830APending Publication Date: 2026-10-16SURVEYING & MAPPING TECH SERVICE CENT OF SICHUAN BUREAU OF SURVEYING MAPPING & GEOGRAPHIC INFORMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611156447.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0008]针对现有技术中的上述不足,本发明提供的一种水系矢量方向逻辑检测方法及系统,通过DEM高程校验、对流识别与汇集角定量计算三重检测机制,实现水系矢量方向逻辑的自动化、定量化质量检测,解决了传统流向质检依赖人工目视核查、效率低下且判定标准不统一、现有质检维度单一、校验逻辑不系统,难以全面覆盖水系方向逻辑错误的问题

Benefits of technology

[0019]上述进一步方案的有益效果是:采用向量点积公式计算流向夹角,将“对流”从经验性的目视判断转化为精确的数值指标,解决了传统人工检查或简单拓扑判断中标准模糊、因人而异的问题,让向量夹角计算方法不依赖特定水系形态与地形条件,无论是山区树枝状水系、平原网状水系还是人工渠系均适用,从而可以无缝嵌入不同精度等级的地理信息数据生产质检流程。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122925830A_ABST
    Figure CN122925830A_ABST
Patent Text Reader

Abstract

The application provides a water system vector direction logic detection method and system, and relates to the technical field of surveying and mapping geographic information. The method comprises the following steps: data preprocessing; water system flow direction high-low checking based on DEM, judging whether the water system flows from high to low through an elevation trend coefficient K; water system convection detection, identifying convection anomalies based on the included angle of the flow direction vector; water system confluence acute angle detection, calculating the intersection angle through the vector dot product formula and judging the rationality of the acute angle; and abnormal result grading output. The application establishes a triple detection mechanism from three dimensions of physical laws, topological logic and geometric shapes, converts traditional qualitative judgment into quantitative indicators, realizes the automatic detection of water system vector direction logic errors, greatly improves the quality inspection efficiency and accuracy of water system data, and can be widely applied to scenes such as basic geographic information data production and hydrological database construction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surveying and mapping geographic information technology, and in particular to a method and system for logical detection of water system vector direction. Background Technology

[0002] River system vector data is one of the core foundational data types of geospatial databases. It is a directional vector data used in hydrological simulation, watershed planning, emergency disaster relief, flood control and drainage, and ecological protection. During the quality control process of producing, updating, and storing river system vector data, checking the logical correctness of river flow directions directly affects the reliability of subsequent hydrological analysis results.

[0003] Currently, the quality inspection of water system vector data mainly relies on manual visual inspection or simple topology inspection, which has the following technical shortcomings: Low efficiency in detecting the correctness of water flow direction: Traditional methods mainly rely on manual verification of the water flow direction by comparing it with topographic maps one by one. This is labor-intensive, inefficient, and easily affected by human factors, resulting in missed or incorrect detections.

[0004] Convection phenomena are difficult to detect: Water system convection (i.e., adjacent river sections flowing in opposite directions, forming unreasonable countercurrents) is a common data error, but existing automated detection methods are difficult to accurately identify convection boundaries and convection river sections.

[0005] The lack of quantitative judgment criteria for the geometric rationality of water system confluence: Natural water systems usually present an acute angle at the confluence, but current technology lacks a unified mathematical calculation formula to quantitatively detect the confluence angle, and relies more on experience-based judgment.

[0006] Insufficient utilization of DEM data: Although DEM data has been widely used for water system extraction, a systematic flow direction logic verification method has not yet been established in the scenario of quality verification of existing water system vector data.

[0007] Therefore, there is an urgent need to develop a method and system that can automatically and quantitatively detect the logical correctness of water system vector directions in order to improve the efficiency and accuracy of water system vector data quality control. Summary of the Invention

[0008] To address the aforementioned shortcomings in existing technologies, this invention provides a method and system for detecting the logic of water system vector directions. Through a triple detection mechanism of DEM elevation verification, convection identification, and quantitative calculation of convergence angle, it achieves automated and quantitative quality detection of water system vector direction logic. This solves the problems of traditional flow direction quality inspection relying on manual visual verification, low efficiency, inconsistent judgment standards, single existing quality inspection dimensions, unsystematic verification logic, and difficulty in comprehensively covering errors in water system direction logic.

[0009] To achieve the above objectives, the technical solution adopted by this invention is: a water system vector direction logic detection method, comprising the following steps: S1. Data preprocessing: Obtain DEM raster data and vector data of the river system to be detected in the study area, perform spatial reference registration and topological preprocessing on the vector data of the river system to be detected, establish the river segment-node topological relationship, and perform projection transformation and resampling on the DEM raster data to make it consistent with the spatial reference of the vector data of the river system to be detected. S2. Verification of the elevation of the river system flow direction based on DEM: Based on the data preprocessing results, elevation points are sampled at fixed intervals along the river system vector line to extract the DEM elevation values. Based on the extracted DEM elevation values, the elevation trend coefficient K of the river section is calculated. The elevation trend coefficient K of the river section is used to determine whether the river system follows the natural law of flowing from high to low. S3. Water system convection detection: Construct a directed topology map of the water system and identify river segments with abnormal convection by calculating the angle between the flow directions of adjacent river segments; S4. Acute Angle Detection at River Confluence: Identify confluence nodes and calculate the confluence angle of the inflow river segments. Determine whether it conforms to the acute angle intersection rule; S5. Abnormal Result Classification Output: Based on the combined results of the three detection items S2 to S4, an abnormality classification is performed, a detection report is generated, and the logical detection of the water system vector direction is completed.

[0010] The beneficial effects of this invention are as follows: This invention establishes a triple detection mechanism from three dimensions—physical laws, topological logic, and geometric morphology—by verifying the elevation of water flow direction, detecting water convection, and detecting acute angles at water confluence points. This transforms traditional qualitative judgments into quantitative indicators, enabling automated detection of logical errors in water system vector directions. It significantly improves the efficiency and accuracy of water system data quality inspection and can be widely applied to scenarios such as basic geographic information data production and hydrological database construction.

[0011] Furthermore, the expression for the elevation trend coefficient K of the river section is as follows:

[0012] in, Indicates the number of sampling points in the river section. Indicates the first DEM elevation values ​​of each sampling point Indicates the first The DEM elevation values ​​of each sampling point are arranged according to the flow direction; when K < 0 and |K| is greater than the tolerance threshold T, it is judged as an abnormal flow direction reversal.

[0013] The beneficial effects of the above-mentioned further solutions are: resisting DEM noise and micro-topographic interference, significantly reducing the misjudgment rate, and transforming the common-sense qualitative rule of "water flows downhill" into a calculable and reproducible quantitative indicator K and a clear judgment boundary, providing a quantitative basis for the entire process of anomaly classification and cross-validation.

[0014] Furthermore, S3 includes: Based on the river segment topology table, construct a directed topology graph of the water system; Based on the directed topology graph of the river system, all adjacent river segment pairs are traversed, and the number of inflow and outflow river segments are counted for each node; Based on the directed topology graph of the water system, a depth-first search algorithm is used to traverse all nodes and search for paths that satisfy the constraints as candidate closed loops. After the traversal is completed, the river segment sequence and the coordinates of the first and last nodes of all candidate paths are output. Among them, the paths that satisfy the constraints include a number of river segments ≥ 3 and ≤ the preset maximum number of loop segments, and the nodes other than the first and last nodes are not repeated, excluding local micro-bends and self-intersecting paths. For each candidate path, the length attributes of all river segments within the path are summed to obtain the total loop length. :

[0015] in, This indicates the total number of river segments included in the path. Indicates the first The actual length of each river segment is in units consistent with spatial coordinate units; Extract the planar coordinates of the start and end nodes of the candidate path ( , )and( , ), calculate the Euclidean distance between two points. :

[0016] Substitute into the formula to calculate the topological closure of the candidate circuit. :

[0017] Based on the statistical counts of inflow and outflow segments, firstly, the angle between the flow direction vectors is calculated. First, match the topological closure of candidate loops corresponding to two river segments. If two river segments both belong to a natural loop-shaped drainage system with satisfactory topological closure, then the large angle between them represents a normal bend in the river. Secondly, for any two river segments sharing the same node, their flow direction vectors are extracted, and the angle between the flow directions of the two river segments is calculated. When the included angle When the angle is greater than 150° and the two river segments have the same flow direction at the common node, it is judged as a suspected convection anomaly; among them, for the two river segments at the common node, their flow direction vectors are calculated using the following formula. and The included angle :

[0018] Based on the judgment results and the topological closure of the river loop, the topographic rationality of the convection area was verified by combining DEM elevation, and the convection anomaly was confirmed.

[0019] The beneficial effects of the above-mentioned further solutions are: by using the vector dot product formula to calculate the flow direction angle, "convection" is transformed from an empirical visual judgment into a precise numerical indicator, which solves the problems of vague standards and individual differences in traditional manual inspection or simple topological judgment. The vector angle calculation method does not depend on specific water system morphology and terrain conditions, and is applicable to dendritic water systems in mountainous areas, network water systems in plains, or artificial canal systems. Therefore, it can be seamlessly embedded into the production quality inspection process of geographic information data of different accuracy levels.

[0020] Furthermore, the determination of whether it conforms to the acute angle intersection rule includes: At a fixed distance upstream of the aggregation node d Take sampling points at each location, and use the line connecting the sampling points and nodes as the flow direction vector; Let the aggregation node be J The flow direction vectors of the two inflow segments at the confluence node are: and The unit vector of the outflow section is The confluence angle of the two inflow sections for:

[0021] When the intersection angle When the angle is ≥90°, it is considered an abnormal convergence angle; when the angle of convergence is ≥90°, it is considered an abnormal convergence angle. When the angle is less than 90°, use the following formula to calculate the acute angle rationality index to determine whether it conforms to the acute angle intersection rule:

[0022] in, This represents the optimal convergence angle.

[0023] The advantages of the above-mentioned further scheme are: traditional convergence angle calculations often directly use the direction of the line segment endpoints at the node, which is easily affected by local river bends and topological breaks near the node, resulting in large fluctuations and poor representativeness in the angle calculation results. This invention uses a fixed distance upstream of the convergence node. dThe sampling method uses the vector pointing from the sampling point to the node to represent the overall inflow direction of the river section, which effectively filters out the morphological interference of local river bends around the node. The calculation results are more consistent with the real convergence geometry of the water system. In addition, all river sections adopt a unified sampling distance standard, and the calculation caliber is consistent for different river sections and different degrees of bend, which significantly improves the stability and comparability of the results.

[0024] Furthermore, the rules for classifying anomalies include: Level 1 anomalies are inverted flow direction, Level 2 anomalies are water system convection, and Level 3 anomalies are convergence angle anomalies.

[0025] The beneficial effects of the above-mentioned further solutions are: outputting abnormal results from three independent dimensions—physical laws, topological logic, and geometric morphology—and integrating the three types of scattered detection outputs into a unified quality evaluation system through grading rules, avoiding the fragmentation and lack of system of abnormal results, thereby constructing an error severity gradient, realizing priority control of quality inspection and rectification, and significantly improving the efficiency of detection operations.

[0026] The present invention also provides a water system vector direction logic detection system, comprising: The data preprocessing module is used to acquire DEM raster data and vector data of the river system to be detected in the study area, perform spatial reference registration and topological preprocessing on the vector data of the river system to be detected, establish the river segment-node topological relationship, and perform projection transformation and resampling on the DEM raster data to make it consistent with the spatial reference of the vector data of the river system to be detected. The DEM flow direction verification module, based on the data preprocessing results, samples elevation points at fixed intervals along the water system vector line, extracts DEM elevation values, and calculates the river section elevation trend coefficient K based on the extracted DEM elevation values. The river section elevation trend coefficient K is used to determine whether the water system follows the natural law of flowing from high to low. The convection detection module is used to construct a directed topology map of the river system and identify river segments with abnormal convection by calculating the angle between the flow directions of adjacent river segments; The confluence angle calculation module is used to identify confluence nodes and calculate the confluence angle of the inflow segment. Determine whether it conforms to the acute angle intersection rule; The results output module is used to integrate the detection results from the DEM flow direction verification module to the convergence angle calculation module, classify anomalies, generate a detection report, and complete the logical detection of the water system vector direction.

[0027] The beneficial effects of this invention are as follows: This invention establishes a triple detection mechanism from three dimensions—physical laws, topological logic, and geometric morphology—by verifying the elevation of water flow direction, detecting water convection, and detecting acute angles at water confluence points. This transforms traditional qualitative judgments into quantitative indicators, enabling automated detection of logical errors in water system vector directions. It significantly improves the efficiency and accuracy of water system data quality inspection and can be widely applied to scenarios such as basic geographic information data production and hydrological database construction. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the overall process of the method of the present invention; Figure 2 This is a schematic diagram illustrating the principle of water flow direction elevation verification based on DEM. Figure 3 This is a schematic diagram illustrating the principle of water system convection detection. Figure 4 A schematic diagram illustrating the calculation principle of acute angles at the confluence of water systems; Figure 5 This is a module architecture diagram of the system of the present invention. Detailed Implementation

[0029] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0030] Example 1 like Figure 1 As shown, this invention provides a method for logical detection of water system vector direction, the implementation of which is as follows: S1. Data preprocessing: Obtain DEM raster data and vector data of the river system to be detected in the study area, perform spatial reference registration and topological preprocessing on the vector data of the river system to be detected, establish the river segment-node topological relationship, and perform projection transformation and resampling on the DEM raster data to make it consistent with the spatial reference of the vector data of the river system to be detected. In this embodiment, 30-meter resolution DEM data and 1:10000 river system vector data of the study area were acquired. First, spatial reference unification was performed, converting both the DEM data and the river system vector data to the CGCS2000 Gauss-Kruger projection. Topology checks were then performed on the river system vector data: suspending nodes, pseudo-nodes, and duplicate segments were repaired, and a river segment topology table was established. Each river segment was recorded with a unique ID, starting node ID, ending node ID, river segment length, and flow direction attribute. Depression filling preprocessing was performed on the DEM data, using the Planchon-Darboux algorithm to fill false depressions, ensuring the hydrological continuity of the DEM.

[0031] S2. DEM-based elevation verification of river flow direction: Based on the data preprocessing results, elevation points are sampled at fixed intervals along the river system vector line to extract DEM elevation values. Based on the extracted DEM elevation values, the elevation trend coefficient of the river segment is calculated. K Through the river section elevation trend coefficient K To determine whether a water system follows a natural law of descending from high to low; In this embodiment, the elevation trend coefficient K The calculation formula is:

[0032] in, Indicates the number of sampling points in the river section. Indicates the first DEM elevation values ​​of each sampling point Indicates the first The DEM elevation values ​​of each sampling point are arranged according to the flow direction; when K <0 and| K When the value is greater than the tolerance threshold T, it is judged as an abnormal flow direction reversal.

[0033] In this embodiment, as Figure 2 As shown, samples were taken at 50-meter intervals along each river segment to generate a sampling point sequence. Bilinear interpolation was used to extract the DEM elevation value corresponding to each sampling point. Taking a certain river segment L as an example, 12 elevation points were obtained. The elevation values ​​(in meters) arranged according to the flow direction are: 520.3, 518.7, 517.2, 516.5, 515.8, 514.9, 514.2, 513.6, 512.8, 512.1, 511.5, 510.9. The sum of the elevation differences between adjacent points was calculated.

[0034] Elevation trend coefficient K =9.4 / 11≈0.85 meters / sampling interval K A value greater than 0 indicates that the river section generally flows from high to low elevations, and the flow direction is normal. If the calculated elevation trend coefficient for a certain river section is...K If the value is -0.62 and its absolute value is greater than the tolerance threshold T=0.2, then the river section is marked as a "reversed flow direction" level 1 anomaly. To eliminate the influence of DEM noise, a 3-point moving average filter is applied to the elevation trend coefficient before recalculating the elevation trend coefficient. K value.

[0035] In this embodiment, the DEM elevation values ​​are filtered by moving average before calculating the elevation trend coefficient to eliminate the influence of DEM noise.

[0036] S3. River System Convection Detection: Construct a directed topological graph of the river system, and identify river segments with abnormal convection by calculating the angle between the flow directions of adjacent river segments. The implementation method is as follows: Based on the river segment topology table, construct a directed topology graph of the water system; Based on the directed topology graph of the river system, all adjacent river segment pairs are traversed, and the number of inflow and outflow river segments are counted for each node; Based on the directed topology graph of the water system, a depth-first search algorithm is used to traverse all nodes and search for simple paths that satisfy the constraints as candidate closed loops. After the traversal is completed, the river segment sequence and the coordinates of the first and last nodes of all candidate paths are output. Among them, the path that satisfies the constraints contains a number of river segments ≥3 and ≤ the preset maximum number of loop segments, and the nodes other than the first and last nodes are not repeated, excluding local micro-bends and self-intersecting paths. The depth-first search algorithm is an existing algorithm, which is used to traverse or search trees or graphs. Its core idea is to search the branches of the tree as deep as possible until it is impossible to continue, and then backtrack to the previous branch point.

[0037] For each candidate path, the length attributes of all river segments within the path are summed to obtain the total loop length. :

[0038] in, This indicates the total number of river segments included in the path. Indicates the first The actual length of each river segment is in units consistent with spatial coordinate units; Extract the planar coordinates of the start and end nodes of the candidate path ( , )and( , ), calculate the Euclidean distance between two points. :

[0039] Substitute into the formula to calculate the topological closure of the candidate circuit. :

[0040] Topological closure The value range is (0, 1). The closer the value is to 1, the higher the degree of closure of the path space and the closer the shape is to a complete ring-shaped water system. Based on the statistical counts of inflow and outflow segments, firstly, the angle between the flow direction vectors is calculated. First, match the topological closure of candidate loops corresponding to two river segments. If two river segments both belong to a natural loop-shaped drainage system with satisfactory topological closure, then the large angle between them represents a normal bend in the river. Even if the angle and flow direction conditions are met, it is not considered a suspected convection anomaly. Secondly, for any two river segments sharing the same node, their flow direction vectors are extracted and the angle between the flow directions of the two river segments is calculated. When the included angle When the angle is greater than 150° and the two river segments have the same flow direction at the common node, it is judged as a suspected convection anomaly; among them, for the two river segments at the common node, their flow direction vectors are calculated using the following formula. and The included angle :

[0041] Based on the judgment results and the topological closure of the river loop, the topographic rationality of the convection area was verified by combining DEM elevation, and the convection anomaly was confirmed.

[0042] In this embodiment, a directed graph G=(V,E) is constructed based on the river segment topology table, where V represents the set of nodes and E represents the set of directed river segments. All nodes are traversed, and the number of inflow and outflow river segments is counted for each node. For any two river segments sharing the same node, their flow direction vectors are extracted and the included angle is calculated. Figure 3 As shown, node V connects the river segment and . The flow direction vector is from A to V: =(120,-80), The flow vector is from B to V: =(-130, -75). Calculate the angle between the vectors:

[0043]

[0044]

[0045] If the angle is less than the 150° threshold, it is not considered convection. If calculated... If the angle is 168° and both river segments are inflow nodes V, it is marked as a suspected convection. Further verification using the DEM topography confirms it as a level 2 anomaly. Simultaneously, cases where there is a shared node but no third river flowing out are directly identified. A loop drainage system exclusion rule is also set: if the detected river segments belong to a closed loop and there is a topographic depression within the loop, it is determined to be a natural loop drainage system, and the anomaly marker is excluded.

[0046] In this embodiment, the loop drainage system exclusion mechanism is implemented by calculating the topological closure of the river segment loop. This eliminates misjudgments caused by natural circular water systems. Among these, topological closure... The calculation results are output as "natural ring-shaped water system exclusion set". The core application is in the pre-filtering stage of "preliminary judgment of convection in shared node river sections". At the same time, it forms a linkage verification with topographic verification. It is a key intermediate link from "coarse screening" to "fine judgment" of convection detection.

[0047] S4. Acute Angle Detection at River Confluence: Identify confluence nodes and calculate the confluence angle of the inflow river segments. Determine whether the angles conform to the acute angle intersection rule; determining whether the angles conform to the acute angle intersection rule includes: At a fixed distance upstream of the aggregation node d Take sampling points at each location, and use the line connecting the sampling points and nodes as the flow direction vector; Let the aggregation node be J The flow direction vectors of the two inflow segments at the confluence node are: and The unit vector of the outflow section is The confluence angle of the two inflow sections for:

[0048] When the intersection angle When the angle is ≥90°, it is considered an abnormal convergence angle; when the angle of convergence is ≥90°, it is considered an abnormal convergence angle. When the angle is less than 90°, use the following formula to calculate the acute angle rationality index to determine whether it conforms to the acute angle intersection rule:

[0049] in, This represents the optimal convergence angle.

[0050] In this step, the upstream equidistant sampling method is used to calculate the flow direction vector. That is, sampling points are taken at a fixed distance upstream of the sink node, and the line connecting the sampling points and the node is used as the flow direction vector.

[0051] In this embodiment, all aggregation nodes with an inflow count ≥ 2 are identified. At the distance from the aggregation node... J Sampling points were taken 100 meters upstream for each inflow section, with the sampling points pointing towards the confluence node.J The vector is used as the inflow direction vector for that river section.

[0052] like Figure 4 As shown, the aggregation node J There are two inflow segments and one outflow segment. The direction vector of inflow segment 1. =(80,60), direction vector of inflow segment 2 =(-70, 90). Calculate the confluence angle of the two inflow segments. :

[0053]

[0054]

[0055] intersection An angle ≥90° does not conform to the acute-angle confluence pattern of natural water systems and is marked as a level three anomaly. If the confluence angle is calculated... =45°, the optimal convergence angle of this watershed =45°, then the rationality index R=1.0, indicating that the convergence angle is optimal.

[0056] S5. Anomaly Result Classification Output: Based on the combined results of the three detection items S2 to S4, anomalies are classified and a detection report is generated to complete the logical detection of the water system vector direction. The anomaly classification rules include: Level 1 anomaly is flow direction reversal, Level 2 anomaly is water system convection, and Level 3 anomaly is convergence angle anomaly.

[0057] In this embodiment, the three detection results are combined and classified according to the following rules: Level 1 anomaly: DEM flow direction is reversed, the most serious error, which should be corrected first; Level 2 anomaly: water convection, a relatively serious topological error; Level 3 anomaly: the convergence angle is not acute, which is a geometric anomaly.

[0058] Generate a detection report containing the abnormal river segment ID, abnormal type, abnormal quantification value, and spatial coordinates, and highlight the abnormal river segments in the GIS environment. Example 2 like Figure 5 As shown, the present invention provides a water system vector direction logic detection system for executing the water system vector direction logic method described in Embodiment 1, comprising: The data preprocessing module is used to acquire DEM raster data and vector data of the river system to be detected in the study area, perform spatial reference registration and topological preprocessing on the vector data of the river system to be detected, establish the river segment-node topological relationship, and perform projection transformation and resampling on the DEM raster data to make it consistent with the spatial reference of the vector data of the river system to be detected. The DEM flow direction verification module, based on the data preprocessing results, samples elevation points at fixed intervals along the water system vector line, extracts DEM elevation values, and calculates the river section elevation trend coefficient K based on the extracted DEM elevation values. The river section elevation trend coefficient K is used to determine whether the water system follows the natural law of flowing from high to low. The convection detection module is used to construct a directed topology map of the river system and identify river segments with abnormal convection by calculating the angle between the flow directions of adjacent river segments; The confluence angle calculation module is used to identify confluence nodes and calculate the confluence angle of the inflow segment. Determine whether it conforms to the acute angle intersection rule; The results output module is used to integrate the detection results from the DEM flow direction verification module to the convergence angle calculation module, classify anomalies, generate a detection report, and complete the logical detection of the water system vector direction.

[0059] In this embodiment, the functional units can be divided according to the water system vector direction logic detection method. For example, each function can be divided into its own functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this invention is illustrative and represents only one logical division; other division methods may be used in actual implementation.

[0060] In this embodiment, the water system vector direction logic detection system, in order to achieve the principle and beneficial effects of embodiment 1, includes hardware structures and / or software modules corresponding to the execution of various functions. Those skilled in the art should readily recognize that, in conjunction with the illustrative units and algorithm steps described in the embodiments disclosed herein, this invention can be implemented in hardware and / or a combination of hardware and computer software. Whether a function is executed by hardware or computer software depends on the specific application and design constraints of the technical solution. Different methods can be used to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

Claims

1. A method for logical detection of water system vector direction, characterized in that, Includes the following steps: S1. Data preprocessing: Obtain DEM raster data and vector data of the river system to be detected in the study area, perform spatial reference registration and topological preprocessing on the vector data of the river system to be detected, establish the river segment-node topological relationship, and perform projection transformation and resampling on the DEM raster data to make it consistent with the spatial reference of the vector data of the river system to be detected. S2. DEM-based elevation verification of river flow direction: Based on the data preprocessing results of S1, elevation points are sampled at fixed intervals along the river system vector line to extract DEM elevation values. Based on the extracted DEM elevation values, the elevation trend coefficient of the river segment is calculated. K Through the river section elevation trend coefficient K To determine whether a water system follows a natural law of descending from high to low; S3. Water system convection detection: Construct a directed topology map of the water system and identify river segments with abnormal convection by calculating the angle between the flow directions of adjacent river segments; S4. Acute Angle Detection at River Confluence: Identify confluence nodes and calculate the confluence angle of the inflow river segments. Determine whether it conforms to the acute angle intersection rule; S5. Abnormal Result Classification Output: Based on the combined results of the three detection items S2 to S4, an abnormality classification is performed, a detection report is generated, and the logical detection of the water system vector direction is completed.

2. The water system vector direction logic detection method according to claim 1, characterized in that, The elevation trend coefficient of the river section K The expression is as follows: in, Indicates the number of sampling points in the river section. Indicates the first DEM elevation values ​​of each sampling point Indicates the first The DEM elevation values ​​of each sampling point are arranged according to the flow direction; when K <0 and| K When the value is greater than the tolerance threshold T, it is judged as an abnormal flow direction reversal.

3. The water system vector direction logic detection method according to claim 1, characterized in that, S3 includes: Based on the river segment topology table, construct a directed topology graph of the water system; Based on the directed topology graph of the river system, all adjacent river segment pairs are traversed, and the number of inflow and outflow river segments are counted for each node; Based on the directed topology graph of the water system, a depth-first search algorithm is used to traverse all nodes and search for paths that satisfy the constraints as candidate closed loops. After the traversal is completed, the river segment sequence and the coordinates of the first and last nodes of all candidate paths are output. Among them, the paths that satisfy the constraints include a number of river segments ≥ 3 and ≤ the preset maximum number of loop segments, and the nodes other than the first and last nodes are not repeated, excluding local micro-bends and self-intersecting paths. For each candidate path, the length attributes of all river segments within the path are summed to obtain the total loop length. : in, This indicates the total number of river segments included in the path. Indicates the first The actual length of each river segment is in units consistent with spatial coordinate units; Extract the planar coordinates of the start and end nodes of the candidate path ( , )and( , ), calculate the Euclidean distance between two points. : Substitute into the formula to calculate the topological closure of the candidate circuit. : The topological closure degree D ranges from (0, 1). The closer the value is to 1, the higher the degree of closure of the path space and the closer the shape is to a complete ring-shaped water system. Based on the statistical counts of inflow and outflow segments, firstly, the angle between the flow direction vectors is calculated. First, match the topological closure of candidate loops corresponding to two river segments. If two river segments both belong to a natural loop-shaped drainage system with satisfactory topological closure, then the large angle between them represents a normal bend in the river. Secondly, for any two river segments sharing the same node, their flow direction vectors are extracted, and the angle between the flow directions of the two river segments is calculated. When the included angle When the angle is greater than 150° and the two river segments have the same flow direction at the common node, it is judged as a suspected convection anomaly; among them, for the two river segments at the common node, their flow direction vectors are calculated using the following formula. and The included angle : Based on the judgment results and the topological closure of the river loop, the topographic rationality of the convection area was verified by combining the DEM elevation, and the convection anomaly was confirmed.

4. The water system vector direction logic detection method according to claim 1, characterized in that, The determination of whether the intersection conforms to the acute angle intersection rule includes: At a fixed distance upstream of the aggregation node d Take sampling points at each location, and use the line connecting the sampling points and nodes as the flow direction vector; Let the aggregation node be J The flow direction vectors of the two inflow segments at the confluence node are: and The unit vector of the outflow section is The confluence angle of the two inflow sections for: When the intersection angle When the angle is ≥90°, it is considered an abnormal convergence angle; when the angle of convergence is ≥90°, it is considered an abnormal convergence angle. When the angle is less than 90°, use the following formula to calculate the acute angle rationality index to determine whether it conforms to the acute angle intersection rule: in, This represents the optimal convergence angle.

5. The water system vector direction logic detection method according to claim 1, characterized in that, The rules for classifying anomalies include: Level 1 anomalies are inverted flow direction, Level 2 anomalies are water system convection, and Level 3 anomalies are convergence angle anomalies.

6. A water system vector direction logic detection system, used to execute the water system vector direction logic detection method according to any one of claims 1-5, characterized in that, include: The data preprocessing module is used to acquire DEM raster data and vector data of the river system to be detected in the study area, perform spatial reference registration and topological preprocessing on the vector data of the river system to be detected, establish the river segment-node topological relationship, and perform projection transformation and resampling on the DEM raster data to make it consistent with the spatial reference of the vector data of the river system to be detected. The DEM flow direction verification module, based on the data preprocessing results, samples elevation points at fixed intervals along the water system vector line, extracts DEM elevation values, and calculates the river section elevation trend coefficient K based on the extracted DEM elevation values. The river section elevation trend coefficient K is used to determine whether the water system follows the natural law of flowing from high to low. The convection detection module is used to construct a directed topology map of the river system and identify river segments with abnormal convection by calculating the angle between the flow directions of adjacent river segments; The confluence angle calculation module is used to identify confluence nodes and calculate the confluence angle of the inflow segment. Determine whether it conforms to the acute angle intersection rule; The results output module is used to integrate the detection results from the DEM flow direction verification module to the convergence angle calculation module, classify anomalies, generate a detection report, and complete the logical detection of the water system vector direction.