Basin division method and device, electronic equipment and computer readable storage medium

By adopting an automated watershed delineation method based on digital elevation models and preset stations, the problems of complex operation and poor accuracy in hydrological sub-watershed delineation are solved. It achieves efficient and accurate output of river network topology, simplifies the operation steps for engineers, and improves the accuracy of hydrological calculations.

CN121982244AActive Publication Date: 2026-05-05ZHEJIANG YUANSUAN TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG YUANSUAN TECH CO LTD
Filing Date
2026-04-08
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing technologies involve complex and time-consuming procedures in hydrological sub-basin delineation, have poor software stability, and cannot automatically identify key hydrological topological nodes, resulting in poor delineation accuracy and the inability to directly output river network topology relationships, thus affecting work efficiency and accuracy.

Method used

Based on the digital elevation model and preset station locations, a preliminary watershed division layer is generated. The algorithm automatically identifies river confluences and topological nodes, generates a continuous river network, records river segment information, and outputs upstream and downstream relationships, simplifying operation steps and improving accuracy.

Benefits of technology

It achieves automated watershed delineation, reduces manual intervention, improves work efficiency, outputs clear river network topology, avoids subjective errors, and enhances the accuracy and reliability of hydrological calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121982244A_ABST
    Figure CN121982244A_ABST
Patent Text Reader

Abstract

The invention provides a drainage basin division method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: generating a preliminary drainage basin division layer which comprises a river line graph, a river sequence, a drainage basin total exit and a preset site based on a digital elevation model of a target drainage basin and the position of the preset site; generating a complete downstream water flow path of the preset station according to the river sequence, detecting a coincident path, and taking a starting point of the coincident path as an intersection point; the coincident paths are combined, and non-coincident paths are fused to generate a main river network vector graph layer; taking a preset site and the intersection as target points, and breaking the main river network line to generate a river reach; according to the starting target point, the ending target point, the actual space length and the river sequence of each river reach, the upstream and downstream relation between the target points and the actual space length are determined; and performing drainage basin division to obtain a sub-drainage basin vector division map layer containing the upstream and downstream relationship between the target points and the actual space length. Through the method, the working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of water conservancy engineering technology, and in particular to a watershed delineation method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Hydrological calculations are the core foundation for water conservancy project planning, design, and safety assessment. Their accuracy directly affects water resource allocation, flood control and drought relief, and the realization of project benefits. Sub-basin delineation, as a key preprocessing step in hydrological calculations, directly impacts the accuracy and reliability of the calculations themselves.

[0003] Currently, hydrological sub-basin delineation generally relies on specialized software such as GIS (Geographic Information System) or SWAT (Water Assessment Tool). GIS software requires a series of operations, including data projection, raster filling, flow direction extraction, river network generation, and sub-basin delineation, which are numerous, complex, and time-consuming. While SWAT software simplifies the process to some extent, it still requires steps such as projection, river network extraction, and station setup. Furthermore, SWAT software is prone to instability and crashes due to version compatibility issues, impacting work efficiency.

[0004] Furthermore, traditional sub-basin delineation methods are essentially mechanical divisions based on pre-defined station locations. These pre-defined station locations typically refer to control stations such as hydrological stations (used to monitor water levels and flow rates), reservoir dam sites (the location of reservoir dams), and important water intakes (such as areas in cities or farmlands that require water). Mechanical division means that it can only be performed based on given pre-defined station locations (i.e., control stations), and cannot automatically identify and extract key hydrological topological nodes within the basin (such as the confluence of two control stations along the downstream of a river). This results in poor accuracy of sub-basin delineation results.

[0005] Furthermore, the sub-basin division results obtained using traditional methods can only provide basic spatial relationships (i.e., they can only divide the area into blocks), and cannot directly output the complete river network topology (i.e., upstream and downstream relationships). This means that engineers need to identify the river network topology themselves when performing subsequent hydrological calculations, which not only affects work efficiency but also easily introduces subjective errors. Summary of the Invention

[0006] In view of this, the purpose of this application is to provide watershed delineation methods, apparatus, electronic devices and computer-readable storage media to simplify the operation steps of engineers and improve work efficiency and the accuracy of delineation results.

[0007] In a first aspect, embodiments of this application provide a watershed delineation method, including: Based on the digital elevation model of the target watershed and the locations of each preset station within the target watershed, a preliminary watershed division layer is generated. The preliminary watershed division layer includes line graphics reflecting the confluence information between rivers, the river order of each river, the total outlet of the watershed, and preset stations. The river order is determined based on the tributaries into which the rivers flow. For each of the preset stations, a complete downstream water flow path from the preset station to the total outlet of the basin is generated according to the river order of each river. Overlapping paths between the complete downstream water flow paths are detected, and the starting point of each overlapping path is taken as the intersection point. The overlapping paths in all the complete downstream water flow paths are merged, and the non-overlapping paths in the complete downstream water flow paths are integrated to generate a main river network vector map layer containing an integrated continuous main river network. Using the preset stations and the intersection points as target points, and the target points as geometric dividing points, the main river network is interrupted to generate multiple independent river segments, and the starting target point, ending target point and actual spatial length of each river segment are recorded. Based on the starting and ending target points, actual spatial lengths, and river order of each river segment, the upstream and downstream relationships and actual spatial lengths between the target points are determined. For each target point, the upstream catchment area of ​​the target point is determined based on the upstream target point and the actual spatial length between the upstream target point and the target point. The outline of an independent sub-basin with the target point as the watershed outlet is drawn to obtain a sub-basin vector division layer that includes the upstream and downstream relationships between target points and the actual spatial length between target points.

[0008] In conjunction with the first aspect, this application provides a first possible implementation of the first aspect, wherein generating a preliminary watershed delineation layer based on the digital elevation model of the target watershed and the locations of preset stations within the target watershed includes: The digital elevation model is converted to the 2000 geodetic projection coordinate system to obtain the projected digital elevation model. For each grid cell in the projected digital elevation model, the elevation gradient from the grid cell to its neighboring grid cells is calculated. The neighboring grid cell corresponding to the maximum elevation gradient is selected, and the water flow direction of the grid cell is determined based on the selected neighboring grid cells. Based on the water flow direction, upstream catchment area, and catchment area threshold of each grid, the grid type of each grid is determined to obtain each river in the target watershed; the grid type includes river grids and non-river grids. The order of each river is determined based on the tributaries it receives; the higher the river's order, the closer it is to its downstream region. Based on the water flow direction and grid type of each grid, and the river order of each river, a river vector map layer for the target watershed is determined; the river vector map layer contains line graphics that reflect the confluence information between the rivers and the river order of each river; Using a spatial adsorption algorithm, each preset station is matched to the river vector layer based on its location within the target watershed, and the matched location of each preset station is marked on a separate point layer. Based on the river vector layer and the point layer, a preliminary watershed division layer is generated, which includes line graphics of each river, river order, total outlet of the watershed, and preset stations.

