CN109271472B - Method for extracting and storing river network structure of drainage basin - Google Patents
Method for extracting and storing river network structure of drainage basin Download PDFInfo
- Publication number
- CN109271472B CN109271472B CN201811132396.XA CN201811132396A CN109271472B CN 109271472 B CN109271472 B CN 109271472B CN 201811132396 A CN201811132396 A CN 201811132396A CN 109271472 B CN109271472 B CN 109271472B
- Authority
- CN
- China
- Prior art keywords
- grid
- current
- layer
- upstream
- river
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a method for extracting and storing a river network structure of a drainage basin, which comprises the steps of firstly traversing drainage basin grid flow direction data for the first time, and acquiring and storing upstream and downstream adjacent grid information directly connected with each grid unit; after determining the watershed outlet grids, performing second traversal on the grid flow direction data from bottom to top, positioning the upstream adjacent grids of all grids in the current processing layer by layer upstream, and storing the upstream adjacent grids of all grids in the current processing layer in the next layer of the multi-layer branching tree data structure; and when the grids in all layers of the multi-layer branching tree are judged completely, extracting and storing the river network structure of the drainage basin. The method can directly determine the upstream-downstream relationship of each grid in the river network according to the grid flow direction, further obtain the water flow path of the river basin single flow direction river network through efficient grid traversal, store the river network structure by using the layered multi-branch tree, and improve the data extraction efficiency and the convenience of utilization.
Description
Technical Field
The invention relates to the technical field of hydrology, in particular to a method for extracting and storing a river network structure of a drainage basin.
Background
The river basin and river network are main parameters of river basin hydrological modeling, and in the scientific research and engineering practice of hydrology, geographic information and water and soil conservation, the acquired river basin and river network is a basic condition for accurately calculating characteristics of the river basin such as slope length factors, valley lines and edge lines, and can be obtained through a river network extraction algorithm, for example, simple river channels can be extracted by detecting special points on a topographic image such as mountain tops, concave points, mountain ridges, mountain edges and the like.
In the prior art, a plurality of schemes for extracting the river basin and river network by using raster flow direction data are provided, and the method is also a mainstream method for extracting the river basin and river network at present. The process of extracting the river network of the drainage basin by the methods is grid flow direction judgment → water collection area convergence calculation → river reach identification. The methods make different attempts in the judgment of the grid flow direction, such as adopting a single-flow method, a multi-flow method or combining other methods to improve the flow direction judgment; or in the river reach identification, the river reach is identified by improving the determination method of the water collection area threshold or simultaneously combining the water collection area threshold with geomorphic parameters and other means. Generally, in the process of extracting a river network of a drainage basin in the prior art, whether each grid belongs to a river channel needs to be judged according to a result of convergence analysis, after the grid of the river channel is determined, a water gap grid is searched and determined, then hydrologic and geomorphic element space data is recorded by a grid model or a vector model while the grid of the river channel is traversed upstream, and the topological relation of a hydrologic network is described, wherein the main record comprises the topological relation among nodes (hydrologic nodes), arcs (hydrologic edges) and polygons (sub-drainage basins); and finally, grading the river channel according to the upstream and downstream topological relation of the river channel.
However, in the prior art, extraction from known grid flow direction data to a river basin and river network requires multiple traversals of the river basin grid data, which results in low extraction efficiency of the river network; meanwhile, the existing river network storage structure stores the hydrological network topological relation in the form of a river network incidence matrix, for river domain data with thousands of grids, the structure of the sparse incidence matrix is complex, if the sparse incidence matrix is stored in a program code in an uncompressed two-dimensional array, the waste of memory space is large, if the sparse incidence matrix is stored in a compressed format, the processing is complex, and the river network storage data structure is difficult to directly call by a hydrological model, so that the subsequent analysis efficiency is influenced.
Disclosure of Invention
The invention aims to provide a method for extracting and storing a river network structure of a river basin, which can directly determine the upstream and downstream relation of each grid in the river network according to the direction of the grid flow, further obtain the water flow path of a single-flow river network of the river basin through efficient grid traversal, store the river network structure by a layered multi-branch tree and improve the data extraction efficiency and the convenience of utilization.
The purpose of the invention is realized by the following technical scheme:
a method for extracting and storing a river network structure of a river basin, comprising the following steps:
In step 1, the immediate upstream grid U directly connected with each grid unit is obtained based on the grid flow directioniAnd the process of the immediately downstream grid D is specifically as follows:
based on the flow direction data of the current grid and the surrounding grids, finding the upstream adjacent grid U of the surrounding adjacent grids, the flow direction of which points to the current gridiAnd the immediately downstream grid D to which the current grid flow is directed.
In step 1, the process of storing the immediately upstream and downstream grid information of the current grid specifically includes:
defining a grid unit class by an object-oriented program language, and storing all the upstream adjacent grids U searched by the traversal process by an upstream adjacent grid pointer array in the grid unit classiAnd stores the immediately downstream grid D pointed to by the current grid flow direction with a downstream grid pointer within the grid unit class.
In step 6, the immediately upstream grids U are eachiStoring in a next level L of a hierarchical multi-way tree data storage structureNThe internal process specifically comprises the following steps:
defining a hierarchical multi-branch tree class by an object-oriented program language, and judging whether a next layer L exists by a member function of the hierarchical multi-branch tree classNIf L already existsNThen the flow direction is directed to the immediately upstream grid U of the current gridiIs added to LNIn the layer, if there is no L yetNIf the layer exists, a grid layer is newly added by using member functions of the multi-layer branching tree class, and the flow direction is directly pointed to the immediately adjacent grid U upstream of the current gridiIs added to LNIn the layer, the river network structure is conveniently stored by the layered multi-branch tree.
According to the technical scheme provided by the invention, the upstream and downstream relations of each grid in the river network can be directly determined according to the direction of the grid flow, the water flow path of the river basin single-flow river network is further obtained through efficient grid traversal, the river network structure is stored through the layered multi-branch tree, and the data extraction efficiency and the convenience in utilization are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for extracting and storing a river network structure of a river basin according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a hierarchical multi-way tree according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
The following will describe the embodiment of the present invention in further detail with reference to the accompanying drawings, and as shown in fig. 1, a schematic flow chart of a method for extracting and storing a river network structure of a river basin provided by the embodiment of the present invention is shown, where the method includes:
in the step, for a single-flow river network, the source grid has no upstream adjacent grid, the number of the upstream adjacent grids of the non-source grid is not less than 1, and U isiRepresenting the ith immediately upstream grid of the current grid; the watershed outlet grids have no downstream adjacent grids, and the downstream adjacent grids of the non-watershed outlet grids have only 1 grid, which is represented by D;
in this step, the immediately upstream cell U directly connected to each cell is obtained based on the cell flow directioniAnd the process of the immediately downstream grid D is specifically as follows:
based on the flow direction data of the current grid and the surrounding grids, finding the upstream adjacent grid U of the surrounding adjacent grids, the flow direction of which points to the current gridiAnd the immediately downstream grid D to which the current grid flow is directed;
defining a grid unit class by an object-oriented program language, and storing all the upstream adjacent grids U searched by the traversal process by an upstream adjacent grid pointer array in the grid unit classiAnd stores the immediately downstream grid D pointed to by the current grid flow direction with a downstream grid pointer within the grid unit class.
In a specific implementation, since there may be a plurality of upstream grids of the current grid, the one-dimensional array is used for storage, the flow direction of each grid in the river basin single-flow river network is only possible, and therefore, only one member pointer record is needed for the downstream grid.
here, the single-flow river network of the river basin has only one outlet, so the outlet grid of the river basin obtained in step 4 is the total outlet of the river basin.
In a specific implementation, each grid may have a plurality of upstream grids pointing to itself in the same flow direction, and a data storage structure of a hierarchical multi-way tree may be further adopted to completely record the grid topology structure of the sub-basin from downstream to upstream.
As shown in fig. 2, which is a schematic structural diagram of a hierarchical multi-way tree provided in an embodiment of the present invention, in a data storage structure of the hierarchical multi-way tree, an upstream grid directly pointing to a current grid is used as an element of a next grid layer and is stored in the hierarchical multi-way tree (for example, layer 2, layer 3, and layer 4 in fig. 2), so that convenient storage of river network data of a drainage basin is realized, and a hydrological model is directly called conveniently. Based on the layered multi-branch tree, catchment analysis can be carried out specifically, a river channel is judged through a preset catchment threshold value, a ditch edge line, a ditch valley line, river channel grading and the like are determined, even if the catchment threshold value changes, the situation that in the prior art, grid traversal is repeatedly carried out to extract river network topology information again is not needed, once the layered multi-branch tree is established, infinite multiplexing can be carried out, and the efficiency of subsequent analysis is greatly improved.
in this step, each immediately upstream grid U is placediStoring in a next level L of a hierarchical multi-way tree data storage structureNThe specific process comprises the following steps:
defining a hierarchical multi-branch tree class by an object-oriented program language, and judging whether a next layer L exists by a member function of the hierarchical multi-branch tree classNIf L already existsNThen the flow direction is directed to the immediately upstream grid U of the current gridiIs added to LNIn the layer, if there is no L yetNIf the layer exists, a grid layer is newly added by using member functions of the multi-layer branching tree class, and the flow direction is directly pointed to the immediately adjacent grid U upstream of the current gridiIs added to LNIn the layer, the river network structure is conveniently stored by the layered multi-branch tree.
Here, if the layer L is currently processedCIs n, then the next layer LNThe layer number of (1) is n + 1;
It is noted that those skilled in the art will recognize that embodiments of the present invention are not described in detail herein.
In summary, compared with the prior art, the method provided by the embodiment of the invention has the advantages that the data structure is simple, the physical significance is clear, the topological relation of the complex river network can be intuitively reflected, the complex logical relation expression is not required, the complex operation that a large sparse matrix needs to be processed in the prior art is avoided, and the waste of memory space and the calling of complex instructions are avoided; and once the hierarchical multi-branch tree constructed by the invention is established, the hierarchical multi-branch tree can be infinitely utilized, and is convenient for direct and repeated calling in subsequent analysis.
Meanwhile, different from the traditional three-time grid traversal river network extraction method of 'confluence analysis → river channel identification → river network extraction', the method provided by the invention does not need to perform 'confluence analysis', only needs to perform 'grid positioning' → 'river network extraction' twice grid traversal, and can obtain a complete river basin single flow direction river network.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (4)
1. A method for extracting and storing a river network structure of a river basin is characterized by comprising the following steps:
step 1, performing first traversal on raster flow direction data of a flow field, and acquiring an upstream adjacent raster U directly connected with each raster unit based on the raster flow directioniAnd immediately downstream grid D, and storing immediately upstream and downstream of the current gridNeighbor grid information; wherein, UiRepresenting the ith upstream adjacent grid of the current grid, and only 1 downstream adjacent grid in the single-flow river network, which is represented by D;
step 2, traversing the grid flow direction data of the drainage basin for the second time to extract and store a drainage basin and river network topological structure in the hierarchical multi-branch tree, and selecting any grid in the drainage basin as an initial grid to be traversed at the beginning of traversal, wherein the initial grid is taken as a current grid C to be processed;
step 3, positioning a downstream adjacent grid D of the current grid according to the downstream adjacent grid information of the current grid C stored in the step 1;
step 4, judging whether the downstream adjacent grid D positioned in the step 3 is positioned at the outlet of the drainage basin, if not, selecting the downstream adjacent grid D as a new current grid, and returning to the step 3 for iterative processing; if yes, storing the drainage basin outlet grid information in the layer 1 of the hierarchical multi-branch tree, and selecting the layer 1 of the hierarchical multi-branch tree as the current processing layer LCThen entering step 5;
step 5, selecting the current processing layer LCTaking one unprocessed grid as a current processing grid, judging whether the current processing grid is a source grid or not, if not, entering a step 6, and if so, entering a step 7;
step 6, obtaining each upstream adjacent grid U of the current grid according to the upstream adjacent grid information of the current grid stored in the step 1iAnd each immediately upstream grid UiStoring in a next level L of a hierarchical multi-way tree data storage structureNThen, go to step 7; wherein, if the current processing layer LCIs n, then the next layer LNThe layer number of (1) is n + 1;
step 7, judging the current processing layer LCWhether all grids in the grid are judged completely is judged, if not, the step 5 is returned to continue the processing; if yes, entering step 8;
step 8, judging the next layer L of the layered multi-branch treeNIf there is an unprocessed trellis, if so, the next level L of the hierarchical multi-way tree will be layeredNIt is set as the current processing layer,returning to the step 5 for iterative processing; and if not, finishing the extraction and storage of the river network data of the river basin.
2. The method for extracting and storing river network structures in river basin according to claim 1, wherein in step 1, the immediate upstream grid U directly connected with each grid unit is obtained based on grid flow directioniAnd the process of the immediately downstream grid D is specifically as follows:
based on the flow direction data of the current grid and the grids around the current grid, the upstream adjacent grid U of the adjacent grid around the current grid, the flow direction of which points to the current grid, is foundiAnd the immediately downstream grid D to which the grid flow is directed.
3. The method for extracting and storing the river network structure of the river basin according to claim 1, wherein in step 1, the process of storing the information of the immediately upstream and downstream grids of the current grid is specifically as follows:
defining a grid unit class by an object-oriented program language, and storing all the upstream adjacent grids U searched by the traversal process by an upstream adjacent grid pointer array in the grid unit classiAnd stores the immediately downstream grid D pointed to by the current grid flow direction with a downstream grid pointer within the grid unit class.
4. The method for extracting and storing river network structure of river basin according to claim 1, wherein in step 6, each immediately upstream grid U is connected to the river basiniStoring in a next level L of a hierarchical multi-way tree data storage structureNThe internal process specifically comprises the following steps:
defining a hierarchical multi-branch tree class by an object-oriented program language, and judging whether a next layer L exists by a member function of the hierarchical multi-branch tree classNIf L already existsNThen the flow direction is directed to the immediately upstream grid U of the current gridiIs added to LNIn the layer, if there is no L yetNIf the layer exists, a grid layer is newly added by using member functions of the multi-layer branching tree class, and the flow direction is directly pointed to the immediately adjacent grid U upstream of the current gridiIs added to LNIn the layer, the river network structure is conveniently stored by the layered multi-branch tree.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811132396.XA CN109271472B (en) | 2018-09-27 | 2018-09-27 | Method for extracting and storing river network structure of drainage basin |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811132396.XA CN109271472B (en) | 2018-09-27 | 2018-09-27 | Method for extracting and storing river network structure of drainage basin |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109271472A CN109271472A (en) | 2019-01-25 |
CN109271472B true CN109271472B (en) | 2021-12-31 |
Family
ID=65199053
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811132396.XA Active CN109271472B (en) | 2018-09-27 | 2018-09-27 | Method for extracting and storing river network structure of drainage basin |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109271472B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102915227A (en) * | 2012-09-03 | 2013-02-06 | 南京师范大学 | Parallel method for large-area drainage basin extraction |
CN107315847A (en) * | 2017-01-12 | 2017-11-03 | 中国水利水电科学研究院 | A kind of river and the generation method and device of underground water coupled simulation parameter |
CN108399309A (en) * | 2018-03-16 | 2018-08-14 | 中国水利水电科学研究院 | A kind of watershed partitioning method of large scale complex topographic area hydrological distribution model |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9086047B2 (en) * | 2011-09-17 | 2015-07-21 | Karim Salehpoor | Renewable energy extraction device |
-
2018
- 2018-09-27 CN CN201811132396.XA patent/CN109271472B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102915227A (en) * | 2012-09-03 | 2013-02-06 | 南京师范大学 | Parallel method for large-area drainage basin extraction |
CN107315847A (en) * | 2017-01-12 | 2017-11-03 | 中国水利水电科学研究院 | A kind of river and the generation method and device of underground water coupled simulation parameter |
CN108399309A (en) * | 2018-03-16 | 2018-08-14 | 中国水利水电科学研究院 | A kind of watershed partitioning method of large scale complex topographic area hydrological distribution model |
Non-Patent Citations (1)
Title |
---|
松花江流域哈尔滨城区段土壤;龚文峰 等;《水土保持通报》;20091231;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN109271472A (en) | 2019-01-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Siqueira et al. | IPH-Hydro Tools: a GIS coupled tool for watershed topology acquisition in an open-source environment | |
Wu et al. | A localized contour tree method for deriving geometric and topological properties of complex surface depressions based on high-resolution topographical data | |
CN108959598B (en) | Method for importing CAD data into SWMM based on GIS | |
Do et al. | Parallel computing flow accumulation in large digital elevation models | |
CN113158385B (en) | Agricultural non-point source pollution key source area identification method and system | |
CN105303612A (en) | Digital river network extraction method based on TIN model | |
CN107038278A (en) | Parametric sensitivity optimization method based on SWMM Yu MATLAB data interactions | |
CN114648617A (en) | Water system extraction method based on digital elevation model DEM | |
CN112231993B (en) | Channel cross section generalization method and device based on Classification-Puck | |
Lindsay et al. | Measuring the significance of a divide to local drainage patterns | |
CN114462254A (en) | Distributed hydrological model parallel computing method based on flow direction | |
CN109271472B (en) | Method for extracting and storing river network structure of drainage basin | |
CN117495095A (en) | Early warning method for evaluating urban waterlogging risk based on rainwater pipe network model | |
CN113379828B (en) | Slope length extraction method fusing surface morphological characteristics | |
CN116415318B (en) | Modeling method for hydrologic connectivity of lake in inner flow area based on mathematical morphology | |
CN115544789B (en) | River valley plain extraction method based on digital elevation model and gradient cost distance | |
CN115358354A (en) | Rainfall space data restoration and reconstruction method | |
CN115795947A (en) | River channel reverse tracing determination method based on digital elevation model | |
CN113343565B (en) | Neighborhood effect mode construction and CA simulation method and system considering spatial heterogeneity | |
CN114004855A (en) | Watershed extraction method and device, computer equipment and storage medium | |
Chen et al. | A new DEM generalization method based on watershed and tree structure | |
CN110659823B (en) | Similar basin analysis method, model, system and computer storage medium | |
Vogeti et al. | Streamflow forecasting in a climate change perspective using E-FUSE | |
CN114741989A (en) | Hydrological simulation calculation method and device and computer equipment | |
KR20230116440A (en) | Watershed analysis apparatus and method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |