A method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation

By using a vector-based distributed hydrological model and processing river and flow files with Python code, a spatial distribution map of flow is generated. This solves the problems of unclear river distribution and inaccurate flow representation in traditional methods, and achieves a more accurate spatial distribution of flow.

CN119783428BActive Publication Date: 2025-10-28CHINA YANGTZE POWER
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411618215.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-10-28
Estimated Expiration
2044-11-13

AI Technical Summary

Technical Problem

Traditional lumped models are insufficient in spatial characterization of river flow within a watershed, while distributed hydrological models cannot accurately represent the spatial distribution of flow. Existing methods cannot obtain the flow distribution across the entire watershed.

Method used

A vector-based distributed hydrological model is adopted. By collecting hourly rainfall data, a vector river system map is constructed. Python code is used to process river and flow files to generate a spatial distribution map of flow. The river classification threshold is adjusted to achieve standardized distribution of flow.

Benefits of technology

It improves the accuracy of spatial distribution of flow, and can more accurately display the spatial characteristics of flow in distributed hydrological models, solving the problems of unclear river distribution and inaccurate flow expression in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783428B_ABST
    Figure CN119783428B_ABST
Patent Text Reader

Abstract

This invention discloses a method for simulating spatial distribution of flow using a distributed hydrological model based on vector representation. The method includes: using the VIC model to perform river network division and river flow simulation for a watershed; generating a vector hydrographic map of the watershed based on the river files generated from the VIC model's river network division and the watershed boundaries; constructing a river number file within the vector hydrographic map of the watershed based on fusion units and the river files; reconstructing the topologically reconstructed vector hydrographic map based on the vector hydrographic map and fusion units, and generating a list file of the flow magnitudes corresponding to each numbered river by combining it with the output flow file; calculating the sum of all flow values ​​related to each river to generate an intermediate file, which is then associated with the topologically reconstructed vector hydrographic map to obtain a non-standardized spatial distribution map of watershed flow; color-coding is performed to finally obtain a standardized spatial distribution map of watershed flow. This invention can significantly improve the accuracy of spatial distribution of flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for simulating the spatial distribution of flow using a distributed hydrological model based on vector representation, belonging to the field of watershed simulation technology. Background Technology

[0002] Traditional lumped-array models are insufficient for spatially characterizing river flow within a watershed. Distributed hydrological models can not only depict the changes in river flow over time but also provide a spatial representation of river flow within the watershed. Furthermore, most traditional methods for spatially representing flow are based on raster files. This approach suffers from unclear river distribution and inaccurate flow representation when generating rivers. Therefore, effectively and accurately determining the flow value for each river segment in the field of spatial flow representation is a problem worthy of further research.

[0003] The river network delineation method based on the Variable Infiltration Capacity (VIC) model, which integrates grids and sub-basins, utilizes high-resolution digital elevation model (DEM) data to extract real river characteristics, determine grid flow direction, and ensure the uniformity of confluence paths for each grid's represented area. Existing methods first determine the reasonable maximum catchment area point for each grid, using this point as the grid control point. Based on this, flow direction information generated by the high-precision DEM is used to obtain the range of the grid control unit and the grid paths between control points; the path length is taken as the inter-grid channel length. Based on this river network delineation, the VIC model uses sub-basin confluence schemes to obtain sub-basin response functions, performs intra-basin regulation calculations, uses a parameterized scheme to obtain river confluence parameters, substitutes them into the diffusion wave formula to obtain the river response function, and performs river confluence calculations to obtain the outlet cross-section flow process. However, existing techniques cannot obtain the flow distribution across the entire watershed space; they can only characterize the temporal evolution of flow. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method for simulating the spatial distribution of flow using a distributed hydrological model based on vector representation. By using a distributed hydrological model based on vector representation to simulate flow, the spatial characteristics of the flow in the distributed model can be displayed more accurately.

[0005] To achieve the above objectives, the present invention is implemented using the following technical solution:

[0006] This invention provides a method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation, comprising:

[0007] Collect hourly rainfall data for a specific watershed within a specified time period, and perform river network division and river flow simulation for the watershed within the specified time period based on a distributed hydrological model to obtain river files, watershed boundary files, output flow files, and fusion unit flow files;

[0008] Based on the river file and the watershed boundary file, construct a vector river system map of the watershed within the specified time period;

[0009] Based on the fusion unit flow file and river file, a river number file is constructed in the vector water system map of the basin within the specified time period;

[0010] Based on the river number file and the vector water system map constructed, as well as the output flow file and the fusion unit flow file, a list file of the flow size corresponding to each numbered river in the vector water system map of the basin within the specified time period and a vector water system map after reconstructing the topology are generated.

[0011] Based on the list file and the vector river system map after reconstructing the topology, an intermediate file that can be associated with the vector river system map is generated, and the vector river system map after reconstructing the topology is associated with the intermediate file to obtain a non-standardized spatial distribution map of the watershed within the specified time period;

[0012] Based on the flow rate within the specified time period, the river classification threshold is adjusted to obtain a standardized spatial distribution map of the flow rate in the basin within the specified time period.

[0013] Preferably, the step of constructing a vector hydrographic map of the watershed within the specified time period based on the river file and the watershed boundary file is implemented using Python code, including:

[0014] Read the ASCII format raster data array from the river file;

[0015] Traverse the raster data array, identify adjacent cells with the same value, and convert the coordinates of these cells into line objects;

[0016] The extracted line objects are saved as Shapefile format to obtain a vector water system map of the watershed within the specified time period.

[0017] Preferably, during the traversal process, a breadth-first search algorithm is used to find connecting paths between graticles with the same value to ensure that the extracted lines are continuous; and the boundary points of the lines are identified, and boundary and angle checks are performed to ensure that the lines conform to the actual geographical features.

[0018] Preferably, the step of constructing a river number file in the vector drainage map of the watershed within the specified time period based on the fusion unit flow file and river file is implemented using Python code, including:

[0019] Read the river segments in the river file and the fusion unit grid in the fusion unit flow file, and define a data processing function to convert the data of specific fields into long integers suitable for calculation;

[0020] Calculate the distance between the starting and ending points of the river segment and each fusion unit grid point, find the grid points whose distance is less than the set limit as the best match, and generate a river number file in the vector water system map.

[0021] Preferably, the vector water system map after reconstructing the topological relationships includes:

[0022] Read the attribute table and the coordinates of the first and last nodes of each shape from the vector water system map, and generate a dictionary containing unique node IDs, where the latitude and longitude of the nodes are used as keys;

[0023] Starting from the specified outflow node, the topological relationship of the river is constructed upwards using a breadth-first search algorithm;

[0024] After completing the topology reconstruction, the updated data is exported to a CSV file, and the attribute table of the vector water system map is updated at the same time to obtain the vector water system map after the topology is reconstructed.

[0025] Preferably, generating a list file of the flow rates corresponding to each numbered river in the vector drainage map of the basin within the specified time period includes:

[0026] Based on the output flow file, obtain the flow data of the watershed within the specified time period;

[0027] Based on the river unique node ID in the attribute table of the vector water system map after the topological relationship is reconstructed, the river number is obtained from the river number file;

[0028] By correlating the river numbers with the flow data, a list file is generated showing the flow magnitude of each numbered river in the vector water system map of the basin within the specified time period.

[0029] Preferably, the step of generating an intermediate file that can be associated with the vector river system map based on the list file and the vector river system map after reconstructing the topology, and associating the vector river system map after reconstructing the topology with the intermediate file to obtain a non-standardized spatial distribution map of the watershed within the specified time period, is implemented based on Python code, including:

[0030] Read the river number file and the list file, and create a dictionary that maps river numbers to corresponding flow values;