[0009] In conjunction with the first possible implementation of the first aspect, this application provides a second possible implementation of the first aspect, wherein the step of converting the digital elevation model to the 2000 geodetic projection coordinate system to obtain the projected digital elevation model includes: Based on the boundary of the target watershed, determine the longitude of the center point of the target watershed; Based on the longitude of the center point, determine the longitude division zone in which it belongs; Based on the EPSG corresponding to each longitude division in the 2000 geodetic projection coordinate system, determine the EPSG corresponding to the longitude division where the center point is located, and use this EPSG as the target EPSG. The original EPSG contained in the digital elevation model is converted into the target EPSG to complete the projection coordinate system transformation of the digital elevation model, resulting in a digital elevation model under the EPSG in the 2000 geodetic projection coordinate system.

[0010] In conjunction with the first possible implementation of the first aspect, this application provides a third possible implementation of the first aspect, wherein, for each grid cell included in the projected digital elevation model, calculating the elevation gradient from the grid cell to its neighboring grid cells, selecting the neighboring grid cell corresponding to the maximum elevation gradient value, and determining the water flow direction of the grid cell based on the selected neighboring grid cells, includes: For each grid cell in the projected digital elevation model, the elevation gradient from that grid cell to its neighboring grid cells is calculated using the following formula:

[0011] in, Let (i,j) be the elevation of the grid cell. Let (i,j) be the elevation of the neighboring rasters of the grid (i,j). This represents the actual spatial distance from grid (i,j) to neighboring grids; Let (i,j) be the elevation gradient from the grid (i,j) to the neighboring grids; Select the neighborhood grid corresponding to the maximum elevation gradient as the target neighborhood grid of the grid; The direction in which the grid points to the target neighboring grid is determined as the water flow direction of the grid, and the water flow direction is encoded, and the encoded water flow direction is used as the final water flow direction of the grid.

[0012] In conjunction with the first possible implementation of the first aspect, this application provides a fourth possible implementation of the first aspect, wherein the step of matching each preset station to the river vector layer based on the location of each preset station within the target watershed using a spatial adsorption algorithm, and marking the matching location of each preset station on a separate point layer, includes: For each of the preset stations, the Euclidean distance between the preset station and each continuous point is calculated based on the latitude and longitude coordinates of the preset station and the latitude and longitude coordinates of each continuous point on each river in the river vector map layer. The preset site is snapped to the location of the consecutive points with the smallest Euclidean distance, and this location is marked as the matching location of the preset site on a separate point layer.

[0013] In conjunction with the first possible implementation of the first aspect, this application provides a fifth possible implementation of the first aspect, wherein generating a preliminary watershed division layer containing line graphics of each river, river order, total watershed outlet, and preset stations based on the river vector map layer and the point layer includes: Based on the river vector layer and the point layer, a first basin division layer is generated, which includes line graphics of each river, river order, total basin outlet, and preset stations. Using each preset station in the first watershed division layer as a dividing point, preliminary sub-watershed division is performed to obtain a second watershed division layer containing line graphics of each river, river order, total watershed outlet, preset stations, and the outline of each divided sub-watershed; each sub-watershed in the second watershed division layer corresponds to a preset station; Based on the outline shape features of each sub-basin in the second watershed division layer, the river corresponding to each sub-basin, the preset stations, and the river where each preset station is located, verify whether the positions of the preset stations contained in the second watershed division layer are correct. If the locations of the preset stations contained in the second watershed delineation layer are correct, then the second watershed delineation layer will be used as the preliminary watershed delineation layer. If the locations of the preset stations in the second watershed delineation layer are incorrect, the locations of each preset station within the target watershed are directly edited. Based on the edited locations of each preset station within the target watershed, the step of matching each preset station to the river vector layer using the spatial snapping algorithm is repeated. The matched locations of each preset station are then marked on a separate point layer and in subsequent steps. Alternatively, the locations of the preset stations in the second watershed delineation layer can be manually adjusted in the GIS interactive environment. The corrected locations of the preset stations are recorded. Based on the corrected locations of the preset stations, the step of matching each preset station to the river vector layer using the spatial snapping algorithm is repeated. The matched locations of each preset station are then marked on a separate point layer and in subsequent steps.

[0014] In conjunction with the first aspect, this application provides a sixth possible implementation of the first aspect, wherein detecting overlapping paths between the complete downstream flow paths, and using the starting point of each overlapping path as the intersection point, includes: Detect overlapping paths between the complete downstream water flow paths, and take the starting point of each overlapping path as the first intersection point; Collect all initial intersection points and perform geometric deduplication on the initial intersection points; The spatial location of the first intersection point after geometric deduplication is compared with the preset station. Points that overlap are retained as preset stations, and the first intersection points that do not overlap are used as the final intersection points.

[0015] Secondly, embodiments of this application also provide a watershed delineation device, comprising: The first generation module is used to generate a preliminary watershed division layer based on the digital elevation model of the target watershed and the locations of preset stations within the target watershed. The preliminary watershed division layer includes line graphics reflecting the confluence information between rivers, the river order of each river, the total outlet of the watershed, and preset stations. The river order is determined according to the tributaries into which the rivers flow. The second generation module is used to generate a complete downstream water flow path from the preset station to the total outlet of the basin for each preset station according to the river order of each river, and to detect overlapping paths between the complete downstream water flow paths so as to take the starting point of each overlapping path as the intersection point. The merging module is used to merge the overlapping paths in all the complete downstream water flow paths and merge the non-overlapping paths in the complete downstream water flow paths to generate a main river network vector map layer containing an integrated continuous main river network. The interruption module is used to interrupt the main river network by taking the preset station and the intersection point as target points and the target points as geometric dividing points, generating multiple independent river segments, and recording the starting target point, ending target point and actual spatial length of each river segment. The determination module is used to determine the upstream and downstream relationships and actual spatial lengths between the target points based on the starting target point, ending target point, actual spatial length, and river order of each river segment. The segmentation module is used to determine the upstream catchment area of ​​each target point based on the upstream target point and the actual spatial length between the target point and the upstream target point, and to delineate the outline of an independent sub-basin with the target point as the watershed outlet, so as to obtain a sub-basin vector segmentation layer that includes the upstream and downstream relationships between target points and the actual spatial length between target points.

