An automated method for extracting the centerline and catchment area of a river network while maintaining river network density.
By using an automated algorithm with dynamic river network density constraints, the centerline of the river network and the catchment area are extracted collaboratively, which solves the problem of river network density distortion caused by the fixed threshold method, realizes high-precision river network data extraction, and supports hydrological simulation and soil erosion assessment.
Patent Information
- Application Number
- CN202510454274.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-04-11
AI Technical Summary
In existing technologies, fixed-threshold river network extraction methods cannot reflect the spatial heterogeneity of river network density within natural watersheds, resulting in the extracted river network density not matching the actual situation. Furthermore, multi-level threshold methods consume high computational resources, and the cost increases significantly, especially when applied at large watershed scales.
An automated extraction algorithm based on dynamic river network density constraints is adopted. By calculating the cumulative length and area of the confluence and combining it with flow direction data, the center line of the river network and the catchment area are extracted in a coordinated manner to maintain the consistency of river network density within the local watershed.
It has achieved precise maintenance of river network density, provided high-precision river network data support, and provided high-precision data support for hydrological simulation, soil erosion assessment and smart water conservancy construction.
Smart Images

Figure CN120372934B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital hydrological modeling and geographic information, and particularly relates to an automated method for extracting the centerline of a river network and the catchment area while maintaining river network density. Background Technology
[0002] River network extraction based on digital elevation models (DEMs) is a crucial step in hydrological simulation, and its accuracy directly affects the simulation effect of watershed hydrological processes. Currently, mainstream river network extraction methods typically follow the following technical process: (1) Calculate flow direction based on DEM data; (2) Calculate runoff accumulation or runoff accumulation area; (3) Extract the river centerline by setting a fixed threshold; (4) Divide the catchment area. Among these, the implementation of steps (3) and (4) both rely on a uniformly set runoff accumulation threshold.
[0003] The existing technology has the following significant technical drawbacks: using a fixed threshold will cause the extracted river network density (total length of river channels per unit area) to be inconsistent with the actual situation. This is because the river network density in natural watersheds has significant spatial heterogeneity, which is affected by multiple factors such as topography, geology, and climate, and a fixed threshold cannot reflect this spatial variation.
[0004] To address the aforementioned issues, existing improved methods employ a multi-level threshold strategy. However, this multi-level threshold method requires multiple iterative calculations, significantly increasing computational resource consumption. In particular, when applied at the scale of large watersheds, the computational cost increases exponentially, making it impractical. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides an automated method for extracting the centerline of a river network and its catchment area while maintaining river network density, comprising:
[0006] Calculate the cumulative length of the confluence based on the flow direction and river network density;
[0007] Calculate the cumulative area of the confluence based on the flow direction;
[0008] Extract all river segments and their centerlines based on flow direction, cumulative confluence length, and cumulative confluence area;
[0009] The catchment area is determined based on the flow direction and centerline.
[0010] Preferably, the process of calculating the cumulative length of the confluence based on the flow direction and river network density includes:
[0011] Initialize the number of incoming cells for each grid cell to zero;
[0012] Iterate through the cells to which the flow is directed, and increment the number of cells flowing into the downstream cells by one;
[0013] The initial flow accumulation length of each grid cell is equal to its grid area multiplied by the river network density;
[0014] Traverse all grids and find the grid with zero inflows, which is taken as the source of the river;
[0015] Select one of the river source grid cells in sequence and set it as the current grid cell. Search downstream according to the flow direction and calculate the cumulative length of the confluence.
[0016] Preferably, the process of calculating the cumulative length of the confluence based on the downstream search includes:
[0017] Find the downstream grid of the current grid based on the flow direction. If the current grid has no downstream, the search terminates.
[0018] If a downstream grid exists, update the downstream grid's cumulative flow length, which is equal to the sum of the downstream grid's cumulative flow length and the current downstream grid's cumulative flow length.
[0019] If the number of inflow cells to the downstream grid is greater than or equal to two, subtract one from the number of inflow cells to the downstream grid and the search terminates. Otherwise, set the downstream grid as the current grid and find the downstream grid of the current grid again according to the flow direction for judgment.
[0020] Preferably, the process of calculating the cumulative confluence area based on the flow direction includes:
[0021] Initialize the number of incoming cells for each grid cell to zero;
[0022] Iterate through the cells to which the flow is directed, and increment the number of cells flowing into the downstream cells by one;
[0023] Initialize the cumulative area of each grid cell to be equal to its grid area;
[0024] Traverse all grids and find the grid with zero inflows, which is taken as the source of the river;
[0025] Select one of the river source grid cells in sequence and set it as the current grid cell. Search downstream according to the flow direction and calculate the cumulative area of the confluence.
[0026] Preferably, the process of calculating the cumulative confluence area based on the downstream flow direction includes:
[0027] Find the downstream grid of the current grid according to the flow direction. If the current grid has no downstream or the downstream is outside the search area, the search terminates.
[0028] If a downstream grid exists, update the downstream grid's cumulative area of flow, which is equal to the sum of the cumulative areas of flow of the downstream grid and the current downstream grid.
[0029] If the number of inflow grids to the downstream grid is greater than or equal to two, subtract one from the number of inflow grids to the downstream grid and terminate the search; otherwise, set the downstream grid as the current grid and find the downstream grid of the current grid again according to the flow direction for judgment.
[0030] Preferably, the process of extracting the entire river segment and its centerline based on the flow direction, cumulative confluence length, and cumulative confluence area includes:
[0031] Initialize an empty centerline temporary queue and an empty centerline completion queue. Both queues store the centerlines of river segments. Each river segment centerline is represented by a grid sequence, and the order of the grids indicates the upstream and downstream relationship.
[0032] Traverse the flow direction grid. If a grid has no downstream grid or its downstream is outside the search area, then the grid is the watershed outlet. Save each watershed outlet grid as a centerline grid sequence of length one to the centerline temporary queue.
[0033] Select the river segment centerline at the front of the centerline temporary queue and delete it from the queue;
[0034] The centerline of the selected river segment is calculated to obtain the data of all river segments and their centerlines.
[0035] Preferably, the process of calculating the centerline of the selected river segment to obtain the data of all river segments and their centerlines includes:
[0036] Calculate the target length of the river segment's centerline. If the river segment's centerline has no upstream, meaning there is no centerline flowing towards it in either the temporary queue or the completion queue, then the target length is equal to the cumulative confluence length at the downstreammost grid of the river segment's centerline. Otherwise, the target length is equal to the cumulative confluence length at the downstreammost grid of the river segment's centerline minus the sum of the cumulative confluence lengths at the downstreammost grids of all its upstream centerlines. If the centerline length is greater than or equal to the target length, then the centerline is saved to the completion queue, and the loop terminates.
[0037] If the centerline length is less than the target length, then the upstream grid set of the centerline is searched according to the flow direction;
[0038] Based on the upstream grid set, the grid with the largest cumulative area of the confluence is found and designated as the grid to be determined.
[0039] If the undetermined grid flows to the upstream grid in the centerline, then the undetermined grid is added to the beginning of the river centerline sequence, the target length of the river segment centerline is recalculated and determined.
[0040] If the undetermined grid does not flow to the upstream grid of the centerline, then find the downstream grid of the undetermined grid according to the flow direction. Using the downstream grid of the undetermined grid as the boundary, divide the centerline into upstream and downstream segments. The upstream segment does not contain the downstream grid of the undetermined grid, and the downstream segment contains the downstream grid of the undetermined grid. Save both the upstream and downstream segments of the centerline to the end of the centerline temporary storage queue.
[0041] The undetermined grid cells are saved as a grid sequence of river segment centerlines with a length of one, and stored at the end of the centerline temporary storage queue.
[0042] Take a river segment from the front of the temporary queue and delete it from the queue. Calculate the target length of the centerline of the river segment and make a judgment. Repeat the judgment process until the centerline temporary queue is empty. At this time, the centerline completion queue has saved the centerlines of all river segments in the river network.
[0043] Preferably, the process of extracting the catchment area based on the flow direction and centerline includes:
[0044] Create an empty exclusion set. If the centerline has an upstream centerline, traverse the upstream centerlines of the centerline and add the downstream cell of the upstream centerline to the exclusion set.
[0045] Initialize an empty water catchment temporary queue and an empty water catchment completion set. Both the temporary queue and the completion set store the grid cells covered by the water catchment.
[0046] The grid cells in the centerline sequence are pushed into the back end of the temporary queue in order from downstream to upstream.
[0047] If the temporary queue is not empty, take a grid from the front of the temporary queue, store it in the completed set, and delete it from the temporary queue. Based on the flow direction, find all grids upstream of the taken grid that are not included in the completed set or the excluded set, push these grids to the back of the temporary queue, and repeat until the temporary queue is empty, thus completing the extraction of the water collection area.
[0048] Preferably, the river network centerline is represented by the grid cell containing the river network centerline, and the river network centerline vector is obtained by vectorizing the grid cell containing the river network centerline.
[0049] Compared with the prior art, the present invention has the following advantages and technical effects:
[0050] This invention addresses the distortion of river network density caused by a globally uniform threshold in existing river network extraction methods. It proposes an automated extraction algorithm based on dynamic river network density constraints. By using the two-dimensional river network density distribution as a spatial variable input and combining it with flow direction data, the algorithm achieves coordinated extraction of the river network centerline and catchment area, while maintaining consistency between the extracted river network density and the input density field within each local watershed unit. This method provides high-precision river network data support for hydrological simulation, soil erosion assessment, and smart water conservancy construction. Attached Figure Description
[0051] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0052] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention. Detailed Implementation
[0053] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0054] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0055] Example 1
[0056] like Figure 1 As shown, this embodiment provides an automated method for extracting the centerline of a river network and its catchment area while maintaining river network density, including:
[0057] 1. Calculate the cumulative length of the confluence based on the flow direction and river network density.
[0058] The cumulative confluence length is defined as the total length of all main streams and tributaries upstream of a given grid cell (or river network node), which is the sum of the lengths of the water flow paths leading to that grid cell.
[0059] The cumulative length of the confluence can be calculated in the following steps:
[0060] (1) Calculate the number of inflow cells for each grid cell. 1. Initialize the number of inflow cells for each grid cell to zero.
[0061] 2. Traverse the flow grid and increment the number of inflow grids of its downstream grids by one.
[0062] (2) Calculate the cumulative flow length. 1. Initialize the cumulative flow length of each grid cell to be equal to its grid area multiplied by the river network density. 2. Traverse all grid cells and find the grid cells with zero inflow cells. These grid cells are the river sources. 3. Select one of the river source grid cells in sequence and set it as the current grid cell. Search downstream according to the flow direction: (a) Find the downstream grid cell of the current grid cell according to the flow direction. If the current grid cell has no downstream cells, the search terminates. (b) If a downstream grid cell exists, update the cumulative flow length of the downstream grid cell. Its value is equal to the sum of the cumulative flow lengths of the downstream grid cell and the current downstream grid cell. (c) If the number of inflow cells of the downstream grid cell is greater than or equal to two, subtract one from the number of inflow cells of the downstream grid cell and the search terminates. Otherwise, set the downstream grid cell as the current grid cell and repeat (a) to (c).
[0063] 2. Calculate the cumulative area of the confluence based on the flow direction.
[0064] The cumulative catchment area is defined as the total area of all catchment areas upstream of a grid cell (or river network node), that is, the sum of the catchment areas covered by the water flow paths flowing into that grid.
[0065] The cumulative length of the confluence can be calculated in the following steps:
[0066] (3) Calculate the number of inflow cells for each grid cell. 1. Initialize the number of inflow cells for each grid cell to zero.
[0067] 2. Traverse the flow grid and increment the number of inflow grids of its downstream grids by one.
[0068] (4) Calculate the cumulative confluence area. 1. Initialize the cumulative confluence area of each grid cell to be equal to its grid area. 2. Traverse all grid cells and find the grid cells with zero inflow cells. These grid cells are the sources of the river.
[0069] 3. Select one of the river source grids in sequence and set it as the current grid. Search downstream according to the flow direction: (a) Find the downstream grid of the current grid according to the flow direction. If the current grid has no downstream or the downstream is outside the search area, the search terminates; (b) If a downstream grid exists, update the cumulative area of the downstream grid, which is equal to the sum of the cumulative areas of the downstream grid and the current downstream grid; (c) If the number of inflow grids of the downstream grid is greater than or equal to two, subtract one from the number of inflow grids of the downstream grid and terminate the search; otherwise, set the downstream grid as the current grid and repeat (a) to (c).
[0070] 3. Extract the centerline of the river network based on the flow direction, cumulative confluence length, and cumulative confluence area.
[0071] In this embodiment, the river network centerline is represented by the grid cell containing the river network centerline, and the river network centerline vector can be further obtained by vectorizing the grid cell containing the river network centerline.
[0072] The river network centerline is obtained by searching upstream from the watershed outlet grid, and the specific steps are as follows.
[0073] (1) Initialize an empty centerline temporary queue and an empty centerline completion queue. Both queues store the centerlines of the river segments. Each centerline of the river segment is represented by a grid sequence. The order of the grids indicates the upstream and downstream relationship.
[0074] (2) Traverse the flow direction grid. If a grid has no downstream grid or the downstream is outside the search area, then the grid is the watershed outlet. Save each watershed outlet grid as a centerline grid sequence of length one to the centerline temporary queue.
[0075] (3) Select the river segment centerline at the front of the centerline temporary queue and delete it from the queue.
[0076] (4) For the selected river segment centerline, repeat the following steps:
[0077] a) Calculate the target length of the river segment's centerline. If the centerline has no upstream, meaning no centerline in the temporary queue or completion queue flows towards it, the target length equals the cumulative confluence length at the downstreammost grid of the river segment's centerline; otherwise, the target length equals the cumulative confluence length at the downstreammost grid of the river segment's centerline minus the sum of the cumulative confluence lengths at the downstreammost grids of all its upstream centerlines. If the centerline length is greater than or equal to the target length, the centerline is saved to the completion queue, and the loop terminates; otherwise, proceed to the following steps.
[0078] b) Based on the flow direction, search for the upstream grid set of the centerline. Grids in this set must meet three conditions: 1. They are adjacent to any grid in the centerline; 2. They flow towards the centerline; 3. They are not yet included in any centerline in the temporary queue or the completion queue. If the upstream grid set is empty, save the river centerline to the completion queue and terminate the loop; otherwise, proceed to the following steps.
[0079] c) In the upstream grid set, compare the cumulative area of the confluence and find the grid with the largest cumulative area of the confluence, and designate it as the grid to be determined.
[0080] d) If the undetermined grid flows to the upstream grid in the centerline, then add the undetermined grid to the beginning of the channel centerline sequence, return to step (a), and repeat the loop; otherwise, perform the following steps.
[0081] e) Based on the flow direction, find the downstream grid of the grid to be determined. Using the downstream grid of the grid to be determined as the boundary, divide the center line into upstream and downstream segments. The upstream segment does not contain the downstream grid of the grid to be determined, and the downstream segment contains the downstream grid of the grid. Save both the upstream and downstream center lines to the end of the center line temporary queue.
[0082] f) Save the undetermined grid as a sequence of river segment centerline grids of length one to the end of the centerline temporary storage queue, and terminate the loop.
[0083] (5) Repeat steps (3) and (4) until the centerline temporary queue is empty. At this point, the centerline completion queue has stored the centerlines of all river segments in the river network.
[0084] 4. Extract the catchment area based on the flow direction and centerline.
[0085] In this embodiment, the water collection area is represented by the grid covered by the water collection area, and the boundary of the water collection area can be obtained by vectorizing the water collection area grid.
[0086] In this embodiment, the catchment area corresponds one-to-one with the centerline of the river segment. For the centerline of each river segment in the river network, its corresponding catchment area can be extracted through the following steps:
[0087] (1) Establish an empty exclusion set. If the center line has an upstream center line, traverse the upstream center lines of the center line and add the downstream grid of the upstream center line to the exclusion set.
[0088] (2) Initialize an empty water collection temporary queue and an empty water collection completion set. Both the temporary queue and the completion set store the grid cells covered by the water collection area.
[0089] (3) Push the grid cells in the center line sequence into the last end of the temporary queue in order from downstream to upstream.
[0090] (4) If the temporary queue is not empty, take a grid from the front of the temporary queue, store it in the completion set, and delete it from the temporary queue. Repeat the following steps.
[0091] (5) Based on the flow direction, find all the grids upstream of the grid to be taken that are included in the completed set or excluded set, and push these grids to the end of the temporary queue.
[0092] (6) Repeat steps (4) and (5) until the temporary queue is empty. At this point, the completed set saves the catchment area corresponding to the center line of the river segment, and all the grids in the complete set of the catchment area flow to the center line.
[0093] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An automated method for extracting the centerline of a river network and its catchment area while maintaining river network density, characterized in that, include: Calculate the cumulative length of confluence based on river flow direction and river network density; Calculate the cumulative catchment area based on the river's flow direction; Extract all river segments and their centerlines based on the flow direction, the cumulative length of the confluence, and the cumulative area of the confluence. The water collection area is extracted based on the flow direction and the centerline; The calculation of the cumulative confluence length based on river flow direction and river network density includes: Initialize the number of incoming cells for each grid cell to zero; Iterate through the cells to which the flow is directed, and increment the number of cells flowing into the downstream cells by one; The initial flow accumulation length of each grid cell is equal to its grid area multiplied by the river network density; Traverse all grids and find the grid with zero inflows, which is taken as the source of the river; Select one of the river source grid cells in sequence and set it as the current grid cell. Search downstream according to the flow direction and calculate the cumulative length of the confluence. The process of searching downstream and calculating the cumulative length of the confluence includes: Find the downstream grid of the current grid based on the flow direction. If the current grid has no downstream, the search terminates. If a downstream grid exists, update the downstream grid's cumulative flow length, which is equal to the sum of the downstream grid's cumulative flow length and the current downstream grid's cumulative flow length. If the number of inflow cells to the downstream grid is greater than or equal to two, subtract one from the number of inflow cells to the downstream grid and the search terminates. Otherwise, set the downstream grid as the current grid and find the downstream grid of the current grid again according to the flow direction for judgment.
2. The method according to claim 1, characterized in that, The process of calculating the cumulative area of the confluence based on the flow direction includes: Initialize the number of incoming cells for each grid cell to zero; Iterate through the cells to which the flow is directed, and increment the number of cells flowing into the downstream cells by one; Initialize the cumulative area of each grid cell to be equal to its grid area; Traverse all grids and find the grid with zero inflows, which is taken as the source of the river; Select one of the river source grid cells in sequence and set it as the current grid cell. Search downstream according to the flow direction and calculate the cumulative confluence area.
3. The method according to claim 2, characterized in that, The process of searching downstream and calculating the cumulative confluence area includes: Find the downstream cell of the current cell based on the flow direction. If the current cell has no downstream cell or the downstream cell is outside the search area, the search terminates. If a downstream grid exists, update the downstream grid's cumulative area of flow, which is equal to the sum of the cumulative areas of flow of the downstream grid and the current downstream grid. If the number of inflow grids to the downstream grid is greater than or equal to two, subtract one from the number of inflow grids to the downstream grid and terminate the search; otherwise, set the downstream grid as the current grid and find the downstream grid of the current grid again according to the flow direction for judgment.
4. The method according to claim 1, characterized in that, The process of extracting the entire river segment and its centerline based on flow direction, cumulative confluence length, and cumulative confluence area includes: Initialize an empty centerline temporary queue and an empty centerline completion queue. Both queues store the centerlines of river segments. Each river segment centerline is represented by a grid sequence, and the order of the grids indicates the upstream and downstream relationship. Traverse the flow direction grid. If a grid has no downstream grid or its downstream is outside the search area, then the grid is the watershed outlet. Save each watershed outlet grid as a centerline grid sequence of length one to the centerline temporary queue. Select the river segment centerline at the front of the centerline temporary queue and delete it from the queue; The centerline of the selected river segment is calculated to obtain the data of all river segments and their centerlines.
5. The method according to claim 4, characterized in that, The process of calculating the centerline of the selected river segment to obtain the data for all river segments and their centerlines includes: Calculate the target length of the river segment's centerline. If the river segment's centerline has no upstream, meaning there is no centerline flowing towards it in either the temporary queue or the completion queue, then the target length is equal to the cumulative confluence length at the downstreammost grid of the river segment's centerline. Otherwise, the target length is equal to the cumulative confluence length at the downstreammost grid of the river segment's centerline minus the sum of the cumulative confluence lengths at the downstreammost grids of all its upstream centerlines. If the centerline length is greater than or equal to the target length, then the centerline is saved to the completion queue, and the loop terminates. If the centerline length is less than the target length, then the upstream grid set of the centerline is searched according to the flow direction; Based on the upstream grid set, the grid with the largest cumulative area of the confluence is found and designated as the grid to be determined. If the undetermined grid flows to the upstream grid in the centerline, then add the undetermined grid to the beginning of the river centerline sequence, recalculate the target length of the river segment centerline, and make a judgment. If the undetermined grid does not flow to the upstream grid of the centerline, then find the downstream grid of the undetermined grid according to the flow direction. Using the downstream grid of the undetermined grid as the boundary, divide the centerline into upstream and downstream segments. The upstream segment does not contain the downstream grid of the undetermined grid, and the downstream segment contains the downstream grid of the undetermined grid. Save both the upstream and downstream segments of the centerline to the end of the centerline temporary storage queue. The undetermined grid cells are saved as a grid sequence of river segment centerlines with a length of one, and stored at the end of the centerline temporary storage queue. Take a river segment from the front of the temporary queue and delete it from the queue. Calculate the target length of the centerline of the river segment and make a judgment. Repeat the judgment process until the centerline temporary queue is empty. At this time, the centerline completion queue has saved the centerlines of all river segments in the river network.
6. The method according to claim 1, characterized in that, The process of extracting the catchment area based on the flow direction and centerline includes: Create an empty exclusion set. If the centerline has an upstream centerline, traverse the upstream centerlines of the centerline and add the downstream cell of the upstream centerline to the exclusion set. Initialize an empty water catchment temporary queue and an empty water catchment completion set. Both the temporary queue and the completion set store the grid cells covered by the water catchment. The grid cells in the centerline sequence are pushed into the back end of the temporary queue in order from downstream to upstream. If the temporary queue is not empty, take a grid from the front of the temporary queue, store it in the completed set, and delete it from the temporary queue. Based on the flow direction, find all grids upstream of the taken grid that are not included in the completed set or the excluded set, push these grids to the back of the temporary queue, and repeat until the temporary queue is empty, thus completing the extraction of the water collection area.
7. The method according to claim 1, characterized in that, The river network centerline is represented by the grid cell containing the river network centerline, and the river network centerline vector is obtained by vectorizing the grid cell containing the river network centerline.
Citation Information
Patent Citations
Digital elevation model-oriented arbitrary section catchment area boundary and river network extraction method
CN112017282A
Wind, light and water resource element simulation method and device for optimizing key parameters of confluence mode
CN119203811A