[0031] Iterate through the dictionary, calculate the sum of all flow values ​​associated with each river, and store the results in a new column Q;

[0032] Read the vector water system map after reconstructing the topology, extract the shape and record information, and create a new Shapefile file. Copy the field definitions in the vector water system map after reconstructing the topology and add a new field Q to store the calculated flow value to form an intermediate file.

[0033] The vector water system map records, shapes, and calculated flow values ​​after the topological relationship is reconstructed are traversed. Each calculated flow value is appended to a record, and these records and shape information are written into a newly created Shapefile file to generate a non-standardized flow spatial distribution map of the watershed within the specified time period.

[0034] Preferably, adjusting the river classification threshold based on the flow rate within the specified time period to obtain a standardized spatial distribution map of the flow rate in the basin within the specified time period includes:

[0035] Based on the flow rate within the specified time period, the river classification threshold is adjusted, and the river classification color and image background color are set using a standard river classification color setting file and an image background color setting file to obtain a standardized spatial distribution map of the flow rate of the basin within the specified time period.

[0036] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0037] This invention proposes a method for simulating the spatial distribution of flow using a distributed hydrological model based on vector representation. Building upon the river flow simulated by the VIC (Variable Infiltration Capacity) model, relevant Python code is used to re-analyze the generated files. Hydrological analysis tools are then used to present the originally quantified flow and channel information as a vector river system map. This not only demonstrates the advantages of distributed models in simulating flow at spatial scales but also showcases the flow process at the watershed outlet section over time. Attached Figure Description

[0038] Figure 1 A flowchart illustrating a method for simulating spatial distribution of discharge using a vector-based distributed hydrological model, as provided in an embodiment of the present invention.

[0039] Figure 2This is a diagram illustrating the VIC (Variable Infiltration Capacity) model convergence scheme in an embodiment of the present invention.

[0040] Figure 3 This is a schematic diagram of the spatial distribution of traffic flow in an embodiment of the present invention where the distribution method provided by the present invention is not used.

[0041] Figure 4 This is a schematic diagram of the spatial distribution of flood discharge during a flood process using the distribution method provided by the present invention in an embodiment of the present invention. Detailed Implementation

[0042] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The embodiments described below with reference to the accompanying drawings are illustrative and intended to explain the present invention, and should not be construed as limiting the present invention.

[0043] It should be noted that, as used in this invention, "an embodiment" or "embodiment" refers to a specific feature, structure, or characteristic that can be included in at least one implementation of this invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that excludes other embodiments.

[0044] It should be emphasized here that the step markers mentioned below are not a limitation on the order of the steps, but should be understood as meaning that the steps can be executed in the order mentioned in the embodiments, or in a different order than in the embodiments, or several steps can be executed simultaneously. Example 1

[0045] like Figure 1 As shown in Embodiment 1, this method provides a distributed hydrological model based on vector representation to simulate the spatial distribution of discharge, including:

[0046] S01: Based on the national digital elevation model with a spatial resolution of 30 meters, the VIC (Variable Infiltration Capacity) model is used to perform river network division and river flow simulation for a specific time in a certain watershed, and obtain the river (Basin_river.asc) file, watershed boundary (Area.shp) file, output flow (Discharge.nc) file, and fusion unit flow (Q.csv) file;

[0047] S02: Based on the river file and watershed boundary file generated by the VIC model, use Python code (Raster_to_polyline.py) to generate a vector river system map (River2.shp) for the watershed.

[0048] S03: Based on the fusion unit flow file and river file generated by the VIC model, use Python code (Gridcode_link.py) to construct the river number (Basin_up_river.csv) file in the vector watershed map of the basin;

[0049] S04: Based on the river number file and vector river map of the watershed constructed above, generate the output flow (Discharge.nc) file and fusion unit flow (Q.csv) file based on the VIC (Variable Infiltration Capacity) model, and use Python code (Reconstruct_River_Topo.py) to generate a list of the flow size corresponding to each numbered river in the vector river map at a specified time (River_codelist2.csv) file and a vector river map after reconstructing the topology (river_updated2.shp).