[0016] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps in any of the possible implementations of the first aspect described above are performed.

[0017] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps in any of the possible implementations of the first aspect described above.

[0018] This application provides a watershed delineation method, apparatus, electronic device, and computer-readable storage medium. First, based on the digital elevation model of the target watershed and the locations of preset stations, a preliminary watershed delineation layer is generated. This preliminary watershed delineation layer already includes line graphics reflecting the confluence of rivers, the river order of each river, the total outlet of the watershed, and preset stations. This process is entirely automated through an algorithm, eliminating the need for engineers to perform a series of tedious operations in professional software such as GIS or SWAT. This simplifies the engineer's steps, avoids instability or crashes caused by compatibility issues with professional software versions, effectively saves processing time, and improves work efficiency.

[0019] Furthermore, this method generates a complete downstream flow path from each preset station to the total outlet of the basin based on the river order. By detecting overlapping paths among all complete downstream flow paths, the starting point of each overlapping path is extracted as a confluence point. This process overcomes the limitations of traditional methods that mechanically segment based solely on the location of preset stations, automatically identifying and extracting key hydrological topological nodes (i.e., confluence points) within the basin. This avoids the problem of needing to manually determine the station evolution relationships in subsequent hydrological calculations due to the inability to automatically identify these confluence points.

[0020] Subsequently, this method merges overlapping paths in all complete downstream flow paths and integrates non-overlapping paths to generate a main river network vector layer containing a unified, continuous main river network. Based on this, preset stations and confluence points are used as target points, and these target points are used as geometric dividing points to break the main river network, generating multiple independent river segments. Simultaneously, the starting and ending target points and actual spatial length of each river segment are recorded. Thus, this method not only forms a physically continuous and simplified river network structure, but also directly outputs the complete river network topology by determining the upstream and downstream relationships and actual spatial lengths between target points, providing a clear and computable basic geographic framework for subsequent hydrological calculations.

[0021] Finally, for each target point, this method determines its upstream catchment area based on the upstream target point and the actual spatial length between them, and delineates the outline of an independent sub-basin with the target point as the watershed outlet. This results in a sub-basin vector partitioning layer that includes the upstream-downstream relationships and actual spatial lengths between target points. This sub-basin vector partitioning layer maps each sub-basin to its watershed outlet (i.e., the target point) and embeds the upstream-downstream relationships and actual spatial lengths between target points. This eliminates the need for engineers to manually identify river network topology or supplement river segment lengths during subsequent hydrological calculations. They can directly perform runoff generation and confluence calculations, parameter calibration, and scenario simulations based on the attributes of the sub-basin vector partitioning layer output by this method (upstream-downstream relationships and actual spatial lengths between target points), greatly improving work efficiency and avoiding subjective errors that may be introduced by manual identification.

[0022] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart of a watershed delineation method provided in an embodiment of this application is shown; Figure 2 This illustration shows a schematic diagram of a preliminary watershed delineation layer provided in an embodiment of this application; Figure 3 A schematic diagram of a second watershed division layer provided in an embodiment of this application is shown; Figure 4 A schematic diagram of a complete downstream water flow path provided in an embodiment of this application is shown; Figure 5 This illustration shows a schematic diagram of an intersection point provided in an embodiment of this application; Figure 6 A schematic diagram of a main river network provided in an embodiment of this application is shown; Figure 7 This paper shows a schematic diagram of the structure of a watershed division device provided in an embodiment of this application; Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0026] Hydrological calculations are the core foundation for water conservancy project planning, design, and safety assessment. Their accuracy directly affects water resource allocation, flood control and drought relief, and the realization of project benefits. Sub-basin delineation, as a key preprocessing step in hydrological calculations, directly impacts the accuracy and reliability of the calculations themselves.

[0027] Currently, hydrological sub-basin delineation generally relies on specialized software such as GIS or SWAT. GIS software requires a series of operations, including data projection, raster filling, flow direction extraction, river network generation, and sub-basin delineation, which are numerous (i.e., complex) and time-consuming. While SWAT software simplifies the process to some extent, it still requires steps such as projection, river network extraction, and station setup. Furthermore, due to version compatibility issues, SWAT software is prone to instability and even crashes, impacting work efficiency.

[0028] Furthermore, traditional sub-basin delineation methods are essentially mechanical divisions based on pre-defined station locations. These pre-defined station locations typically refer to control stations such as hydrological stations (used to monitor water levels and flow rates), reservoir dam sites (the location of reservoir dams), and important water intakes (such as areas in cities or farmlands that require water). Mechanical division means that it can only be performed based on given pre-defined station locations (i.e., control stations), and cannot automatically identify and extract key hydrological topological nodes within the basin (such as the confluence of two control stations along the downstream of a river). This results in poor accuracy of sub-basin delineation results.

[0029] Furthermore, the sub-basin division results obtained using traditional methods can only provide basic spatial relationships (i.e., they can only divide the area into blocks), and cannot directly output the complete river network topology (i.e., upstream and downstream relationships). This means that engineers need to identify the river network topology themselves when performing subsequent hydrological calculations, which not only affects work efficiency but also easily introduces subjective errors.

[0030] Based on this, embodiments of this application provide a watershed delineation method, apparatus, electronic device, and computer-readable storage medium, which are described below through embodiments.

[0031] To facilitate understanding of this embodiment, a watershed delineation method disclosed in this application will first be described in detail. For example... Figure 1 As shown, the process includes the following steps S101-S106: S101: Based on the digital elevation model of the target watershed and the location of each preset station within the target watershed, a preliminary watershed division layer is generated; the preliminary watershed division layer contains line graphics that reflect the confluence information between rivers, the river order of each river, the total outlet of the watershed, and preset stations; the river order is determined according to the tributaries into which the rivers flow.

[0032] In this step, the target watershed is the watershed to be delineated. A Digital Elevation Model (DEM) is a dataset that digitally describes the terrain undulations of the target watershed; DEMs are typically stored in raster format. Each raster stores a numerical value representing the average elevation of the real ground area it covers.

[0033] In this step, the digital elevation model supports input of multiple coordinate systems, including the WGS84 geographic coordinate system, the Gauss-Kruger projection coordinate system, the China 2000 geodetic coordinate system and its corresponding projection coordinate system. The location of the preset station is provided in a CSV file, which should contain three columns of data: the station name, longitude and latitude. The coordinate format is compatible with latitude and longitude coordinates in degrees under the WGS84 geographic coordinate system or plane coordinates in meters under the corresponding projection coordinate system.

