Scale constraint-free ridge line extraction method
By extracting the grid with a cumulative accumulation of 0 in the DEM data and combining morphological operations, the problem of scale-dependent and unreasonable parts in the existing technology is solved, and the ridge line extraction without scale-dependent is achieved, and the results are more in line with the definition of geomorphology.
Patent Information
- Application Number
- CN202510418343.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art has problems of scale dependence and unreasonable parts when extracting ridge lines, especially the division of catchment boundary lines depends on the threshold for congestion accumulation, resulting in inaccurate extraction of ridge lines and containing unreasonable parts.
By calculating the cumulative amount of the DEM data, a grid with the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumulative amount of the cumul
The ridge line extraction without scale dependence is achieved, and the results are more accurate, avoiding the unreasonable "pass" phenomenon, and it is simple to operate and easy to achieve.
Smart Images

Figure CN120339221A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of terrain analysis based on digital elevation models, and particularly relates to a method for extracting ridge lines without scale constraints. Background Art
[0002] In geomorphology, the highest part of a mountain range that extends linearly or strip-like is called a ridge, and the continuous extension line of the ridge is called a ridge line. The ridge line and the valley line together form the basic terrain skeleton line. At the same time, due to its special morphological characteristics, the ridge line also becomes the water divide line and slope direction conversion line of the earth's surface. There may be significant differences in the biological and physical processes such as vegetation and soil on both sides of the ridge line. Therefore, accurately extracting the ridge line is of great significance in the fields of terrain feature analysis, terrain generalization, and mountain area ecological environment.
[0003] Both digital elevation models (DEMs) and contour lines can be used to extract ridge lines. Among them, the ridge line extraction algorithm designed based on the DEM data according to the morphological and water divide characteristics of the ridge line is relatively simple and easy to operate, and has become the main method for ridge line extraction. And the extraction of ridge lines based on DEM can be divided into two types according to the algorithm principle: The first is to identify the ridge line grid using terrain parameters such as curvature and slope direction according to the surface morphological characteristics of the ridge line and its nearby area. Although this method is simple to operate, there are some problems. The first problem is that when defining the threshold for the parameters used in the identification process, it is very difficult to determine a suitable threshold due to the complex characteristics of the terrain. The second problem is that the ridge lines identified by this method are often discontinuous and need to be further processed using some image processing methods, which actually increases the complexity of the entire process.
[0004] The second method for extracting ridge lines based on DEM data is based on the simulation of surface water catchment processes. Using DEM data to simulate the flow and convergence processes of water on the surface, first extract the valley lines in the analysis area, then divide the catchment areas according to the valley lines. It is easy to know from the water-dividing characteristics of ridge lines that ridge lines become part of the catchment boundary lines. Finally, delete the catchment boundary lines near the outlets of the catchment areas to obtain the ridge lines. All the operation methods required by this method have been implemented in mainstream GIS software, so the operation is simple. At the same time, the obtained ridge lines are continuous. Therefore, this method has become the main operation method for current ridge line extraction. However, there are still some problems with this method: First, when using this method to extract ridge lines, it is necessary to divide the catchment areas in the analysis area first, and the division of catchment areas depends on valley lines. A threshold of flow accumulation needs to be specified during the extraction of valley lines, and the determination of this threshold is still a major problem in the field of digital terrain analysis. A smaller threshold will divide into many small catchment areas with small areas, and some parts of the finally extracted ridge lines may not belong to the ridge lines. While a larger threshold will divide into a small number of large catchment areas, and many real ridge lines may be missed in the finally extracted ridge lines. Therefore, this method has obvious scale dependence. The second problem during the process of extracting ridge lines by this method is that it is too continuous, which may divide line segments that do not conform to the definition of ridge lines into ridge lines. A typical example is the "saddle" that may exist on the catchment boundary. The so-called "saddle" is a position where the mountain suddenly sinks, dividing the continuous mountain into two independent parts in terms of morphology. Obviously, this position does not conform to the geomorphological definition of ridge lines, but this area is still regarded as part of the catchment boundary during the surface water catchment simulation process, resulting in unreasonable parts in the finally extracted ridge lines. Therefore, a scale-free ridge line extraction method is needed to solve the above problems. Summary of the Invention
[0005] The purpose of the present invention is to provide a scale-free ridge line extraction method to solve the problems existing in the prior art as mentioned in the above background technology.
[0006] To achieve the above purpose, the present invention provides the following technical solutions:
[0007] A scale-free ridge line extraction method includes the following steps:
[0008] S1: Input DEM data, calculate the flow accumulation value of each grid, and then extract the grids with a flow accumulation value of 0.
[0009] S2: For the grids extracted in step S1, assign the elevation values of the input DEM data at the same positions to the grids, then perform depression filling operations, obtain the grids with a flow accumulation value of 0 again, and delete the isolated grids. The remaining part is used as the ridge line seed grids.
[0010] S3: For the grids with the accumulated runoff value of 0 obtained in step S1, sequentially determine whether they are connected to the ridge line seed grids, and form the ridge area grids by combining all the partial grids connected to the ridge line seed grids with the ridge line seed grids;
[0011] S4: Perform contraction, expansion, and thinning operations on the ridge line area grids obtained in step S3 to obtain the ridge line in the form of the initial grids;
[0012] S5: Remove the ridge lines in the low-lying and gully areas to obtain the ridge line in the form of the final grids;
[0013] S6: Convert the ridge line in the form of grids into the ridge line in the vector format, and perform a fusion operation on it to make the adjacent ridge lines in space into a whole;
[0014] S7: Calculate the lengths of the ridge line segments, and delete the shorter parts according to the specified threshold to obtain the final ridge line result.
[0015] Preferably, the specific process of S2 is as follows:
[0016] S21: In step S1, the values of the grids with the extracted accumulated runoff value of 0 have been assigned as 1, and the values of the remaining grids are 0; perform a multiplication operation on this grid data and the input DEM data, then the values of the grids with the value of 1 become the elevation values of the input DEM data, and the values of the grids with the value of 0 remain 0;
[0017] S22: For the grid data obtained in step S21, reassign the values of the grids with the value of 0 as nodata, that is, these grids will no longer be processed in the subsequent processing;
[0018] S23: Sequentially perform the operations of depression filling, flow direction calculation, and accumulated runoff calculation on the grid data obtained in step S22, then extract the grids with the accumulated runoff value of 0, and assign the grids as 1;
[0019] S24: Convert the grids with the value of 1 obtained in step S23 into vector polygons;
[0020] S25: Calculate the areas of the vector polygons, and delete the polygons with the area not greater than the area of one grid cell;
[0021] S26: Convert the remaining polygons into grids again to obtain the ridge line seed grids.
[0022] Preferably, the specific process of S3 is as follows:
[0023] S31: Create a grid data, with the grid size, coordinates, and range parameters consistent with the input DEM data, and uniformly assign the grid values as 0;
[0024] S32: Traverse the ridgeline seed raster data obtained in step S2. If the value of a certain raster is 1, that is, it is a ridgeline seed raster, then assign the raster at the corresponding position in the raster data created in step S31 the value of 1;
[0025] S33: Traverse the raster data with a flow accumulation value of 0 obtained in step S1, and determine whether the raster with a value of 1 in this data is adjacent to the raster with a value of 1 in the raster data obtained in step S32. Adjacent means that the difference in row numbers or column numbers of the two rasters is not greater than 1; if adjacent, then assign the raster value corresponding to the raster data obtained in step S32 the value of 1;
[0026] S34: Repeat step S33 until no new raster that meets the adjacent condition in S33 is found, then stop traversing to obtain the ridgeline area raster.
[0027] Preferably, in the said S1, the flow accumulation value of each raster is calculated through processes of depression filling, flow direction calculation, and flow accumulation calculation.
[0028] Preferably, in the said S26, during the process of converting the raster, the raster size and range parameters of the target raster data are set to be consistent with the input DEM raster data.
[0029] Compared with the prior art, the beneficial effects of the present invention are:
[0030] 1. The ridgeline extraction method proposed by the present invention closely adheres to the geomorphological definition of the ridgeline. During the extraction process, the water-dividing characteristics of the ridgeline are utilized, but it does not depend on the extraction of the catchment boundary line, so that the entire extraction process does not require setting the flow accumulation threshold in the process of extracting the catchment area, achieving scale independence.
[0031] 2. The ridgeline extraction method proposed by the invention combines the water-dividing characteristics and morphological characteristics of the ridgeline. Compared with the extraction method based on the catchment boundary line, on the one hand, the present invention method no longer needs to perform the processing work of the catchment boundary line near the catchment outlet. On the other hand, the ridgeline extraction result does not contain non-ridgeline areas such as "passes", and the result is more accurate.
[0032] 3. The method of the present invention is simple and easy to operate. The main operation processes can all be completed using the spatial analysis tools of current mainstream GIS software, and it is easy to be quickly applied in practice. Description of the Drawings
[0033] Figure 1 It is a flow block diagram of the method of the present invention.
[0034] Figure 2 It is a raster map of the raster with a flow accumulation value of 0 calculated in the experimental area in the embodiment of the present invention.
[0035] Figure 3 This is the ridge line seed raster map calculated for the experimental area in the embodiments of the present invention.
[0036] Figure 4 This is the raster map of the ridge line area calculated for the experimental area in the embodiments of the present invention.
[0037] Figure 5 This is the ridge line map in raster form obtained for the experimental area in the embodiments of the present invention.
[0038] Figure 6 This is the vector ridge line map obtained for the experimental area in the embodiments of the present invention.
[0039] Figure 7 This is the comparison map of the ridge lines extracted by the method of the present invention and the comparative method. Detailed implementation manners
[0040] To make the technical means, creative features, achieved purposes and functions of the present invention easy to understand, the present invention will be further described below in conjunction with specific implementation manners.
[0041] Please refer to Figures 1-7 , the present invention provides the following technical solutions:
[0042] A scale-free constrained ridge line extraction method, characterized by comprising the following steps:
[0043] S1: Input DEM data, calculate through calculation processes such as depression filling, flow direction calculation, and flow accumulation amount, obtain the flow accumulation amount value of each raster, and then extract the raster with a flow accumulation amount value of 0;
[0044] S2: For the raster extracted in step S1, assign the elevation value of the input DEM data at the same position to the raster, then perform a depression filling operation, obtain the raster with a flow accumulation amount value of 0 again, and delete the isolated raster. The remaining part is used as the ridge line seed raster; the specific process is as follows:
[0045] S21: In step S1, the value of the raster with a flow accumulation amount value of 0 that has been extracted has been assigned a value of 1, and the values of the remaining rasters are 0; perform a multiplication operation on this raster data and the input DEM data, then the value of the raster with a value of 1 becomes the elevation value of the input DEM data, and the value of the raster with a value of 0 remains 0;
[0046] S22: For the raster data obtained in step S21, reassign the value of the raster with a value of 0 to nodata, that is, these rasters will not be processed in subsequent processing;
[0047] S23: Sequentially perform depression filling, flow direction calculation, and flow accumulation calculation operations on the raster data obtained in step S22, then extract the raster with a flow accumulation value of 0 and assign the raster a value of 1;
[0048] S24: Convert the raster with a value of 1 obtained in step S23 into a vector polygon;
[0049] S25: Calculate the area of the vector polygon and delete the polygons with an area not greater than the area of one raster cell;
[0050] S26: Convert the remaining polygons back into a raster to obtain the ridge line seed raster. During the raster conversion process, set the raster size and range parameters of the target raster data to be the same as those of the input DEM raster data.
[0051] S3: For the raster with a flow accumulation value of 0 obtained in step S1, sequentially determine whether it is connected to the ridge line seed raster, and form the ridge area raster by combining all the partial rasters connected to the ridge line seed raster with the ridge line seed raster; The specific process of S3 is as follows:
[0052] S31: Create a raster data with the raster size, coordinates, and range parameters the same as those of the input DEM data, and uniformly assign the raster value to 0;
[0053] S32: Traverse the ridge line seed raster data obtained in step S2. If the value of a certain raster is 1, that is, it is a ridge line seed raster, then assign the raster at the corresponding position in the raster data created in step S31 a value of 1;
[0054] S33: Traverse the raster data with a flow accumulation value of 0 obtained in step S1, and determine whether the raster with a value of 1 in this data is adjacent to the raster with a value of 1 in the raster data obtained in step S32. Adjacent means that the difference in the row number or column number of the two rasters is not greater than 1; If adjacent, then assign the raster value corresponding to the raster data obtained in step S32 to 1;
[0055] S34: Repeat step S33 until no new raster that meets the adjacent condition in S33 is found, then stop traversing to obtain the ridge area raster.
[0056] S4: Perform shrinking, expanding, and thinning operations on the ridge line area raster obtained in step S3 to obtain the ridge line in the form of an initial raster;
[0057] S5: Remove the ridge lines in the low-lying and valley areas to obtain the ridge line in the final raster form;
[0058] S6: Convert the ridge line in the raster form into a ridge line in the vector format and perform a fusion operation on it, that is, fuse the spatially adjacent line segments into a whole, so that the spatially adjacent ridge lines become a whole;
[0059] S7. Calculate the length of the ridge line segments, then define a threshold, such as 100 meters, as the minimum length of the ridge line, and delete the shorter parts according to the specified threshold to obtain the final ridge line result.
[0060] Example 1
[0061] To verify the usability of the method of the present invention in extracting the ridge line, Example 1 selects a loess hilly and gully area in northern Shaanxi as the experimental area. This area is a typical fluvial erosion terrain with a very well-developed ridge terrain, which can be used as an ideal experimental area for analyzing the differences in the ridge line extraction results of different methods.
[0062] Step 1: For the example area, through processes such as depression filling, flow direction calculation, and flow accumulation calculation, obtain the flow accumulation data, and then extract the grids with a flow accumulation value of 0, and assign the result grids a value of 1, as Figure 2 shown;
[0063] Step 2: Use the grids with a value of 1 in the result of Step 1 to obtain the elevation data of the original DEM data, and again through processes such as depression filling, flow direction calculation, and flow accumulation calculation, obtain the new flow accumulation data, and again extract the grids with a flow accumulation value of 0, and assign the result grids a value of 1;
[0064] Step 3: For the result obtained in Step 2, remove the grids that have a value of 1 themselves but all the grids around them have a value of 0 to obtain the ridge line seed grids, as Figure 3 shown;
[0065] Step 4: Determine which of the grids with a value of 1 in the result of Step 1 are spatially connected to the ridge line seed grids, and assign a value of 1 to all the connectable grids to obtain the ridge line area grids, as Figure 4 shown;
[0066] Step 5: Use GIS software to sequentially perform morphological grid operations such as dilation, erosion, and thinning;
[0067] Step 6: Through neighborhood statistics, assign a value of 0 to the grids with a value of 1 located in areas such as valleys and depressions to obtain the ridge line in grid form, as Figure 5 shown;
[0068] Step 7: Convert the ridge line in grid form to vector line format, and then perform a fusion operation to obtain the initial vector format ridge line;
[0069] Step 8: Calculate the length of the vector ridge line segments, set a length threshold, such as 100 meters, and delete the segments with a length less than this threshold to obtain the final vector ridge line, as Figure 6 shown;
[0070] Step 9: For the example area, the ridge line of the example area obtained by the comparison method (extracting the ridge line from the catchment boundary line, where the threshold of the flow accumulation amount in the process of catchment extraction is set to 2000) is as Figure 7 shown.
[0071] Combined with Figure 7 , it can be seen that compared with the comparison method, the ridge line extracted by the method of the present invention is superior in two aspects: First, the extraction result of the method of the present invention does not depend on the catchment extraction result; as can be seen from Figure 7 , some obvious ridge lines are not extracted by the comparison method because these ridge lines are included in other currently extracted catchments. To extract these missing ridge lines, it is necessary to reduce the threshold of the flow accumulation amount in the catchment extraction process, but this will increase a lot of non-ridge lines; as can also be seen from Figure 7 , the ridge lines extracted by the comparison method are obviously on a relatively complete slope surface, which obviously does not conform to the definition of the ridge line; Second, the ridge lines extracted by the method of the present invention do not require continuity at the non-catchment outlet because the ridge line has its obvious morphological characteristics, and the catchment boundary is not necessarily the ridge line. Compared with the extraction result of the comparison method, the ridge line extracted by the method of the present invention more conforms to its geomorphological definition.
[0072] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principle and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A ridge line extraction method without scale constraint, characterized in that, It includes the following steps: S1: Input DEM data, calculate the catchment accumulation value of each grid, and then extract the grids with a catchment accumulation value of 0; S2: For the grids extracted in step S1, assign the elevation value of the input DEM data at the same position to the grids, then perform depression filling operation, obtain the grids with a catchment accumulation value of 0 again, and delete the isolated grids. The remaining part is used as the ridge line seed grids; S3: For the grids with a catchment accumulation value of 0 obtained in step S1, sequentially determine whether they are connected to the ridge line seed grids. Combine all the partial grids connected to the ridge line seed grids and the ridge line seed grids to form the ridge area grids; S4: Perform contraction, expansion, and thinning operations on the ridge line area grids obtained in step S3 to obtain the ridge line in the form of the initial grid; S5: Remove the ridge lines in the low-lying and gully areas to obtain the ridge line in the final grid form; S6: Convert the ridge line in the grid form to the ridge line in the vector format and perform a fusion operation on it so that the adjacent ridge lines in space become a whole; S7: Calculate the length of the ridge line segments, delete the shorter parts according to the specified threshold, and obtain the final ridge line result.
2. The ridge line extraction method without scale constraint according to claim 1, characterized in that: The specific process of S2 is as follows: S21: In step S1, the value of the grid with a catchment accumulation value of 0 extracted has been assigned 1, and the values of the remaining grids are 0. Multiply this grid data by the input DEM data, then the value of the grid with a value of 1 becomes the elevation value of the input DEM data, and the value of the grid with a value of 0 remains 0; S22: For the grid data obtained in step S21, reassign the value of the grid with a value of 0 to nodata, that is, these grids will no longer be processed in the subsequent processing; S23: Sequentially perform depression filling, flow direction calculation, and catchment accumulation calculation operation steps on the grid data obtained in step S22, then extract the grids with a catchment accumulation value of 0, and assign the grids 1; S24: Convert the grids with a value of 1 obtained in step S23 to vector polygons; S25: Calculate the area of the vector polygons and delete the polygons with an area not greater than the area of one grid cell; S26: Convert the remaining polygons back to grids to obtain the ridge line seed grids.
3. A method for extracting ridgeline without scale constraint according to claim 1, characterized in that: The specific process of S3 is as follows: S31: Create a grid data with the same grid size, coordinates, and range parameters as the input DEM data, and uniformly assign the grid values to 0; S32: Traverse the ridge line seed grid data obtained in step S2. If the value of a certain grid is 1, that is, it is a ridge line seed grid, then assign the grid at the corresponding position in the grid data created in step S31 the value of 1; S33: Traverse the grid data with a catchment accumulation value of 0 obtained in step S1, and determine whether the grid with a value of 1 in this data is adjacent to the grid with a value of 1 in the grid data obtained in step S32. Adjacent means that the difference in the row number or column number of the two grids is not greater than 1. If adjacent, then assign the corresponding grid value in the grid data obtained in step S32 the value of 1; S34: Repeat step S33 until no new grids satisfying the adjacent condition in S33 are found, then stop traversing to obtain the ridge area grids.
4. A method for extracting ridgeline without scale constraint according to claim 1, characterized in that: In the above S1, the flow accumulation value of each grid is calculated through the processes of depression filling, flow direction calculation, and flow accumulation calculation.
5. A method for extracting ridgeline without scale constraint according to claim 2, characterized in that: In the above S26, during the process of converting the grid, the grid size and range parameters of the target grid data are set to be consistent with the input DEM grid data.
Citation Information
Patent Citations
Galley network automatic extraction method based on earth surface catchment accumulation
CN117333629A