[0050] S05: Based on the list file of the flow magnitude of each numbered river in the vector river system map of the watershed at a specified time generated above, and the vector river system map after reconstructing the topology, use Python code (Add_River_Q.py) to generate an intermediate file (River_matchgrid.csv) that can be associated with the vector river system map, and associate the vector river system map after reconstructing the topology with the intermediate file to output a non-normalized flow spatial distribution map (Q.shp) of the watershed at a specified time.

[0051] S06: Adjust the river classification threshold based on the flow rate at a specified time. Set the river classification color and image background color to obtain a standardized spatial distribution map of the flow rate in the basin at a specified time (Q_2020_8_15_00.shp).

[0052] The flow spatial distribution method based on the embodiments of the present invention can more accurately display the spatial characteristics of flow in distributed hydrological models and improve the accuracy of flow spatial distribution.

[0053] In one specific embodiment of the present invention, step S01 includes the following steps:

[0054] S011: Collect hourly rainfall data for a specific time period in a watershed and preprocess the data to meet the input requirements of the VIC model, determine the watershed boundary, and process the watershed digital elevation model information using hydrological processing tools.

[0055] S012: Run the VIC model to collect output files, namely the river (Basin_river.asc) file, the watershed boundary (Area.shp) file, the output flow (Discharge.nc) file, and the fusion unit flow (Q.csv) file, so that the Python code can run it later.

[0056] In one specific embodiment of the present invention, step S02 is implemented as follows:

[0057] This step, implemented using Python code (Raster_to_polyline.py), converts the ASCII raster data from the river (Basin_river.asc) file into Shapefile-formatted line data. Specifically, it first reads the ASCII raster data from the river (Basin_river.asc) file using the `read_asc_file` function and performs efficient data processing using NumPy arrays. Next, it iterates through the raster data array using the `array_to_lines_and_nodes` function, identifying adjacent cells with the same values ​​and converting their coordinates into line objects. During this process, the `trace_path` function uses a breadth-first search (BFS) algorithm to find connecting paths between rasters with the same values, ensuring the extracted lines are continuous. Simultaneously, the `get_boundary_points` function identifies the line boundary points and performs boundary and angle checks to ensure the lines conform to actual geographical features. Finally, the `save_lines_to_shapefile` function saves the extracted lines as a Shapefile, resulting in a vector river system map of the watershed (River2.shp).

[0058] In one specific embodiment of the present invention, step S03 is implemented as follows:

[0059] This step is implemented using Python code (Gridcode_link.py). Specifically, it matches river segments with fused cell grids by calculating distances. First, the CSV function library is used to read the CSV files of river segments and fused cell grids generated by the VIC (Variable Infiltration Capacity) model, and a data processing function is defined to convert data in specific fields into long integers suitable for calculation. Next, the function `find_matching_grid_codes` calculates the distances between the start and end points of the river segments and each fused cell grid point according to given distance constraints, identifying grid points with distances less than the set constraints as the best match. The entire process aims to ensure that the best match between river segments and fused cell grids is found within a certain distance range, avoiding incorrect matches, and ultimately generating a CSV file of river numbers for easy subsequent analysis and use.

[0060] In one specific embodiment of the present invention, step S04 is implemented as follows:

[0061] S041: This step is implemented based on Python code (Reconstruct_River_Topo.py). Specifically, it reads geographic data in Shapefile format, processes and analyzes the data using the Pandas library, and displays the processing progress using the Tqdm library. First, it reads the attribute table and the coordinates of the first and last nodes of each shape from the vector river system map (River2.shp), then generates a dictionary containing unique node IDs, with the node's latitude and longitude as the key. Next, starting from the specified outflow node (the latitude and longitude coordinates of the watershed outlet section), it uses a breadth-first search (BFS) algorithm to construct the river's topology upwards. After completing the topology reconstruction, the updated data is exported to a CSV file, and the attribute table of the vector river system map (River2.shp) is updated simultaneously. The entire process includes reading the Shapefile, generating unique node IDs, constructing topological relationships, updating Shapefile attributes, and exporting CSV. The code function is to reconstruct the topological structure of the rivers in the study area and obtain an updated vector river system map (river_updated2.shp) for a specific time in a watershed, which is convenient for subsequent analysis and use.