[0034] The pre-defined sites include hydrological stations, reservoir dam sites, and / or key water intakes. Hydrological stations are used to monitor water levels and flow rates; reservoir dam sites refer to the location of the reservoir dam; and key water intakes refer to locations in cities or farmlands where water is needed.

[0035] In terms of river order, generally speaking, the upstream rivers receive fewer tributaries, while the downstream rivers receive more tributaries. Therefore, river order can actually reflect whether a river is an upstream or downstream river.

[0036] In one possible implementation, when performing step S101, the following steps S1011-S1017 can be specifically performed: S1011: Convert the digital elevation model to the 2000 geodetic projection coordinate system to obtain the projected digital elevation model.

[0037] In this step, the 2000 geodetic projection coordinate system refers to the China 2000 geodetic projection coordinate system. The digital elevation model is transformed to the 2000 geodetic projection coordinate system to obtain the digital elevation model in the 2000 geodetic projection coordinate system (i.e., the projected digital elevation model).

[0038] In one possible implementation, when performing step S1011, the specific steps S10111-S10114 can be performed as follows: S10111: Determine the longitude of the center point of the target watershed based on the boundary of the target watershed.

[0039] In this step, the boundary of the target watershed refers to the easternmost, southernmost, westernmost, and northernmost boundaries of the target watershed.

[0040] S10112: Determine the longitude zone of the center point based on its longitude.

[0041] S10113: Based on the EPSG corresponding to each longitude division in the 2000 geodetic projection coordinate system, determine the EPSG corresponding to the longitude division where the center point is located, and use this EPSG as the target EPSG.

[0042] In this step, each longitude division in the 2000 geodetic projection coordinate system corresponds to an EPSG (EPSG geographic code). Based on the longitude division where the center point is located, the EPSG corresponding to the longitude division where the center point is located in the 2000 geodetic projection coordinate system is determined, and the determined EPSG is used as the target EPSG.

[0043] S10114: Convert the original EPSG contained in the digital elevation model into the target EPSG to complete the projection coordinate system transformation of the digital elevation model and obtain the digital elevation model under the EPSG in the 2000 geodetic projection coordinate system.

[0044] In this step, the digital elevation model contains an original EPSG. The original EPSG contained in the digital elevation model is converted into a target EPSG, thereby completing the projection coordinate system transformation of the digital elevation model and obtaining a digital elevation model under the EPSG in the 2000 geodetic projection coordinate system.

[0045] S1012: For each grid cell in the projected digital elevation model, calculate the elevation gradient from the grid cell to its neighboring grid cells, select the neighboring grid cell corresponding to the maximum elevation gradient value, and determine the water flow direction of the grid cell based on the selected neighboring grid cell.

[0046] In this step, each grid cell in the digital elevation model stores a value representing the average elevation of the real ground area it covers. The purpose of this step is to determine, for each grid cell in the digital elevation model, which of its neighboring grid cells the rainwater will flow into.

[0047] The greater the elevation gradient from a grid to its neighboring grids, the greater the height difference between the grid and its neighboring grids, and the steeper the slope. Based on the principle that water flows downhill, the neighboring grid corresponding to the maximum elevation gradient is selected to determine the water flow direction of that grid.

[0048] In one possible implementation, when performing step S1012, the following steps S10121-S10123 can be specifically performed: S10121: For each grid cell in the projected digital elevation model, calculate the elevation gradient from that grid cell to its neighboring grid cells using the following formula:

[0049] in, The elevation of grid (i,j) is the average elevation of the ground area covered by grid (i,j). Let (i,j) be the elevation of the neighboring rasters of raster (i,j) (i.e., the average elevation of the ground area covered by the neighboring rasters). This represents the actual spatial distance (i.e., the actual distance on the ground) from grid (i,j) to neighboring grids. is the elevation gradient from grid (i,j) to neighboring grids.

[0050] S10122: Select the neighborhood raster corresponding to the maximum elevation gradient as the target neighborhood raster of this raster.

[0051] In this embodiment, most grids have eight neighboring grids, while grids located at the edges have fewer than eight neighboring grids. Each neighboring grid of a grid corresponds to an elevation gradient, and the neighboring grid corresponding to the maximum elevation gradient is actually the neighboring grid to which rainwater will flow.

[0052] S10123: Determine the direction of the grid pointing to the target neighboring grid as the water flow direction of the grid, encode the water flow direction, and use the encoded water flow direction as the final water flow direction of the grid.

[0053] In this step, the D8 flow direction encoding method can be used to encode the water flow direction. Specifically, the water flow direction is encoded using the following formula:

[0054] D8 flow encoding for raster (i,j).

[0055] S1013: Determine the grid type of each grid based on the water flow direction, upstream catchment area, and catchment area threshold of each grid to obtain the rivers in the target watershed; the grid type includes river grids and non-river grids.

[0056] In this step, the raster type of each grid cell is determined using the following formula:

[0057] in, Let (i,j) be the upstream catchment area of ​​grid (i,j) (i.e., the number of grids to which water flows). This indicates the preset water catchment area threshold; is the binary river mask value for the raster (i,j), where 1 represents a river raster and 0 represents a non-river raster.

[0058] S1014: Determine the river order of each river based on the tributaries into which each river flows; the higher the river order, the closer the river is to its downstream.

[0059] This embodiment presents two methods for determining the river order, which will be explained below.

[0060] The first method is the Strahler method: For each river, if the river has no tributaries flowing into it, then the river order is first-order river; if the river has at least two tributaries with the same order flowing into it, then the river order is the order of its tributaries plus 1; if the river has at least two tributaries with different orders flowing into it, then the highest order of its tributaries is taken as the river order of the river.

[0061] The second method is Classic (Horton): For each river, if the river has no tributaries flowing into it, then the river order is a first-order river; if the river has tributaries flowing directly into it, then the river order is the sum of the river orders of all the tributaries that flow directly into it.

[0062] S1015: Based on the water flow direction and grid type of each grid, and the river order of each river, determine the river vector layer of the target watershed; the river vector layer contains line graphics that reflect the confluence information between the rivers and the river order of each river.

[0063] In this step, the river order is not displayed on the river vector layer, but is recorded (carried) as information within the river vector layer.

[0064] S1016: Using a spatial adsorption algorithm, based on the location of each preset station within the target watershed, each preset station is matched onto the river vector layer, and the matched location of each preset station is marked on a separate point layer.

