A method, apparatus and electronic device for processing depression filling data
By identifying potential water accumulation grid cells in a triangular elevation grid and performing depression filling, the problem of low accuracy in depression filling in unstructured grids is solved, thus improving the accuracy and stability of hydrological calculations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, the accuracy of filling depressions in unstructured grids is low, leading to unstable and inefficient hydrological calculations.
By acquiring triangular elevation grids, potential water-filling grid cells of the initial water-filling grid cells are determined, and depression filling is performed based on elevation values until a set of water-filling cells is formed. The accuracy of depression filling is improved by using structured and unstructured grid processing methods of triangular elevation grids.
This improved the accuracy of depression filling, thereby enhancing the accuracy and stability of hydrological calculations and ensuring that water flow can effectively converge at the basin outlet.
Smart Images

Figure CN116993938B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of depression data processing technology, and more specifically, to a depression filling data processing method, apparatus, and electronic device. Background Technology
[0002] In hydrological calculations, in order to ensure the stability of the hydrological model, it is necessary to fill depressions in the DEM (Digital Elevation Model) during the watershed hydrological generation process so that the water obtained on the watershed surface can eventually flow to the watershed outlet.
[0003] In existing technologies, depression filling methods such as the J&D method are commonly used for DEMs with structured meshes (e.g., equilateral triangles, squares, etc.). However, the accuracy of using these methods for depression filling of unstructured meshes is very low. Summary of the Invention
[0004] The objectives of this invention include, for example, providing a method, apparatus, and electronic device for processing depression-filling data, which can at least partially solve the aforementioned technical problems.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, embodiments of the present invention provide a method for processing depression filling data, the method comprising:
[0007] Obtain a triangular elevation grid, which includes multiple triangular grid cells and multiple initial water accumulation grid cells, each of the triangular grid cells or the initial water accumulation grid cells corresponding to an elevation value;
[0008] For each initial water accumulation grid cell, at least one potential water accumulation grid cell is determined based on the elevation values of adjacent grid cells; wherein, the adjacent grid cells are triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell;
[0009] Based on the elevation values of the potential water accumulation grid cells, the initial water accumulation grid cells are filled with depressions;
[0010] Determine whether the combination of the initial water accumulation grid unit and the potential water accumulation grid unit after filling the depression constitutes a water accumulation unit set;
[0011] If so, then new potential water accumulation grid units are determined based on the set of water accumulation units, and the water accumulation unit set is filled with depressions based on the new potential water accumulation grid units, until the combination of the water accumulation unit set after depression filling and the new potential water accumulation grid units is no longer a new set of water accumulation units.
[0012] Optionally, the method further includes the step of generating the triangular elevation grid, which includes:
[0013] Obtain the region boundary file and contour map. The region boundary file includes a target region map and user-preset parameters. The contour map is the contour map corresponding to the target region.
[0014] Based on the target area map and the user-preset parameters, a triangular network is generated;
[0015] By superimposing the triangular mesh with the contour map, a triangular mesh is obtained, which includes multiple triangular elements.
[0016] Extract the elevation values of the three corner points of each triangle element in the triangular mesh, calculate the average value of the elevation values of the three corner points of each triangle element, and use them as the elevation values of each triangle element.
[0017] The elevation values of each of the triangular elements are marked in the triangular grid to obtain the triangular elevation grid.
[0018] Optionally, the method further includes the step of determining the initial water accumulation grid cells, which includes:
[0019] Extract the elevation values of each of the aforementioned triangular mesh elements;
[0020] Determine whether the elevation value of each of the triangular mesh cells is less than the elevation values of each of the triangular mesh cells adjacent to the three sides of the triangular mesh cell.
[0021] If so, then the triangular mesh unit is determined to be the initial water accumulation mesh unit.
[0022] Optionally, determining at least one potential water accumulation grid cell based on the elevation values of adjacent grid cells includes:
[0023] Obtain the elevation values of each of the adjacent grid cells;
[0024] Compare the elevation values of each of the adjacent grid cells;
[0025] If one or more of the adjacent grid cells have the lowest elevation value, then the one or more adjacent grid cells with the lowest elevation value are identified as the potential water accumulation grid cells.
[0026] If the elevation values of all adjacent grid cells are equal, then all of the adjacent grid cells are determined as potential water accumulation grid cells.
[0027] Optionally, filling depressions in the initial water-accumulating grid cells based on the elevation values of the potential water-accumulating grid cells includes:
[0028] Obtain the elevation value of the potential water accumulation grid cell;
[0029] The elevation values of the initial water accumulation grid cells are deleted, and the elevation values of the potential water accumulation grid cells are assigned to the initial water accumulation grid cells, thus completing the filling of depressions in the initial water accumulation grid cells.
[0030] Optionally, determining whether the combination of the initial water-accumulating grid cells and the potential water-accumulating grid cells after filling the depression constitutes a set of water-accumulating cells includes:
[0031] The elevation values of the triangular grid cells adjacent to each side of the polygonal grid formed by the initial water accumulation grid and the potential water accumulation grid cells after filling the depression are obtained respectively.
[0032] Determine whether there exists a triangular grid cell whose elevation value is smaller than that of the initial water accumulation grid and / or the potential water accumulation grid cell after filling the depression;
[0033] If not, then the combination of the initial water accumulation grid unit after filling the depression and the potential water accumulation grid unit is determined to be the water accumulation unit set.
[0034] Optionally, the triangular elevation grid further includes a river channel that intersects with multiple triangular grid cells; after extracting the elevation values of each triangular grid cell, the method further includes:
[0035] Remove the elevation values of the triangular grid cells that intersect with the river channel from the elevation values of each of the triangular grid cells.
[0036] Optionally, the method further includes:
[0037] Determine whether the triangular grid cell adjacent to the potential water accumulation grid cell intersects with the river channel;
[0038] If not, then continue to determine whether the elevation value of the potential water accumulation grid cell is greater than the elevation value of the triangular grid cell adjacent to the potential water accumulation grid cell;
[0039] If so, the initial water accumulation grid unit or the set of water accumulation units is filled based on the potential water accumulation grid unit, and the next initial water accumulation grid unit is processed after the water accumulation is completed.
[0040] Secondly, embodiments of the present invention provide a depression filling data processing device, the depression filling data processing device comprising:
[0041] A triangle elevation grid acquisition module is used to acquire a triangle elevation grid, which includes multiple triangle grid cells and multiple initial water accumulation grid cells, and each triangle grid cell or the initial water accumulation grid cell corresponds to an elevation value.
[0042] The first potential water accumulation grid cell determination module is used to determine at least one potential water accumulation grid cell for each of the initial water accumulation grid cells based on the elevation values of adjacent grid cells; wherein, the adjacent grid cells are triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell;
[0043] The depression-filling module is used to fill depressions in the initial water-accumulating grid cells based on the elevation values of the potential water-accumulating grid cells.
[0044] The water accumulation unit set determination module is used to determine whether the combination of the initial water accumulation grid unit and the potential water accumulation grid unit after filling the depression is a water accumulation unit set.
[0045] The second potential water accumulation grid cell determination module is used to determine a new potential water accumulation grid cell based on the water accumulation cell set when the combination of the initial water accumulation grid cell after filling the depression and the potential water accumulation grid cell set is a water accumulation cell set, and to fill the depression of the water accumulation cell set based on the new potential water accumulation grid cell set until the combination of the water accumulation cell set after filling the depression and the new potential water accumulation grid cell set is no longer a new water accumulation cell set.
[0046] Thirdly, embodiments of the present invention provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the methods described above.
[0047] Fourthly, embodiments of the present invention provide a computer-readable storage medium, the computer-readable storage medium including a computer program, wherein the computer program, when executed, controls a server where the computer-readable storage medium is located to implement the steps of any of the methods described above.
[0048] The beneficial effects of the embodiments of the present invention include, for example:
[0049] By acquiring a triangular elevation grid, potential water-accumulating grid cells are determined based on the elevation values of the initial water-accumulating grid cells (i.e., adjacent grid cells), and depressions in the initial water-accumulating grid cells are filled. If the combination of the filled initial water-accumulating grid cells and the potential water-accumulating grid cells forms a set of water-accumulating cells, new potential water-accumulating grid cells are determined based on this set, until the combination of the filled water-accumulating cell set and the new potential water-accumulating grid cells does not form a new set of water-accumulating cells. Since this method can be used with both structured and unstructured triangular grids, the accuracy of depression-filling is higher, thereby improving the accuracy of hydrological calculations. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, 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 the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 An architecture diagram of an electronic device provided in an embodiment of the present invention;
[0052] Figure 2 A flowchart illustrating the steps of a depression-filling data processing method provided in an embodiment of the present invention;
[0053] Figure 3 This is a schematic diagram illustrating the determination of initial water accumulation grid cells according to an embodiment of the present invention;
[0054] Figure 4 This is a schematic diagram illustrating the removal of elevation values from triangular grid cells intersecting with river channels, provided as an embodiment of the present invention.
[0055] Figure 5 This is a schematic diagram of filling depressions in an initial water accumulation grid unit provided by an embodiment of the present invention;
[0056] Figure 6 This is a schematic diagram illustrating the determination of a set of water accumulation units according to an embodiment of the present invention;
[0057] Figure 7 This is a schematic diagram illustrating whether the filling of depressions has been completed, provided as an embodiment of the present invention.
[0058] Figure 8 This is an architectural diagram of a depression-filling data processing device provided in an embodiment of the present invention.
[0059] Icons: 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication module; 300 - Depression filling data processing device; 301 - Triangle elevation grid acquisition module; 302 - First potential water accumulation grid unit determination module; 303 - Depression filling module; 304 - Water accumulation unit set determination module; 305 - Second potential water accumulation grid unit determination module. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0061] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0062] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0063] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0064] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.
[0065] Unstructured triangulation is a fundamental domain partitioning method in finite element and finite volume methods. Numerical hydrological models also generally employ unstructured triangulation to divide watersheds into basic hydrological computational units. In regular cell partitioning such as DEM data, local water accumulation points may appear on the spatial grid, preventing water from flowing into the channel units. Therefore, during watershed hydrological generation, the DEM must first undergo depression filling to ensure that water collected on the watershed surface can ultimately flow to the watershed outlet.
[0066] In unstructured triangulation networks, local water accumulation points exist. Numerical models often use the simplified Saint-Venant equation (i.e., the phreatic water equation) to calculate surface runoff, assuming a small surface water depth similar to the surface roughness. However, due to the presence of water accumulation points in the unstructured network, water from surrounding areas converges into the water accumulation unit, causing the water level in that unit to gradually rise, rendering the phreatic water equation assumptions inapplicable. This significantly reduces the efficiency of iterative calculations near water accumulation points, and may even lead to overall model instability and solution failure. The handling of water flow in depressions has become one of the key technical challenges directly affecting the numerical solution of unstructured domains. Therefore, it is necessary to develop a method for filling depressions in the triangulation network to improve computational efficiency and ensure numerical solution stability. This method can be used in the data preprocessing stage before model calculation or directly as a module in the model calculation.
[0067] Since O'Callaghan et al. used a filtering and smoothing method to process depressions in DEM data, scholars both domestically and internationally have conducted numerous improvements and studies based on this approach. For example, the J&D method first gradually raises depressions to a flat surface, then identifies grid cells adjacent to those with flow directions and determines the flow direction of these grid cells.
[0068] The method proposed by Martz et al. involves calculating the catchment area of each grid cell along the water flow path before filling the depressions, identifying the depressions based on the catchment area, and then filling and leveling them. Then, the catchment area of each grid cell is adjusted accordingly.
[0069] Both of these methods constrain the flow path within a flat region and may result in multiple outlets, thus often generating unrealistic parallel channels. Furthermore, these methods are designed for filling depressions in structured mesh DEMs and are not entirely applicable to filling depressions in unstructured triangular meshes.
[0070] Based on the above, this specification provides a method, apparatus, and electronic device for processing depression data, which can effectively alleviate the above-mentioned technical problems.
[0071] Please refer to Figure 1 This is a block diagram of an electronic device 100 provided in this application. The electronic device 100 can be a data processing device, and this embodiment does not limit this. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0072] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0073] The processor 120 is used to read / write data or programs stored in memory and to perform corresponding functions.
[0074] The communication module 130 is used to establish a communication connection between the server and other communication terminals through the network, and to send and receive data through the network.
[0075] It should be understood that, Figure 1 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof. This electronic device 100 can be integrated into a terminal device such as a computer, or it can be configured as a standalone device.
[0076] Corresponding to electronic device 100, this embodiment of the invention provides a method for processing low-level data, the method including as follows: Figure 2 The following steps are shown:
[0077] Step S110: Obtain a triangular elevation grid, which includes multiple triangular grid cells and multiple initial water accumulation grid cells, each of the triangular grid cells or the initial water accumulation grid cells corresponding to an elevation value.
[0078] Step S120: For each of the initial water accumulation grid cells, determine at least one potential water accumulation grid cell based on the elevation values of adjacent grid cells; wherein, the adjacent grid cells are triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell.
[0079] Step S130: Fill depressions in the initial water accumulation grid cell based on the elevation value of the potential water accumulation grid cell.
[0080] Step S140: Determine whether the combination of the initial water accumulation grid unit and the potential water accumulation grid unit after filling the depression is a water accumulation unit set.
[0081] Step S150: If yes, then determine new potential water accumulation grid cells based on the set of water accumulation cells, and fill depressions in the set of water accumulation cells based on the new potential water accumulation grid cells, until the combination of the water accumulation cell set after depression filling and the new potential water accumulation grid cells is no longer a new set of water accumulation cells.
[0082] Execute step S110 to obtain a triangular elevation grid, which includes multiple triangular grid cells and multiple initial water accumulation grid cells, each of which corresponds to an elevation value.
[0083] A triangular elevation grid can be a grid map of a location generated from topographic maps and contour maps, etc. The grid cells in this grid map are composed of structured and / or unstructured triangles, and each triangular grid cell corresponds to an elevation value. Each triangular elevation grid can be composed of multiple triangular grid cells, and the initial water accumulation grid cell is one or more of the multiple triangular grid cells that are determined to form a depression.
[0084] Optionally, the method further includes the step of generating the triangular elevation grid, which includes:
[0085] Obtain the region boundary file and contour map. The region boundary file includes a target region map and user-preset parameters. The contour map is the contour map corresponding to the target region.
[0086] A triangular network is generated based on the target area map and the user-preset parameters.
[0087] By superimposing the triangular mesh with the contour map, a triangular mesh is obtained, which includes multiple triangular units.
[0088] The elevation values of the three corner points of each triangle element in the triangular mesh are extracted, and the average value of the elevation values of the three corner points of each triangle element is calculated and used as the elevation value of each triangle element.
[0089] The elevation values of each of the triangular elements are marked in the triangular grid to obtain the triangular elevation grid.
[0090] Before obtaining a triangular elevation grid, it is necessary to first generate one. This requires acquiring the region boundary file and contour map. The region boundary file is the map of the area (target area) for which depression filling data processing will be performed, along with user-preset parameters. User-preset parameters can include various parameters, such as the minimum / maximum angle of each triangular grid cell, and the minimum / maximum area of each triangular grid cell.
[0091] After obtaining the region boundary file and contour map, a triangular mesh can be generated based on the target region map and user-preset parameters. This results in a structured / unstructured triangular mesh for the region requiring depression filling data processing. This triangular mesh is then overlaid with the data from the contour map to obtain a triangular grid containing multiple triangular units, where each corner of each unit corresponds to an elevation value. The elevation values of the three corner points in each triangular unit are extracted and averaged; this average is used as the elevation value of that triangular unit. Finally, the elevation values of each triangular unit are marked onto the triangular grid, resulting in a triangular elevation grid.
[0092] Optionally, the method further includes the step of determining the initial water accumulation grid cells, which includes:
[0093] Extract the elevation values of each of the triangular mesh elements.
[0094] Determine whether the elevation value of each of the triangular mesh cells is less than the elevation values of each of the triangular mesh cells adjacent to the three sides of the triangular mesh cell.
[0095] If so, then the triangular mesh unit is determined to be the initial water accumulation mesh unit.
[0096] After generating the triangular elevation grid, it is necessary to determine the initial water accumulation grid cells within this grid. The elevation values of each triangular grid cell are extracted. Then, for each triangular grid cell, it is determined whether the elevation values of the three triangular grid cells adjacent to its three sides are all greater than the elevation value of that triangular grid cell. If so, that triangular grid cell is determined as the initial water accumulation grid cell.
[0097] For example, such as Figure 3 As shown, if a triangular elevation grid includes four triangular grid cells A, B, C, and D, with elevation values of 11, 14, 13, and 13 respectively, and B, C, and D are triangular grid cells adjacent to the three sides of A, then A can be determined as the initial water accumulation grid cell.
[0098] Optionally, the triangular elevation grid further includes a river channel that intersects with multiple triangular grid cells; after extracting the elevation values of each triangular grid cell, the method further includes:
[0099] Remove the elevation values of the triangular grid cells that intersect with the river channel from the elevation values of each of the triangular grid cells.
[0100] A river channel serves as an outlet for water flowing through a depression after it has been filled in. Triangular grid cells that the river intersects with can be considered as intersecting with the river. In reality, the terrain along a river channel is generally low-lying, so there may be instances where the elevation of a triangular grid cell intersecting with the river is lower than the elevation of its three adjacent triangular grid cells. When determining the initial water accumulation grid cells, if such triangular grid cells exist, they need to be removed. After extracting the elevation values of each triangular grid cell, the elevation values of the triangular grid cells intersecting with the river need to be removed from the extracted elevation values before determining the initial water accumulation grid cells. This avoids misidentifying such triangular grid cells as initial water accumulation grid cells.
[0101] For example, such as Figure 4 As shown, R represents the river channel, which intersects with triangular grid cells E and G. Triangular grid cells C, F, and G are adjacent to E, with elevation values of 13, 12, and 11 respectively, while the elevation value of E is 10. Therefore, when determining the initial water accumulation grid cells, it is necessary to extract the elevation values of each triangular grid cell and then remove the elevation value of E from the extracted elevation values.
[0102] Step S120 is executed, whereby for each of the initial water accumulation grid cells, at least one potential water accumulation grid cell is determined based on the elevation values of adjacent grid cells; wherein, the adjacent grid cells are triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell.
[0103] After determining the initial water accumulation grid cells in the triangular elevation grid, each initial water accumulation grid cell can be processed sequentially according to a pre-set arrangement. Potential water accumulation grid cells can be triangular grid cells adjacent to the three sides of the initial water accumulation grid cells that will still be identified as depressions after the initial water accumulation grid cells have been filled. For each initial water accumulation grid cell, potential water accumulation grid cells can be determined by its elevation value and the elevation values of adjacent grid cells. For example, adjacent grid cells are identified as potential water accumulation grid cells only if their elevation values are equal and both greater than the elevation value of the initial water accumulation grid cell; or, if the elevation values of adjacent grid cells are all greater than the elevation value of the initial water accumulation grid cell, then all adjacent grid cells are identified as potential water accumulation grid cells.
[0104] It should be noted that, in this description, adjacent grid cells specifically refer to triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell.
[0105] Optionally, determining at least one potential water accumulation grid cell based on the elevation values of adjacent grid cells includes:
[0106] Obtain the elevation values of each of the adjacent grid cells. Compare the magnitudes of the elevation values of the adjacent grid cells.
[0107] If one or more of the adjacent grid cells have the lowest elevation value, then the one or more adjacent grid cells with the lowest elevation value are identified as the potential water accumulation grid cells.
[0108] If the elevation values of all adjacent grid cells are equal, then all of the adjacent grid cells are determined as potential water accumulation grid cells.
[0109] As an optional implementation, when determining potential water accumulation grid cells, the elevation value of the initial water accumulation grid cell being processed and the elevation values of the adjacent grid cells of the initial water accumulation grid cell can be obtained first, and the elevation values of the adjacent grid cells can be compared with the elevation value of the initial water accumulation grid cell. If three adjacent grid cells have different elevation values, and all of them are greater than the elevation value of the initial water-accumulating grid cell, then the one with the smallest elevation value among the three adjacent grid cells is designated as the potential water-accumulating grid cell. If two of the three adjacent grid cells have the same elevation value and are greater than the other, and all three adjacent grid cells have elevation values greater than the initial water-accumulating grid cell, then the adjacent grid cell with the smallest elevation value is designated as the potential water-accumulating grid cell. If two of the three adjacent grid cells have the same elevation value and are less than the other, and all three adjacent grid cells have elevation values greater than the initial water-accumulating grid cell, then the two adjacent grid cells with the smallest elevation values are designated as potential water-accumulating grid cells. If all three adjacent grid cells have the same elevation value and are greater than the initial water-accumulating grid cell, then all three adjacent grid cells are designated as potential water-accumulating grid cells.
[0110] by Figure 3 or Figure 4 Taking the triangular elevation grid shown as an example, A is the initial water accumulation grid cell, and its adjacent grid cells are B, C, and D. Among them, the elevation values of C and D are equal, and the elevation value of C is less than that of B and greater than that of A. Therefore, C and D are determined as potential water accumulation grid cells.
[0111] Step S130 is executed, in which the initial water accumulation grid cell is filled with depressions based on the elevation value of the potential water accumulation grid cell.
[0112] To allow water to drain from the initial water-filled grid cells, these cells need to be filled. In a triangular elevation grid, this filling can be achieved by changing the elevation value of the initial water-filled grid cells, thus simulating the effect of filling.
[0113] Optionally, filling depressions in the initial water-accumulating grid cells based on the elevation values of the potential water-accumulating grid cells includes:
[0114] Obtain the elevation value of the potential water accumulation grid cell.
[0115] The elevation values of the initial water accumulation grid cells are deleted, and the elevation values of the potential water accumulation grid cells are assigned to the initial water accumulation grid cells, thus completing the filling of depressions in the initial water accumulation grid cells.
[0116] As an optional implementation, the elevation value of the initial water accumulation grid cell can be modified to the elevation value of the potential water accumulation grid cell, so that the elevation values of the initial water accumulation grid cell and the potential water accumulation grid cell are the same, thereby completing the filling of depressions in the initial water accumulation grid cell.
[0117] like Figure 5 As shown, if A is determined to be the initial water accumulation grid cell, and C and D are potential water accumulation grid cells, and A needs to be filled, then the elevation value of A is changed from 11 to 13, and the initial water accumulation grid cell after filling is A'.
[0118] Execute step S140 to determine whether the combination of the initial water accumulation grid unit and the potential water accumulation grid unit after filling the depression is a water accumulation unit set.
[0119] After filling the depressions in the initial water accumulation grid cells, it is necessary to determine whether the combination of the initial water accumulation grid cells and the potential water accumulation grid cells after filling has formed a larger depression (i.e., a set of water accumulation cells) to determine whether to continue filling the depressions or complete the filling process.
[0120] Optionally, determining whether the combination of the initial water-accumulating grid cells and the potential water-accumulating grid cells after filling the depression constitutes a set of water-accumulating cells includes:
[0121] The elevation values of the triangular grid cells adjacent to each side of the polygonal grid formed by the initial water accumulation grid and the potential water accumulation grid cells after filling the depression are obtained respectively.
[0122] Determine whether there exists an elevation value of a triangular grid cell that is smaller than the elevation value of the initial water accumulation grid and / or the potential water accumulation grid cell after filling the depression.
[0123] If not, then the combination of the initial water accumulation grid unit after filling the depression and the potential water accumulation grid unit is determined to be the water accumulation unit set.
[0124] As an optional embodiment, when determining a set of water accumulation units, the initial water accumulation grid units and potential water accumulation grid units after filling depressions can be considered as a single grid unit (i.e., a combination of the initial water accumulation grid units and potential water accumulation grid units after filling depressions). The elevation values of the triangular grid units adjacent to each edge of this single grid unit are compared with the elevation value of the single grid unit (since the initial water accumulation grid units are filled, their elevation values are the same as the potential water accumulation grid units). If the elevation values of the triangular grid units adjacent to each edge of this single grid unit are all greater than the elevation value of the single grid unit, then it is determined to be a set of water accumulation units.
[0125] For example, such as Figure 6 As shown, A' is the initial water accumulation grid cell after filling the depression, and its elevation value is equal to that of the two potential water accumulation grid cells C and D, both being 13. The combination of A', C, and D forms a pentagonal grid, and its adjacent triangular grids are B, E, F, G, and H, with elevation values of 14, 14, 15, 15, and 16 respectively, all higher than the combination formed by A', C, and D. Therefore, the combination formed by A', C, and D is determined to be a set of water accumulation cells.
[0126] If step S150 is executed, then new potential water accumulation grid cells are determined based on the set of water accumulation cells, and the water accumulation cell set is filled with depressions based on the new potential water accumulation grid cells until the combination of the water accumulation cell set after depression filling and the new potential water accumulation grid cells is no longer a new set of water accumulation cells.
[0127] When the combination of the initial water-collecting grid cell after depression filling and the potential water-collecting grid cell is determined to be a water-collecting unit set, it is necessary to continue to determine the potential water-collecting grid cells around the water-collecting unit set in the same way as determining potential water-collecting grid cells. Then, it is further determined whether the water-collecting unit set and the newly determined potential water-collecting grid cells are a new water-collecting unit set after depression filling... until there is a combination of the water-collecting unit set after depression filling and the newly determined potential water-collecting grid cells that is no longer a new water-collecting unit set, then the depression filling process for the initial water-collecting grid cell is complete. Save the depression filling process data for the initial water-collecting grid cell (e.g., the elevation value of each depression filling), and start the depression filling process for the next initial water-collecting grid cell.
[0128] As an optional implementation, a preset threshold for the number of times a depression can be filled can be set. If the number of times a depression can be filled for the same initial water accumulation grid cell reaches the preset threshold, then filling the depression for that initial water accumulation grid cell will be stopped, and a depression filling failure will be marked.
[0129] Optionally, the method further includes:
[0130] Determine whether the triangular grid cell adjacent to the potential water accumulation grid cell intersects with the river channel.
[0131] If not, then continue to determine whether the elevation value of the potential water accumulation grid cell is greater than the elevation value of the triangular grid cell adjacent to the potential water accumulation grid cell.
[0132] If so, the initial water accumulation grid unit or the set of water accumulation units is filled based on the potential water accumulation grid unit, and the next initial water accumulation grid unit is processed after the water accumulation is completed.
[0133] Since the river channel represents the outlet of water flow, when filling a depression in an initial water-collecting grid cell, if during the filling process, one or more adjacent triangular grid cells intersect the river channel, and the elevation value of these triangular grid cells is lower than that of the potential water-collecting grid cells, then after filling the depression to the elevation value of the potential water-collecting grid cells, it signifies that the water flow in the depression has been introduced into the river, completing the filling of the initial water-collecting grid cell, and the process begins for filling the next initial water-collecting grid cell.
[0134] For example, such as Figure 7 As shown, A is the initial water-accumulating grid cell, C and D are potential water-accumulating grid cells, R is the river channel, and E is a triangular grid cell adjacent to the potential water-accumulating grid cell. Since E intersects the river channel R, and the elevation value of E is less than that of C, after filling the depression in A to 13, the water flow in the new grid cell formed by A, C, and D can flow into the river channel from E, completing the depression-filling treatment of A.
[0135] Based on the same inventive concept, such as Figure 8 As shown in the figure, an embodiment of the present invention provides a depression filling data processing device 300, comprising:
[0136] The triangle elevation grid acquisition module 301 is used to acquire a triangle elevation grid, which includes multiple triangle grid cells and multiple initial water accumulation grid cells, and each triangle grid cell or the initial water accumulation grid cell corresponds to an elevation value.
[0137] The first potential water accumulation grid cell determination module 302 is used to determine at least one potential water accumulation grid cell for each of the initial water accumulation grid cells based on the elevation values of adjacent grid cells; wherein the adjacent grid cells are triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell.
[0138] The depression-filling module 303 is used to fill depressions in the initial water accumulation grid unit based on the elevation value of the potential water accumulation grid unit.
[0139] The water accumulation unit set determination module 304 is used to determine whether the combination of the initial water accumulation grid unit and the potential water accumulation grid unit after filling the depression is a water accumulation unit set.
[0140] The second potential water accumulation grid cell determination module 305 is used to determine a new potential water accumulation grid cell based on the water accumulation cell set when the combination of the initial water accumulation grid cell after filling the depression and the potential water accumulation grid cell is a water accumulation cell set, and to fill the depression of the water accumulation cell set based on the new potential water accumulation grid cell, until the combination of the water accumulation cell set after filling the depression and the new potential water accumulation grid cell is no longer a new water accumulation cell set.
[0141] Regarding the aforementioned depression filling data processing device 300, the specific functions of each unit have been described in detail in the embodiments of the depression filling data processing method provided in this specification, and will not be elaborated here.
[0142] Based on the same inventive concept, embodiments of this invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods in the aforementioned depression-filling data processing method.
[0143] The present invention has at least the following beneficial effects:
[0144] By acquiring a triangular elevation grid, potential water-accumulating grid cells are determined based on the elevation values of the initial water-accumulating grid cells (i.e., adjacent grid cells), and depressions in the initial water-accumulating grid cells are filled. If the combination of the filled initial water-accumulating grid cells and the potential water-accumulating grid cells forms a set of water-accumulating cells, new potential water-accumulating grid cells are determined based on this set, until the combination of the filled water-accumulating cell set and the new potential water-accumulating grid cells does not form a new set of water-accumulating cells. Since this method can be used with both structured and unstructured triangular grids, the accuracy of depression-filling is higher, thereby improving the accuracy of hydrological calculations.
[0145] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0146] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0147] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, 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 invention. 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.
[0148] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for processing depression filling data, characterized in that, The method includes: Obtain a triangular elevation grid, which includes multiple triangular grid cells and multiple initial water accumulation grid cells, each of the triangular grid cells or the initial water accumulation grid cells corresponding to an elevation value; For each initial water accumulation grid cell, at least one potential water accumulation grid cell is determined based on the elevation values of adjacent grid cells; wherein, the adjacent grid cells are triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell; Based on the elevation values of the potential water accumulation grid cells, the initial water accumulation grid cells are filled with depressions; Determine whether the combination of the initial water accumulation grid unit and the potential water accumulation grid unit after filling the depression is a water accumulation unit set, wherein the water accumulation unit set is the depression formed by the combination of the initial water accumulation grid unit and the potential water accumulation unit after filling the depression; If so, then new potential water accumulation grid units are determined based on the set of water accumulation units, and the water accumulation unit set is filled with depressions based on the new potential water accumulation grid units, until the combination of the water accumulation unit set after depression filling and the new potential water accumulation grid units is no longer a new set of water accumulation units.
2. The method for processing depression-filling data as described in claim 1, characterized in that, The method further includes the step of generating the triangular elevation grid, which includes: Obtain the region boundary file and contour map. The region boundary file includes a target region map and user-preset parameters. The contour map is the contour map corresponding to the target region. Based on the target area map and the user-preset parameters, a triangular network is generated; By superimposing the triangular mesh with the contour map, a triangular mesh is obtained, which includes multiple triangular elements. Extract the elevation values of the three corner points of each triangle element in the triangular mesh, calculate the average value of the elevation values of the three corner points of each triangle element, and use them as the elevation values of each triangle element. The elevation values of each of the triangular elements are marked in the triangular grid to obtain the triangular elevation grid.
3. The method for processing depression-filling data as described in claim 2, characterized in that, The method further includes the step of determining the initial water accumulation grid cells, which includes: Extract the elevation values of each of the aforementioned triangular mesh elements; Determine whether the elevation value of each of the triangular mesh cells is less than the elevation values of each of the triangular mesh cells adjacent to the three sides of the triangular mesh cell. If so, then the triangular mesh unit is determined to be the initial water accumulation mesh unit.
4. The method for processing depression-filling data as described in claim 1, characterized in that, The step of determining at least one potential water accumulation grid cell based on the elevation values of adjacent grid cells includes: Obtain the elevation values of each of the adjacent grid cells; Compare the elevation values of each of the adjacent grid cells; If one or more of the adjacent grid cells have the lowest elevation value, then the one or more adjacent grid cells with the lowest elevation value are identified as the potential water accumulation grid cells. If the elevation values of all adjacent grid cells are equal, then all of the adjacent grid cells are determined as potential water accumulation grid cells.
5. The method for processing depression-filling data as described in claim 1, characterized in that, The process of filling depressions in the initial water-accumulating grid cells based on the elevation values of the potential water-accumulating grid cells includes: Obtain the elevation value of the potential water accumulation grid cell; The elevation values of the initial water accumulation grid cells are deleted, and the elevation values of the potential water accumulation grid cells are assigned to the initial water accumulation grid cells, thus completing the filling of depressions in the initial water accumulation grid cells.
6. The method for processing depression-filling data as described in claim 5, characterized in that, The determination of whether the combination of the initial water accumulation grid cells and the potential water accumulation grid cells after filling the depression constitutes a water accumulation cell set includes: The elevation values of the triangular grid cells adjacent to each side of the polygonal grid formed by the initial water accumulation grid and the potential water accumulation grid cells after filling the depression are obtained respectively. Determine whether there exists a triangular grid cell whose elevation value is smaller than that of the initial water accumulation grid and / or the potential water accumulation grid cell after filling the depression; If not, then the combination of the initial water accumulation grid unit after filling the depression and the potential water accumulation grid unit is determined to be the water accumulation unit set.
7. The method for processing depression-filling data as described in claim 3, characterized in that, The triangular elevation grid also includes a river channel, which intersects with multiple triangular grid cells; After extracting the elevation values of each of the triangular mesh cells, the method further includes: Remove the elevation values of the triangular grid cells that intersect with the river channel from the elevation values of each of the triangular grid cells.
8. The method for processing depression-filling data as described in claim 7, characterized in that, The method further includes: Determine whether the triangular grid cell adjacent to the potential water accumulation grid cell intersects with the river channel; If not, then continue to determine whether the elevation value of the potential water accumulation grid cell is greater than the elevation value of the triangular grid cell adjacent to the potential water accumulation grid cell; If so, the initial water accumulation grid unit or the set of water accumulation units is filled based on the potential water accumulation grid unit, and the next initial water accumulation grid unit is processed after the water accumulation is completed.
9. A data processing device for filling depressions, characterized in that, The depression filling data processing device includes: A triangle elevation grid acquisition module is used to acquire a triangle elevation grid, which includes multiple triangle grid cells and multiple initial water accumulation grid cells, and each triangle grid cell or the initial water accumulation grid cell corresponds to an elevation value. The first potential water accumulation grid cell determination module is used to determine at least one potential water accumulation grid cell for each of the initial water accumulation grid cells based on the elevation values of adjacent grid cells; wherein, the adjacent grid cells are triangular grid cells that are adjacent to the three sides of the initial water accumulation grid cell; The depression-filling module is used to fill depressions in the initial water-accumulating grid cells based on the elevation values of the potential water-accumulating grid cells. The water accumulation unit set determination module is used to determine whether the combination of the initial water accumulation grid unit and the potential water accumulation grid unit after filling the depression is a water accumulation unit set, wherein the water accumulation unit set is the depression formed by the combination of the initial water accumulation grid unit and the potential water accumulation unit after filling the depression; The second potential water accumulation grid cell determination module is used to determine a new potential water accumulation grid cell based on the water accumulation cell set when the combination of the initial water accumulation grid cell after filling the depression and the potential water accumulation grid cell set is a water accumulation cell set, and to fill the depression of the water accumulation cell set based on the new potential water accumulation grid cell set until the combination of the water accumulation cell set after filling the depression and the new potential water accumulation grid cell set is no longer a new water accumulation cell set.
10. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Filling processing method of digital elevation model depression
CN102542607A
Drainage basin depression processing method based on digital elevation model (DEM)
CN115688435A