[0062] S042: Based on the river number (Basin_up_river.csv) file in the vector river map of the study area and the river unique node ID, topological relationship and flow size in the attribute table of the updated vector river map of a certain watershed at a specified time (river_updated2.shp), a list of flow sizes corresponding to each numbered river (River_codelist2.csv) file can be obtained.

[0063] In one specific embodiment of the present invention, step S05 is implemented as follows:

[0064] This step is implemented using Python code (Add_River_Q.py). Specifically, it extracts flow values ​​from the list file (River_codelist2.csv) and integrates them into the river's Shapefile geographic data file. The principle is as follows: First, the pandas library reads the river ID (Basin_up_river.csv) file containing river and fusion cell grid matching information, and the River_codelist2.csv file containing river IDs and their corresponding flow values. Then, a dictionary mapping IDs to flow values ​​is created for easy lookup. Next, the tqdm library is used to display a progress bar, iterate through the dictionary of matching information, calculate the sum of all flow values ​​related to each river, and store the result in a new column Q. Afterward, the Shapefile library is used to read the reconstructed topological vector river map (river_updated2.shp), extract its shape and record information, and create a new Shapefile, copying the original field definitions and adding a new field Q to store the calculated flow values. Finally, the original records, shapes, and calculated Q values ​​are traversed, the Q value of each record is appended to the record, and these records and shape information are written into a new Shapefile to generate a non-normalized spatial distribution map of the flow in the watershed at a specified time (Q.shp).

[0065] In one specific embodiment of the present invention, step S06 is implemented as follows:

[0066] The river classification threshold is adjusted based on the flow rate at a specified time. Simultaneously, the river classification colors and image background colors are set using the standard river classification color setting file (Png_color_Q.ini) and the image background color setting file (Bak_color_Q.ini), resulting in a standardized spatial distribution map of flow rate for a specific watershed at a specified time (Q_2020_8_15_00.shp). Example 2

[0067] Based on the inventive concept of Embodiment 1 above, Embodiment 2 uses the method of Embodiment 1 to study the Jialing River basin (Tingzikou-Beibei section) as an example area, taking 00:00 on August 15, 2020 as the selected time for the method. The specific implementation process is as follows:

[0068] First, a river network is delineated for a watershed using the VIC (Variable Infiltration Capacity) model. This involves obtaining the flow direction and runoff accumulation of grid points based on a high-resolution digital elevation model. The point with the largest catchment area in the larger grid is determined based on the runoff accumulation and serves as the grid control point. The next control point is searched downstream using these grid control points, and the distance between two control points is determined. A criterion of 0.5 times the grid length is used to eliminate control points that do not represent the main catchment area of ​​the grid. If the distance is greater than 0.5 times the larger grid length, it is considered a valid downstream grid control point, and the length of the runoff path between the two control points is the river channel distance between the two grids. Otherwise, the downstream grid control point is replaced with a secondary control point, and the search continues downstream until the condition is met. Using the final determined grid control points and the grid flow direction file, the search continues downstream until the first downstream grid control point is found. The grid containing this control point is the downstream grid of that grid. Using the finalized grid control points and raster flow direction file, a downstream search is performed until the first downstream grid control point is found. The grid containing this control point is the downstream grid. The inter-grid channel distances were obtained in the first step. Based on the location of the grid control points, the elevation of each grid control point is obtained from the high-resolution digital elevation model data, representing the elevation of the entire grid. The catchment areas of the control points are sorted from smallest to largest, and the upstream catchment area of ​​each control point is searched sequentially until a boundary or upstream control point is found. This yields the catchment area and control region of each control point.