[0065] In this embodiment, the river vector layer and the point layer are two independent layers.

[0066] In one possible implementation, when performing step S1016, the specific steps S10161-S10162 can be performed as follows: S10161: For each preset station, calculate the Euclidean distance between the preset station and each continuous point based on the latitude and longitude coordinates of the preset station and the latitude and longitude coordinates of each continuous point on each river in the river vector layer.

[0067] S10162: Snap the preset site to the location of the consecutive points with the smallest Euclidean distance, and mark that location as the matching location of the preset site on a separate point layer.

[0068] In this embodiment, the Euclidean distance between the preset station and each consecutive point is calculated using the following formula:

[0069] in, Indicates the latitude and longitude coordinates of the preset station; Represents the latitude and longitude coordinates of continuous points.

[0070] S1017: Based on the river vector layer and point layer, generate a preliminary watershed division layer containing line graphics of each river, river order, total outlet of the watershed, and preset stations.

[0071] like Figure 2 As shown, a schematic diagram of the preliminary watershed delineation layer is displayed, in which line graphs of each river are shown. Figure 2 (lines in the middle), total outlet of the basin ( Figure 2 The black triangle in the middle), preset site ( Figure 2 (The black dots in the middle).

[0072] In one possible implementation, when performing step S1017, the specific steps S10171-S10175 can be performed as follows: S10171: Based on the river vector layer and point layer, generate a first basin division layer containing line graphics of each river, river order, total basin outlet, and preset stations.

[0073] S10172: Using each preset station in the first watershed division layer as a dividing point, perform preliminary sub-watershed division to obtain a second watershed division layer containing the line graphics of each river, the river order, the total outlet of the watershed, the preset stations, and the outline of each sub-watershed; each sub-watershed in the second watershed division layer corresponds to a preset station.

[0074] like Figure 3 As shown, a schematic diagram of the second watershed delineation layer is presented, which includes the outlines of each sub-watershed. Figure 3 (The dashed line in the middle).

[0075] S10173: Based on the outline shape features of each sub-basin in the second watershed division layer, the river corresponding to each sub-basin, the preset stations, and the river where each preset station is located, verify whether the positions of the preset stations contained in the second watershed division layer are correct.

[0076] In this embodiment, when there is a deviation in the location of the preset station, the geometric shape of the corresponding sub-basin outline usually exhibits atypical hydrological characteristics, specifically manifested as an abnormally small basin area, irregular outline, or obvious spatial relationship with the main river network.

[0077] Meanwhile, the river where each preset station is located is known information. Using this information and the outline shape features of the sub-basin, the location of each preset station in the second basin division layer can be verified to be correct.

[0078] S10174: If the locations of the preset stations contained in the second watershed delineation layer are correct, then the second watershed delineation layer shall be used as the preliminary watershed delineation layer.

[0079] S10175: If the positions of the preset stations contained in the second watershed delineation layer are incorrect, directly edit the positions of each preset station within the target watershed. Based on the edited positions of each preset station within the target watershed, re-execute the step of matching each preset station to the river vector layer using the spatial snapping algorithm, and mark the matching positions of each preset station on a separate point layer and in subsequent steps. Alternatively, manually adjust the positions of the preset stations in the second watershed delineation layer in the GIS interactive environment, record the corrected positions of the preset stations, and re-execute the step of matching each preset station to the river vector layer using the spatial snapping algorithm, and mark the matching positions of each preset station on a separate point layer and in subsequent steps.

[0080] In this embodiment, for a preset station whose location is incorrectly identified, it can be corrected by any one of the following two methods; The first correction method is to directly edit the location of each preset station stored in the CSV format file, and re-execute step S1016 and subsequent steps based on the edited location of each preset station in the target watershed.

[0081] The second correction method is to manually adjust the position of the preset stations in the second watershed division layer in the GIS interactive environment, and record the corrected position of the preset stations in a CSV file. Then, based on the position of each preset station in the target watershed after editing, step S1016 and subsequent steps are re-executed.

[0082] S102: For each preset station, generate a complete downstream water flow path from the preset station to the total outlet of the basin according to the river order of each river, detect overlapping paths between complete downstream water flow paths, and take the starting point of each overlapping path as the intersection point.

[0083] In this step, such as Figure 4As shown, taking one of the preset stations as an example, the complete downstream water flow path of that preset station is illustrated. Figure 4 (Green line).

[0084] After obtaining the complete downstream flow path for each preset station, pairwise spatial intersection analysis is performed on all complete downstream flow paths to detect overlapping paths, with the starting point of each overlapping path serving as the intersection point. For example... Figure 5 As shown, the intersection point is illustrated. Figure 5 A schematic diagram of the white circle in the image.

[0085] In one possible implementation, when performing step S102 to detect overlapping paths between complete downstream water flow paths and to take the starting point of each overlapping path as the intersection point, the specific steps S1021-S1023 can be performed as follows: S1021: Detect overlapping paths between complete downstream flow paths, and use the starting point of each overlapping path as the first intersection point.

[0086] S1022: Collect all first intersection points and perform geometric deduplication on the first intersection points.

[0087] S1023: Compare the spatial location of the first intersection point after geometric deduplication with the preset station. Points that overlap are retained as preset stations, and the first intersection points that do not overlap are used as the final intersection points.

[0088] S103: Merge overlapping paths in all complete downstream flow paths and integrate non-overlapping paths in the complete downstream flow paths to generate a main river network vector map layer containing an integrated continuous main river network.

[0089] In this embodiment, each preset station corresponds to a complete downstream water flow path. Therefore, there will be overlapping paths between different complete downstream water flow paths. If this overlapping path is a shared path of three complete downstream water flow paths, then there are actually three lines at that overlapping path. In this embodiment, the overlapping paths of multiple complete downstream water flow paths are merged, so that the overlapping path is represented by only one line. Simultaneously, the non-overlapping paths (i.e., paths in the complete downstream water flow path other than the overlapping paths) are merged with the merged overlapping paths to obtain an integrated, continuous main river network, and thus a main river network vector map layer.

[0090] like Figure 6As shown, a schematic diagram of the main river network is presented. This operation connects multiple independent non-overlapping and overlapping paths into a continuous and complete main river network, eliminating internal pseudo-nodes caused by segmented tracking and forming physically continuous water flow transmission paths. The merged main river network achieves key structural simplification, retaining only the main flow channels connecting each upstream preset station to its downstream preset station or confluence point, and automatically eliminating lateral diversion channels unrelated to the main confluence process. Compared with the original detailed preliminary watershed delineation layer, the main river network vector map layer generated in this step significantly simplifies network complexity while maintaining hydraulic connectivity between key nodes (i.e., preset stations and confluence points), forming a clear river chain topology structure specifically for hydrological evolution calculations.

[0091] S104: Using preset stations and intersections as target points and target points as geometric dividing points, the main river network is interrupted to generate multiple independent river segments, and the starting target point, ending target point and actual spatial length of each river segment are recorded.

[0092] In this step, the continuous main river network is divided at each target point, creating a series of independent river segments. Each river segment has two target points as its starting and ending points (starting and ending target points), forming a complete computational river chain. The actual spatial length of each river segment is accurately calculated and recorded as a key attribute, directly representing the river transport distance between upstream and downstream target points.

[0093] S105: Determine the upstream and downstream relationships and actual spatial lengths between target points based on the starting and ending target points, actual spatial lengths, and river order of each river segment.

[0094] In this step, the upstream and downstream target points of each target point are determined based on the starting and ending target points of each river segment and the river order of each river. The actual spatial length between target points is then determined based on the starting and ending target points of each river segment and the actual spatial length.

[0095] This step yields the complete river network topology (the upstream and downstream relationships between target points and their actual spatial length).

[0096] S106: For each target point, determine the upstream catchment area of ​​the target point based on the upstream target point and the actual spatial length between the upstream target point, and draw the outline of an independent sub-basin with the target point as the watershed outlet, so as to obtain a sub-basin vector division layer that includes the upstream and downstream relationship between target points and the actual spatial length between target points.

[0097] In this step, the upstream target point is determined based on the upstream and downstream relationship between target points.

[0098] Based on the target points, a secondary division based on hydrological boundaries is performed on the target watershed area to generate a sub-watershed vector division layer with clear river network topology (upstream and downstream relationships between target points and actual spatial length).

[0099] The watershed delineation process uses each target point as a control section for the watershed outlet. Topographic analysis determines the upstream catchment area of ​​each target point, automatically outlining the contours of independent sub-watersheds with that target point as the watershed outlet. Each sub-watershed is named after its outlet target point; this name can be a preset station name or a combination of confluence point names, thus directly embedding its upstream and downstream position within the overall river network topology into the sub-watershed attributes. Simultaneously, the polygon area of ​​each sub-watershed is automatically calculated and stored as a core hydrological parameter. The newly generated sub-watershed vector delineation layer, together with the target points, constitutes a complete and simplified watershed hydrological calculation unit system. This system significantly optimizes the construction process of distributed hydrological models, providing an efficient and reliable spatial data foundation for subsequent runoff calculations, parameter calibration, and scenario simulations.

[0100] Based on the same technical concept, embodiments of this application also provide a watershed delineation device, such as... Figure 7 As shown, it includes: The first generation module 701 is used to generate a preliminary watershed division layer based on the digital elevation model of the target watershed and the locations of preset stations within the target watershed. The preliminary watershed division layer includes line graphics reflecting the confluence information between rivers, the river order of each river, the total outlet of the watershed, and preset stations. The river order is determined according to the tributaries into which the rivers flow. The second generation module 702 is used to generate a complete downstream water flow path from the preset station to the total outlet of the basin for each preset station according to the river order of each river, and to detect overlapping paths between the complete downstream water flow paths so as to take the starting point of each overlapping path as the intersection point. The merging module 703 is used to merge the overlapping paths in all the complete downstream water flow paths and merge the non-overlapping paths in the complete downstream water flow paths to generate a main river network vector map layer containing an integrated continuous main river network. The interruption module 704 is used to interrupt the main river network by taking the preset station and the intersection point as target points and the target points as geometric dividing points, generating multiple independent river segments, and recording the starting target point, ending target point and actual spatial length of each river segment. The determination module 705 is used to determine the upstream and downstream relationship and actual spatial length between the target points based on the starting target point, ending target point, actual spatial length, and river order of each river segment. The segmentation module 706 is used to determine the upstream water catchment area of ​​each target point based on the upstream target point and the actual spatial length between the target point and the upstream target point, and to draw the outline of an independent sub-basin with the target point as the watershed outlet, so as to obtain a sub-basin vector segmentation layer that includes the upstream and downstream relationship between target points and the actual spatial length between target points.

[0101] Optionally, when the first generation module 701 generates a preliminary watershed division layer based on the digital elevation model of the target watershed and the locations of preset stations within the target watershed, it is specifically used for: The digital elevation model is converted to the 2000 geodetic projection coordinate system to obtain the projected digital elevation model. For each grid cell in the projected digital elevation model, the elevation gradient from the grid cell to its neighboring grid cells is calculated. The neighboring grid cell corresponding to the maximum elevation gradient is selected, and the water flow direction of the grid cell is determined based on the selected neighboring grid cells. Based on the water flow direction, upstream catchment area, and catchment area threshold of each grid, the grid type of each grid is determined to obtain each river in the target watershed; the grid type includes river grids and non-river grids. The order of each river is determined based on the tributaries it receives; the higher the river's order, the closer it is to its downstream region. Based on the water flow direction and grid type of each grid, and the river order of each river, a river vector map layer for the target watershed is determined; the river vector map layer contains line graphics that reflect the confluence information between the rivers, the river order of each river, and the total outlet of the watershed; Using a spatial adsorption algorithm, each preset station is matched to the river vector layer based on its location within the target watershed, and the matched location of each preset station is marked on a separate point layer. Based on the river vector layer and the point layer, a preliminary watershed division layer is generated, which includes line graphics of each river, river order, total outlet of the watershed, and preset stations.

[0102] Optionally, when the first generation module 701 converts the digital elevation model to the 2000 geodetic projection coordinate system to obtain the projected digital elevation model, it is specifically used for: Based on the boundary of the target watershed, determine the longitude of the center point of the target watershed; Based on the longitude of the center point, determine the longitude division zone in which it belongs; Based on the EPSG corresponding to each longitude division in the 2000 geodetic projection coordinate system, determine the EPSG corresponding to the longitude division where the center point is located, and use this EPSG as the target EPSG. The original EPSG contained in the digital elevation model is converted into the target EPSG to complete the projection coordinate system transformation of the digital elevation model, resulting in a digital elevation model under the EPSG in the 2000 geodetic projection coordinate system.

[0103] Optionally, when the first generation module 701 calculates the elevation gradient from the grid to its neighboring grids for each grid included in the projected digital elevation model, selects the neighboring grid corresponding to the maximum elevation gradient, and determines the water flow direction of the grid based on the selected neighboring grids, it is specifically used for: For each grid cell in the projected digital elevation model, the elevation gradient from that grid cell to its neighboring grid cells is calculated using the following formula:

[0104] in, Let (i,j) be the elevation of the grid cell. Let (i,j) be the elevation of the neighboring rasters of the grid (i,j). This represents the actual spatial distance from grid (i,j) to neighboring grids; Let (i,j) be the elevation gradient from the grid (i,j) to the neighboring grids; Select the neighborhood grid corresponding to the maximum elevation gradient as the target neighborhood grid of the grid; The direction in which the grid points to the target neighboring grid is determined as the water flow direction of the grid, and the water flow direction is encoded, and the encoded water flow direction is used as the final water flow direction of the grid.

[0105] Optionally, when the first generation module 701 is used to match each preset station to the river vector layer according to the location of each preset station within the target watershed using a spatial adsorption algorithm, and to mark the matching position of each preset station on a separate point layer, it is specifically used for: For each of the preset stations, the Euclidean distance between the preset station and each continuous point is calculated based on the latitude and longitude coordinates of the preset station and the latitude and longitude coordinates of each continuous point on each river in the river vector map layer. The preset site is snapped to the location of the consecutive points with the smallest Euclidean distance, and this location is marked as the matching location of the preset site on a separate point layer.

[0106] Optionally, when the first generation module 701 generates a preliminary watershed division layer containing line graphics of each river, river order, total outlet of the watershed, and preset stations based on the river vector layer and the point layer, it is specifically used for: Based on the river vector layer and the point layer, a first basin division layer is generated, which includes line graphics of each river, river order, total basin outlet, and preset stations. Using each preset station in the first watershed division layer as a dividing point, preliminary sub-watershed division is performed to obtain a second watershed division layer containing line graphics of each river, river order, total watershed outlet, preset stations, and the outline of each divided sub-watershed; each sub-watershed in the second watershed division layer corresponds to a preset station; Based on the outline shape features of each sub-basin in the second watershed division layer, the river corresponding to each sub-basin, the preset stations, and the river where each preset station is located, verify whether the positions of the preset stations contained in the second watershed division layer are correct. If the locations of the preset stations contained in the second watershed delineation layer are correct, then the second watershed delineation layer will be used as the preliminary watershed delineation layer. If the locations of the preset stations in the second watershed delineation layer are incorrect, the locations of each preset station within the target watershed are directly edited. Based on the edited locations of each preset station within the target watershed, the step of matching each preset station to the river vector layer using the spatial snapping algorithm is repeated. The matched locations of each preset station are then marked on a separate point layer and in subsequent steps. Alternatively, the locations of the preset stations in the second watershed delineation layer can be manually adjusted in the GIS interactive environment. The corrected locations of the preset stations are recorded. Based on the corrected locations of the preset stations, the step of matching each preset station to the river vector layer using the spatial snapping algorithm is repeated. The matched locations of each preset station are then marked on a separate point layer and in subsequent steps.

[0107] Optionally, when the second generation module 702 detects overlapping paths between the complete downstream water flow paths and uses the starting point of each overlapping path as the intersection point, it is specifically used for: Detect overlapping paths between the complete downstream water flow paths, and take the starting point of each overlapping path as the first intersection point; Collect all initial intersection points and perform geometric deduplication on the initial intersection points; The spatial location of the first intersection point after geometric deduplication is compared with the preset station. Points that overlap are retained as preset stations, and the first intersection points that do not overlap are used as the final intersection points.

[0108] Figure 8 A schematic diagram of an electronic device provided in this application embodiment includes: a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs the above-described information processing method, the processor 801 communicates with the memory 802 through the bus 803. The processor 801 executes the machine-readable instructions to perform the steps of the method described in Embodiment 1.

[0109] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps described in Embodiment 1.

[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, electronic devices, and computer-readable storage media described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, electronic devices, and computer-readable storage media can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or modules may be electrical, mechanical, or other forms.

[0112] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0114] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0115] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A method for watershed delineation, characterized in that, include: Based on the digital elevation model of the target watershed and the locations of preset stations, a preliminary watershed delineation layer is generated; The preliminary watershed delineation layer includes line graphics reflecting the confluence information between rivers, river order, total watershed outlet, and preset stations; The order of the rivers is determined by the tributaries into which they flow; For each of the preset stations, a complete downstream water flow path from the preset station to the total outlet of the basin is generated according to the river order of each river. Overlapping paths between the complete downstream water flow paths are detected, and the starting point of each overlapping path is taken as the intersection point. The overlapping paths in all the complete downstream flow paths are merged, and the non-overlapping paths are merged to generate a main river network vector map layer containing continuous main river network lines. Using the preset stations and the intersection points as target points, the main river network is interrupted by using the target points as geometric dividing points to generate multiple independent river segments, and the starting target point, ending target point and actual spatial length of each river segment are recorded. Based on the starting and ending target points, actual spatial lengths, and river order of each river segment, the upstream and downstream relationships and actual spatial lengths between the target points are determined. For each target point, the upstream catchment area of ​​the target point is determined based on the upstream target point and the actual spatial length between the upstream target point and the target point. The outline of an independent sub-basin with the target point as the watershed outlet is drawn, resulting in a sub-basin vector division layer that includes the upstream and downstream relationships between target points and the actual spatial length.