[0069] Subsequently, based on the river (Basin_river.asc) file and watershed boundary (Area.shp) generated from the river network delineation using the VIC (Variable Infiltration Capacity) model, a vector river system map (River2.shp) for the study area was constructed using Python code (Raster_to_polyline.py). Based on the discharge (Discharge.nc) file output by the VIC (Variable Infiltration Capacity) model, discharge data at the outlet section of a specific watershed within a specified time period can be obtained. Using Python code (Gridcode_link.py), the corresponding number (Basin_up_river.csv) file for each river in the vector river system map (River2.shp) was obtained from the river (Basin_river.asc) file.

[0070] Then, based on the fusion unit file generated by the VIC (Variable Infiltration Capacity) model, the river number (Basin_up_river.csv) file within the watershed, and the river flow data, Python code (Reconstruct_River_Topo.py) was used to construct a list of the flow size corresponding to each numbered river in the vector river system map at a specified time (River_codelist2.csv) file, and generate a vector river system map after reconstructing the topology (river_updated2.shp).

[0071] The Python code (Add_River_Q.py) is used to generate an intermediate file (River_matchgrid.csv) that can be associated with the vector river map (river_updated2.shp) after the topology is reconstructed. The vector river map (river_updated2.shp) after the topology is reconstructed and the intermediate file (River_matchgrid.csv) are associated to output a non-standardized flow spatial distribution map (Q.shp).

[0072] Finally, adjust the river classification threshold based on the flow rate at a specified time. Set the river classification color and image background color to obtain a standardized spatial distribution map of flow (Q_2020_8_15_00.shp).

[0073] like Figure 2 The diagram shown illustrates the principle of river network division using the VIC (Variable Infiltration Capacity) model in step S1 of this embodiment. It demonstrates that the present invention performs subsequent flow distribution work based on the flow simulation of the distributed hydrological model—VIC (Variable Infiltration Capacity) model.

[0074] like Figure 3 and Figure 4 The diagram shows the spatial distribution of traffic flow depending on whether this method is used. Figure 3 For the spatial distribution of flow that does not employ the method of this invention, a magnified view of a section of the river reveals unequal flow rates (i.e., different colors). Figure 4 The flow spatial distribution using this invention shows the flood process in the Jialing River Basin (Tingzikou-Beibei section) on August 15, 2020. Because this invention uses code integration, it can not only quickly generate the flow spatial distribution of the study area at various times, but also solve the problem of unequal river flow.

[0075] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0076] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0077] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0078] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation, characterized in that, include: Collect hourly rainfall data for a specific watershed within a specified time period, and perform river network division and river flow simulation for the watershed within the specified time period based on a distributed hydrological model to obtain river files, watershed boundary files, output flow files, and fusion unit flow files; Based on the river file and the watershed boundary file, construct a vector river system map of the watershed within the specified time period; Based on the fusion unit flow file and river file, a river number file is constructed in the vector water system map of the basin within the specified time period; Based on the river number file and the vector water system map constructed, as well as the output flow file and the fusion unit flow file, a list file of the flow size corresponding to each numbered river in the vector water system map of the basin within the specified time period and a vector water system map after reconstructing the topology are generated. Based on the list file and the vector river system map after reconstructing the topology, an intermediate file that can be associated with the vector river system map is generated, and the vector river system map after reconstructing the topology is associated with the intermediate file to obtain a non-standardized spatial distribution map of the watershed within the specified time period; Based on the flow rate within the specified time period, the river classification threshold is adjusted to obtain a standardized spatial distribution map of the flow rate in the basin within the specified time period.

2. The method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation according to claim 1, characterized in that, The construction of a vector drainage map of the watershed within a specified time period, based on the river file and the watershed boundary file, is implemented using Python code and includes: Read the ASCII format raster data array from the river file; Traverse the raster data array, identify adjacent cells with the same value, and convert the coordinates of these cells into line objects; The extracted line objects are saved as Shapefile format to obtain a vector water system map of the watershed within the specified time period.

3. The method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation according to claim 2, characterized in that, During the traversal, a breadth-first search algorithm is used to find connecting paths between graticles with the same value to ensure that the extracted lines are continuous; and the boundary points of the lines are identified, and boundary and angle checks are performed to ensure that the lines conform to the actual geographical features.

4. The method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation according to claim 1, characterized in that, The process of constructing a river number file in the vector drainage map of the watershed within the specified time period based on the fusion unit flow file and river file, implemented using Python code, includes: Read the river segments in the river file and the fusion unit grid in the fusion unit flow file, and define a data processing function to convert the data of specific fields into long integers suitable for calculation; Calculate the distance between the starting and ending points of the river segment and each fusion unit grid point, find the grid points whose distance is less than the set limit as the best match, and generate a river number file in the vector water system map.

5. The method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation according to claim 1, characterized in that, The vector water system map after reconstructing the topological relationships includes: Read the attribute table and the coordinates of the first and last nodes of each shape from the vector water system map, and generate a dictionary containing unique node IDs, where the latitude and longitude of the nodes are used as keys; Starting from the specified outflow node, the topological relationship of the river is constructed upwards using a breadth-first search algorithm; After completing the topology reconstruction, the updated data is exported to a CSV file, and the attribute table of the vector water system map is updated at the same time to obtain the vector water system map after the topology is reconstructed.

6. The method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation according to claim 5, characterized in that, The process of generating a list file containing the flow rates of each numbered river in the vector drainage map of the basin within the specified time period includes: Based on the output flow file, obtain the flow data of the watershed within the specified time period; Based on the river unique node ID in the attribute table of the vector water system map after the topological relationship is reconstructed, the river number is obtained from the river number file; By correlating the river numbers with the flow data, a list file is generated showing the flow magnitude of each numbered river in the vector water system map of the basin within the specified time period.

7. The method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation according to claim 1, characterized in that, The process involves generating an intermediate file that can be associated with the vector river system map based on the list file and the reconstructed topological relationships, and then associating the reconstructed topological relationships vector river system map with the intermediate file to obtain a non-standardized spatial distribution map of the watershed within the specified time period. This process is implemented using Python code and includes: Read the river number file and the list file, and create a dictionary that maps river numbers to corresponding flow values; Iterate through the dictionary, calculate the sum of all flow values ​​associated with each river, and store the results in a new column Q; Read the vector water system map after reconstructing the topology, extract the shape and record information, and create a new Shapefile file. Copy the field definitions in the vector water system map after reconstructing the topology and add a new field Q to store the calculated flow value to form an intermediate file. The vector water system map records, shapes, and calculated flow values ​​after the topological relationship is reconstructed are traversed. Each calculated flow value is appended to a record, and these records and shape information are written into a newly created Shapefile file to generate a non-standardized flow spatial distribution map of the watershed within the specified time period.

8. The method for simulating the spatial distribution of discharge using a distributed hydrological model based on vector representation according to claim 1, characterized in that, The step of adjusting the river classification threshold based on the flow rate within the specified time period to obtain a standardized spatial distribution map of the flow rate in the basin within the specified time period includes: Based on the flow rate within the specified time period, the river classification threshold is adjusted, and the river classification color and image background color are set using a standard river classification color setting file and an image background color setting file to obtain a standardized spatial distribution map of the flow rate of the basin within the specified time period.

Citation Information

Patent Citations

  • Distributed hydrological model-based flood forecasting method for small reservoirs in watershed lacking data

    CN118821363A

  • Distributed hydrological simulation method and device based on Xinanjiang model and medium

    CN118862732A