2. The method according to claim 1, characterized in that, Based on the digital elevation model of the target watershed and the locations of preset stations, a preliminary watershed delineation layer is generated, including: The digital elevation model is converted to the 2000 geodetic projection coordinate system to obtain the projected digital elevation model. For each grid cell in the projected digital elevation model, the elevation gradient from the grid cell to its neighboring grid cells is calculated. The neighboring grid cell corresponding to the maximum elevation gradient is selected, and the water flow direction of the grid cell is determined based on the selected neighboring grid cells. Based on the water flow direction, upstream catchment area, and catchment area threshold of each grid, the grid type of each grid is determined to obtain each river in the target watershed; the grid type includes river grids and non-river grids. The order of each river is determined based on the tributaries it receives; the higher the river's order, the closer it is to its downstream region. Based on the water flow direction and grid type of each grid, and the river order of each river, a river vector map layer for the target watershed is determined; the river vector map layer contains line graphics that reflect the confluence information between the rivers and the river order of each river; Using a spatial adsorption algorithm, each preset station is matched to the river vector layer based on its location within the target watershed, and the matched location of each preset station is marked on a separate point layer. Based on the river vector layer and the point layer, a preliminary watershed division layer is generated, which includes line graphics of each river, river order, total outlet of the watershed, and preset stations.

3. The method according to claim 2, characterized in that, The step of converting the digital elevation model to the 2000 geodetic projection coordinate system to obtain the projected digital elevation model includes: Based on the boundary of the target watershed, determine the longitude of the center point of the target watershed; Based on the longitude of the center point, determine the longitude division zone in which it belongs; Based on the EPSG corresponding to each longitude division in the 2000 geodetic projection coordinate system, determine the EPSG corresponding to the longitude division where the center point is located, and use this EPSG as the target EPSG. The original EPSG contained in the digital elevation model is converted into the target EPSG to complete the projection coordinate system transformation of the digital elevation model, resulting in a digital elevation model under the EPSG in the 2000 geodetic projection coordinate system.

4. The method according to claim 2, characterized in that, For each grid cell in the projected digital elevation model, the elevation gradient from that grid cell to its neighboring grid cells is calculated. The neighboring grid cell corresponding to the maximum elevation gradient is selected, and the water flow direction of that grid cell is determined based on the selected neighboring grid cells. This includes: For each grid cell in the projected digital elevation model, the elevation gradient from that grid cell to its neighboring grid cells is calculated using the following formula: in, Let (i,j) be the elevation of the grid cell. Let (i,j) be the elevation of the neighboring rasters of the grid (i,j). This represents the actual spatial distance from grid (i,j) to neighboring grids; Let (i,j) be the elevation gradient from the grid (i,j) to the neighboring grids; Select the neighborhood grid corresponding to the maximum elevation gradient as the target neighborhood grid of the grid; The direction in which the grid points to the target neighboring grid is determined as the water flow direction of the grid, and the water flow direction is encoded, and the encoded water flow direction is used as the final water flow direction of the grid.

5. The method according to claim 2, characterized in that, The step of using a spatial adsorption algorithm to match each preset station to the river vector layer based on the location of each preset station within the target watershed, and marking the matching location of each preset station on a separate point layer, includes: For each of the preset stations, the Euclidean distance between the preset station and each continuous point is calculated based on the latitude and longitude coordinates of the preset station and the latitude and longitude coordinates of each continuous point on each river in the river vector map layer. The preset site is snapped to the location of the consecutive points with the smallest Euclidean distance, and this location is marked as the matching location of the preset site on a separate point layer.

6. The method according to claim 2, characterized in that, The process of generating a preliminary watershed division layer based on the river vector map layer and the point layer, including line graphics of each river, river order, total watershed outlet, and preset stations, includes: Based on the river vector layer and the point layer, a first basin division layer is generated, which includes line graphics of each river, river order, total basin outlet, and preset stations. Using each preset station in the first watershed division layer as a dividing point, preliminary sub-watershed division is performed to obtain a second watershed division layer containing line graphics of each river, river order, total watershed outlet, preset stations, and the outline of each divided sub-watershed; each sub-watershed in the second watershed division layer corresponds to a preset station; Based on the outline shape features of each sub-basin in the second watershed division layer, the river corresponding to each sub-basin, the preset stations, and the river where each preset station is located, verify whether the positions of the preset stations contained in the second watershed division layer are correct. If the locations of the preset stations contained in the second watershed delineation layer are correct, then the second watershed delineation layer will be used as the preliminary watershed delineation layer. If the locations of the preset stations in the second watershed delineation layer are incorrect, the locations of each preset station within the target watershed are directly edited. Based on the edited locations of each preset station within the target watershed, the step of matching each preset station to the river vector layer using the spatial snapping algorithm is repeated. The matched locations of each preset station are then marked on a separate point layer and in subsequent steps. Alternatively, the locations of the preset stations in the second watershed delineation layer can be manually adjusted in the GIS interactive environment. The corrected locations of the preset stations are recorded. Based on the corrected locations of the preset stations, the step of matching each preset station to the river vector layer using the spatial snapping algorithm is repeated. The matched locations of each preset station are then marked on a separate point layer and in subsequent steps.

7. The method according to claim 1, characterized in that, The detection of overlapping paths between the complete downstream water flow paths, taking the starting point of each overlapping path as the intersection point, includes: Detect overlapping paths between the complete downstream water flow paths, and take the starting point of each overlapping path as the first intersection point; Collect all initial intersection points and perform geometric deduplication on the initial intersection points; The spatial location of the first intersection point after geometric deduplication is compared with the preset station. Points that overlap are retained as preset stations, and the first intersection points that do not overlap are used as the final intersection points.

8. A watershed delineation device, characterized in that, include: The first generation module is used to generate a preliminary watershed division layer based on the digital elevation model of the target watershed and the location of preset stations. The preliminary watershed delineation layer includes line graphics reflecting the confluence of rivers, river order, total watershed outlet, and preset stations; the river order is determined based on the tributaries into which the rivers flow. The second generation module is used to generate a complete downstream water flow path from the preset station to the total outlet of the basin according to the river order of each river for each preset station, detect the overlapping paths between the complete downstream water flow paths, and take the starting point of each overlapping path as the intersection point. The merging module is used to merge overlapping paths in all the complete downstream water flow paths and merge non-overlapping paths to generate a main river network vector map layer containing continuous main river network lines. The interruption module is used to interrupt the main river network by taking the preset station and the intersection point as target points and the target points as geometric dividing points, generating multiple independent river segments, and recording the starting target point, ending target point and actual spatial length of each river segment. The determination module is used to determine the upstream and downstream relationships and actual spatial lengths between the target points based on the starting target point, ending target point, actual spatial length, and river order of each river segment. The segmentation module is used to determine the upstream catchment area of ​​each target point based on the upstream target point and the actual spatial length between the target point and the upstream target point, and to draw the outline of an independent sub-basin with the target point as the watershed outlet, thereby obtaining a sub-basin vector segmentation layer that includes the upstream and downstream relationships between target points and the actual spatial length.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and the machine-readable instructions, when executed by the processor, perform the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Digital river-lake network based method for dividing water collection unit of river basin of plain river network region

    CN105138722A

  • A method for dividing sub-watersheds of an inflow river basin

    CN109472868A

  • Automatic dividing method for internal flow lake basin area drainage basin based on lake confluence relationship

    CN110147423A

  • Distributed hydrological model sub-basin division method considering multiple elements

    CN110717251A

  • Method for automatically dividing and encoding one-dimensional model calculation unit of river network area

    CN112163322A