A site grading automatic design method, system and device for mountainous towns
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-06
- Publication Date
- 2026-08-11
AI Technical Summary
该方法高度依赖设计者的个人经验,手动试算过程繁琐、效率低下且精度有限,难以在有限时间内对多方案进行比选
(1)本发明通过自动化算法直接生成三维模型,取代了传统“人机交互”的繁琐试算过程,打破了人工方法中台地单一标高的局限,在台地内部生成密集的标高点网络,实现了更加精准的地形刻画与极佳的土方平衡。
Smart Images

Figure CN122548959A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of software algorithms and digital city planning technology, specifically to an automatic site leveling design method, system, and equipment for mountainous towns. Background Technology
[0002] Mountain towns refer to towns located in areas with significant topographic relief, such as mountains, hills, or plateaus. Due to their spatial characteristics, such as large elevation differences, steep slopes, and scarcity of flat land, they usually need to adopt a "stepped" site leveling design strategy during the planning and design stage, designing and constructing in layers at different elevations to form multiple terraces.
[0003] Currently, when dealing with site leveling design in mountainous towns, academia and industry mainly rely on the following solutions: (1) Conventional manual experience method is based on contour maps, and earthwork volume is estimated by “contour method” or “grid method” and repeated trial calculations. This method is highly dependent on the designer’s personal experience. The manual trial calculation process is cumbersome, inefficient and has limited accuracy, making it difficult to compare multiple options within a limited time.
[0004] (2) Introducing the digital technology of Geographic Information System (GIS) and Digital Elevation Model (DEM) to assist manual design methods. Although this method can use UAV photogrammetry to quickly obtain high-precision terrain data and automatically estimate earthwork volume, its essence is still a trial-and-error process of "human-computer interaction". The division of core terraces still relies on human experience and is still far from "automatic calculation".
[0005] (3) In recent years, multi-objective optimization algorithms (such as genetic algorithms) and deep learning methods (such as generative adversarial networks) have emerged. Although these methods have the potential to automatically generate optimal solutions, they face fatal defects in actual engineering, such as extremely complex model construction, lack of high-quality training data, huge consumption of computing resources (such as GPU and time), and difficulty in interpreting the decision-making process due to the "black box" characteristics of the algorithm.
[0006] Therefore, the industry urgently needs an automated design method with low computing power cost, high precision and clear physical logic to break through the above-mentioned technical bottlenecks in the site leveling design of mountainous towns. Summary of the Invention
[0007] To address or partially address the problems existing in the prior art, this invention designs an automatic site leveling design method, system, and equipment for mountainous towns. The specific technical solution is as follows: An automated site leveling design method for mountainous towns, specifically including: The original elevation point data and design range of the mountain town site are obtained, and the original elevation point data is transformed by coordinate system projection. The original elevation point data after coordinate system projection transformation is rasterized with the design range as the calculation boundary to fill the holes generated after processing, so as to obtain the preprocessed elevation raster data. A dataset of multidimensional feature vectors is constructed based on the row and column spatial features and elevation features of each grid cell in the elevation raster data. The dataset of multidimensional feature vectors is then clustered using a Gaussian mixture model (GMM) to identify the spatial range of different plateaus and generate preliminary cluster label rasters. The connectivity of the preliminary clustered label grid is optimized to eliminate isolated noise points, resulting in an optimized label grid. The same label in the optimized label grid represents the same plateau region. For each independent label in the optimized label raster, a mask matrix representing the coverage area of the label is generated, and the calculation range is limited based on the mask matrix. Gaussian filtering is applied independently to the elevation raster data within the plateau region to perform partition smoothing, thereby reducing the slope inside the plateau while maintaining the plateau boundary, and obtaining smoothed elevation raster data. Based on the smoothed elevation raster data, abnormal regions where the elevation difference between adjacent raster cells is greater than a preset elevation difference threshold are detected. Morphological dilation is performed on the abnormal regions, and the slope of the edge position and the surrounding area after dilation is calculated. It is determined whether the slope meets a preset slope ratio threshold, so as to iteratively expand and finally determine the slope region. Based on the known elevation values of the plateau region in the smoothed elevation raster data, elevation interpolation calculations are performed on the raster cells in the slope region to output three-dimensional elevation raster data containing the smoothed plateau and the connected slope, which is used to guide the site leveling construction of the mountain town.
[0008] In a preferred implementation, the step of performing coordinate system projection transformation on the original elevation point data and rasterizing the transformed original elevation point data with the design range as the calculation boundary to fill the holes generated after processing includes: The original elevation point data is dynamically projected from the geographic coordinate system to the target projection coordinate system. Using the design range as a mask, calculate the arithmetic mean of the elevation values of all elevation points within the coverage area of each grid cell at a preset resolution to generate initial elevation grid data; The locations of holes in the initial elevation raster data are identified, and the holes are calculated and filled using cubic spline interpolation based on the known elevation values of the surrounding non-hole locations, thus obtaining the preprocessed elevation raster data.
[0009] In a preferred implementation, the step of clustering the dataset using a Gaussian Mixture Model (GMM) to generate a preliminary cluster label raster includes: The row coordinates, column coordinates, and elevation values of each grid cell in the elevation raster data are extracted as the two-dimensional coordinate features and elevation features, and then normalized to their maximum and minimum values. The number of clusters is preset according to the terrain complexity of the design scope, and a Gaussian mixture model containing multiple Gaussian components is constructed. Using the Expectation-Maximization (EM) algorithm, the posterior probability of each grid cell belonging to each Gaussian component is calculated by iteratively updating the mixture weights, mean vectors, and covariance matrices of each Gaussian component. Each grid cell is assigned to the cluster corresponding to the Gaussian component with the highest posterior probability to generate the preliminary clustering label grid.
[0010] In a preferred implementation, the connectivity optimization of the initial clustering label grid includes: The regions with the same label in the preliminary clustering label grid are labeled as four connected regions. If there are isolated regions with the same label but not belonging to the same connected region in space, a new label is assigned to them based on the connected region label. For the tag grid after the new labels are assigned, each grid cell is traversed and its label is replaced with the most frequent modal label in its eight neighborhoods to smooth the plateau boundary and eliminate isolated noise points, and the optimized tag grid is output.
[0011] In a preferred implementation, the step of independently applying Gaussian filtering to the elevation raster data within the plateau region for partitioned smoothing includes: Determine whether the average initial terrain slope of all grid cells within each plateau region is greater than a preset slope threshold. For the gentle terrace area where the average value is not greater than the preset slope threshold, a first Gaussian standard deviation and a first cutoff parameter are set to construct a first two-dimensional Gaussian kernel matrix. For steep plateau regions where the average value is greater than the preset slope threshold, a second Gaussian standard deviation and a second truncation parameter are set to values that are greater than the first Gaussian standard deviation and the first truncation parameter, respectively, to construct a second two-dimensional Gaussian kernel matrix. Based on the calculation range defined by the mask matrix, the elevation raster data is subjected to weighted average filtering calculation with the corresponding matching first two-dimensional Gaussian kernel matrix or second two-dimensional Gaussian kernel matrix to update the elevation value within the plateau area.
[0012] In a preferred implementation, the step of performing a morphological dilation operation on the abnormal region and calculating the slope of the dilated edge position relative to the surrounding area includes: Using the identified abnormal regions as the initial set, morphological expansion is performed using structuring elements of a preset size to extend the boundaries; The surrounding area is defined as a preset spatial distance, and the spatial slope between the newly added edge position after each expansion and multiple surrounding grid units within the preset spatial distance is calculated. If the calculated slope extending to the multiple surrounding grid cells is less than the preset slope ratio threshold, then the edge position is marked as a slope region and expansion in that direction is stopped; otherwise, the next round of morphological expansion cycle begins.
[0013] In a preferred implementation, before performing elevation interpolation calculations on the grid cells within the slope region in step S6, the method further includes a slope region refinement step: The resolution of the current elevation raster data and slope area is improved by using linear interpolation according to a preset magnification factor. In the elevation raster data after resolution enhancement, morphological shrinkage operation is used to perform boundary restoration on the initially screened slope areas. The slope of the contracted edge is recalculated until the slope of the contracted edge is less than or equal to the preset slope ratio threshold, in order to determine the final slope area with high accuracy.
[0014] An automated site leveling design system for mountainous towns includes: The data acquisition and preprocessing module is used to acquire the original elevation point data and design range of the mountain town site, and to perform coordinate system projection transformation on the original elevation point data. Using the design range as the calculation boundary, the original elevation point data after coordinate system projection transformation is rasterized to fill the holes generated after processing, and the preprocessed elevation raster data is obtained. The GMM clustering module is used to construct a dataset of multidimensional feature vectors based on the row and column spatial features and elevation features of each grid cell in the elevation raster data. The dataset of multidimensional feature vectors is clustered using the Gaussian Mixture Model (GMM) to identify the spatial range of different plateaus and generate preliminary cluster label raster. The connectivity optimization module is used to optimize the connectivity of the preliminary clustered label grid, eliminate isolated noise points, and obtain an optimized label grid, wherein the same label in the optimized label grid represents the same plateau region. The partition smoothing module is used to generate a mask matrix representing the coverage of each independent label in the optimized label raster, and to limit the calculation range based on the mask matrix. Gaussian filtering is applied independently to the elevation raster data within the plateau region to perform partition smoothing processing, thereby reducing the slope inside the plateau while maintaining the plateau boundary, and obtaining smoothed elevation raster data. The slope generation module is used to detect abnormal areas where the elevation difference between adjacent grid cells is greater than a preset elevation difference threshold based on the smoothed elevation grid data. By performing morphological expansion on the abnormal areas and calculating the slope of the expanded edge position and the surrounding area, it determines whether the slope meets the preset slope ratio threshold, so as to iteratively expand and finally determine the slope area. The 3D model output module is used to perform elevation interpolation calculations on the grid cells in the slope area based on the known elevation values of the plateau area in the smoothed elevation grid data, and output 3D elevation grid data containing the smoothed plateau and the connected slope, which is used to guide the site leveling construction of the mountain town.
[0015] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the automatic site leveling design method for mountainous towns described above.
[0016] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention generates a three-dimensional model directly through an automated algorithm, replacing the tedious trial calculation process of traditional "human-computer interaction", breaking the limitation of a single elevation of the terrace in manual methods, generating a dense network of elevation points inside the terrace, and achieving more accurate terrain depiction and excellent earthwork balance.
[0017] (2) This invention limits the range of filtering calculations by generating a label mask matrix, ensuring that Gaussian filtering is applied independently only within each plateau region. This key technical feature enables this invention to effectively reduce the slope within the plateau while perfectly preserving the steep natural boundary features between plateaus.
[0018] (3) This invention abandons blind data training. The determination of its slope area strictly follows the physical meaning of the topographic geometric features. This calculation method does not require massive high-quality training data and gets rid of the dependence on expensive GPU computing power. Not only is the response speed extremely fast, but the entire decision-making process is logically transparent and physically interpretable, and has extremely high engineering practicality. Attached Figure Description
[0019] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0020] Figure 1 This is a flowchart of the steps of an automatic site leveling design method for mountainous towns provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall process of an automatic site leveling design method for mountainous towns provided by an embodiment of the present invention; Figure 3This is a schematic diagram of the Gaussian Mixture Model (GMM) clustering calculation process in an embodiment of the present invention; Figure 4 This is a schematic diagram of the Gaussian filter smoothing calculation process in an embodiment of the present invention; Figure 5 This is a schematic diagram of the slope calculation process between terraces in an embodiment of the present invention; Figure 6 This is a partial profile comparison diagram of the original terrain, the artificial method, and the calculation results of the method in the embodiments of the present invention; Figure 7 This is a schematic diagram of the original elevation raster data in an embodiment of the present invention; Figure 8 This is a schematic diagram of the tag grid data in an embodiment of the present invention; Figure 9a This is a three-dimensional display of the original elevation raster data in an embodiment of the present invention; Figure 9b This is a three-dimensional display of the smoothed elevation raster data in an embodiment of the present invention; Figure 10a This is a three-dimensional display of the slope area identification results in an embodiment of the present invention; Figure 10b This is a three-dimensional display of the elevation raster data of the slope after generation in an embodiment of the present invention; Figure 11 This is a diagram illustrating the distribution of excavation and filling in an embodiment of the present invention; Figure 12a This is a schematic diagram showing the location of the partial cross-sectional line AA in an embodiment of the present invention; Figure 12b This is a comparison diagram of the original elevation grid and the partial profile of the elevation grid AA after the slope is generated, in an embodiment of the present invention. Detailed Implementation
[0021] The present invention will be further described below through specific embodiments, but this is not a limitation of the present invention. Those skilled in the art can make various modifications or improvements based on the basic idea of the present invention, but as long as they do not depart from the basic idea of the present invention, they are all within the protection scope of the present invention.
[0022] See Figure 1 and Figure 2 One embodiment provided by the present invention is as follows: An automated site leveling design method for mountainous towns, specifically including: The original elevation point data and design range of the mountain town site are obtained, and the original elevation point data is transformed by coordinate system projection. The original elevation point data after coordinate system projection transformation is rasterized with the design range as the calculation boundary to fill the holes generated after processing, so as to obtain the preprocessed elevation raster data. In a preferred embodiment, the step of performing coordinate system projection transformation on the original elevation point data and rasterizing the transformed original elevation point data with the design range as the calculation boundary to fill the holes generated after processing includes: The original elevation point data is dynamically projected from the geographic coordinate system to the target projection coordinate system. Using the design range as a mask, calculate the arithmetic mean of the elevation values of all elevation points within the coverage area of each grid cell at a preset resolution to generate initial elevation grid data; The locations of holes in the initial elevation raster data are identified, and the holes are calculated and filled using cubic spline interpolation based on the known elevation values of the surrounding non-hole locations, thus obtaining the preprocessed elevation raster data.
[0023] Specifically, when performing dynamic coordinate system projection transformation, such as transforming from the WGS1984 coordinate system to the CGCS2000 coordinate system, the data is first unified in the WGS1984 coordinate system, and then the data is transformed according to the center longitude of the input data. The appropriate EPSG projection band is dynamically selected, and the calculation formula is as follows: (1) When performing rasterization of elevation point data, since the original elevation points are not spatially uniformly distributed, let the elevation point set be... The position in the elevation grid The formula for calculating the value is: (2) in, Indicates location within the elevation grid The value of the position; Indicates all values falling within the elevation grid. Elevation points within the location, i.e. , Elevation grid The coverage area; Indicates all values falling within the elevation grid. The number of elevation points within the location.
[0024] When filling in the void, let the set of known non-void locations be . The location of the cavity is The cubic spline interpolation formula used is: (3) in, The weights are determined by solving a system of linear equations; These are cubic spline basis functions.
[0025] A dataset of multidimensional feature vectors is constructed based on the row and column spatial features and elevation features of each raster cell in the elevation raster data. A Gaussian Mixture Model (GMM) is then used to cluster this dataset of multidimensional feature vectors to identify the spatial extent of different plateaus and generate preliminary cluster label raster cells. A schematic diagram of the Gaussian Mixture Model (GMM) clustering calculation process is shown below. Figure 3 As shown.
[0026] In a preferred embodiment, the step of clustering the dataset using a Gaussian Mixture Model (GMM) to generate a preliminary cluster label raster includes: The row coordinates, column coordinates, and elevation values of each grid cell in the elevation raster data are extracted as the two-dimensional coordinate features and elevation features, and then normalized to their maximum and minimum values. The number of clusters is preset according to the terrain complexity of the design scope, and a Gaussian mixture model containing multiple Gaussian components is constructed. Using the Expectation-Maximization (EM) algorithm, the posterior probability of each grid cell belonging to each Gaussian component is calculated by iteratively updating the mixture weights, mean vectors, and covariance matrices of each Gaussian component. Each grid cell is assigned to the cluster corresponding to the Gaussian component with the highest posterior probability to generate the preliminary clustering label grid.
[0027] Specifically, natural terrain often exhibits a complex multi-peak structure, requiring the construction of a multi-dimensional feature vector dataset. At that time, the formula for normalizing the feature vector of each grid cell is: (4) in, Row coordinates; Column coordinates; This refers to the elevation value; This represents the total number of rows in the raster. This represents the total number of columns in the raster. This is the minimum elevation value; This represents the maximum elevation value.
[0028] The probability density function of the Gaussian mixture model is: (5) in, This represents the number of clusters. For the first The mixing weights of Gaussian components; It follows a multivariate Gaussian distribution; It is the mean vector; It is the covariance matrix; When learning parameters using the EM algorithm, the formula for calculating the posterior probability in the E-step (expectation step) is:
[0029] The formula for updating model parameters in the M-step (maximum step) is: (7) (8) (9) in, Indicates the updated number The mixing weights of Gaussian components; Indicates the updated number The mean vector of the nth Gaussian component represents the nth Gaussian component. The "center" characteristics of each region include normalized coordinates and elevations; Indicates the updated number The covariance matrix of the _i Gaussian component represents the _i _i covariance matrix. The changes in characteristics within a region and the correlations between different characteristics.
[0030] The connectivity of the preliminary clustered label grid is optimized to eliminate isolated noise points, resulting in an optimized label grid. The same label in the optimized label grid represents the same plateau region. In a preferred embodiment, the connectivity optimization of the preliminary clustering label grid includes: The regions with the same label in the preliminary clustering label grid are labeled as four connected regions. If there are isolated regions with the same label but not belonging to the same connected region in space, a new label is assigned to them based on the connected region label. For the tag grid after the new labels are assigned, each grid cell is traversed and its label is replaced with the most frequent modal label in its eight neighborhoods to smooth the plateau boundary and eliminate isolated noise points, and the optimized tag grid is output.
[0031] Specifically, when performing connected component labeling, for the label raster Chinese label Location Check its four surrounding neighborhoods Marking connected components yields a connected component raster. And calculate the new label, as shown below: (10) Then, a mode filtering operation is performed to calculate the set of valid labels in the 8-neighborhood of each location. The optimized tags are: (11) in, Indicates in set Chinese label The frequency of occurrence is used to eliminate isolated noise pixels.
[0032] For each individual label in the optimized label raster, a mask matrix representing the coverage area of that label is generated. Based on this mask matrix, the calculation range is limited. Gaussian filtering is then applied independently within the platform region to perform partitioned smoothing of the elevation raster data, thereby reducing the slope within the platform while maintaining the platform boundaries, resulting in smoothed elevation raster data. A schematic diagram of the Gaussian filtering smoothing calculation process is shown below. Figure 4 As shown.
[0033] In a preferred embodiment, the step of independently applying Gaussian filtering to perform partitioned smoothing processing on the elevation raster data within the plateau region includes: Determine whether the average initial terrain slope of all grid cells within each plateau region is greater than a preset slope threshold. For the gentle terrace area where the average value is not greater than the preset slope threshold, a first Gaussian standard deviation and a first cutoff parameter are set to construct a first two-dimensional Gaussian kernel matrix. For steep plateau regions where the average value is greater than the preset slope threshold, a second Gaussian standard deviation and a second truncation parameter are set to values that are greater than the first Gaussian standard deviation and the first truncation parameter, respectively, to construct a second two-dimensional Gaussian kernel matrix. Based on the calculation range defined by the mask matrix, the elevation raster data is subjected to weighted average filtering calculation with the corresponding matching first two-dimensional Gaussian kernel matrix or second two-dimensional Gaussian kernel matrix to update the elevation value within the plateau area.
[0034] It should be noted that, in this embodiment of the invention, the steepness of the terrace area (i.e., the regional slope) can be uniformly measured by extracting the initial terrain slope of all included grid cells within the terrace area and calculating their arithmetic mean (i.e., the average initial terrain slope), which serves as a benchmark for comparison with a preset slope threshold. In other alternative embodiments, to adapt to the specific requirements of different projects on slope safety and terrain fit, the median or maximum slope of the grid cells within the area can also be flexibly used as a comparison benchmark, depending on the sensitivity of the actual engineering construction indicators, all of which fall within the protection scope of this invention.
[0035] Specifically, the two-dimensional Gaussian kernel function is defined as: (12) The elements of the discretized kernel matrix are: (13) in, t is the truncation parameter, which determines the size of the kernel. It is the standard deviation of the Gaussian function, used to control the degree of smoothing. The larger the value, the stronger the smoothing effect, but more detail will be lost.
[0036] In one specific embodiment, for gently sloping plateau areas, a setting can be made... =7, t=3 to construct the first two-dimensional Gaussian kernel matrix; for steep plateau regions, it can be set as follows: =15, t=6 to construct the second two-dimensional Gaussian kernel matrix.
[0037] set up For the elevation raster corresponding to label c, For the mask matrix, The formula for calculating the weighted average of convolutions within the mask limit is as follows: (14) in, In the elevation raster corresponding to label c, the position The value; These are the elements of the Gaussian kernel matrix; In the mask corresponding to label c, the position The value of , i.e., the number of valid values; Iterate through all positions in the kernel matrix.
[0038] This operation essentially ensures that the smoothing process is only performed within each terrace and does not cross or blur the cliff boundaries between terraces.
[0039] Based on the smoothed elevation raster data, abnormal regions where the elevation difference between adjacent raster cells exceeds a preset elevation difference threshold are detected. Morphological dilation is then performed on these abnormal regions, and the slope of the expanded edge and surrounding area is calculated. It is determined whether the slope meets a preset slope ratio threshold, and this process iteratively expands and ultimately determines the slope region. A schematic diagram of the slope calculation process between terraces is shown below. Figure 5 As shown.
[0040] In a preferred embodiment, the step of performing morphological dilation on the abnormal region and calculating the slope of the edge position and surrounding area after dilation includes: Using the identified abnormal regions as the initial set, morphological expansion is performed using structuring elements of a preset size to extend the boundaries; The surrounding area is defined as a preset spatial distance, and the spatial slope between the newly added edge position after each expansion and multiple surrounding grid units within the preset spatial distance is calculated. If the calculated slope extending to the multiple surrounding grid cells is less than the preset slope ratio threshold, then the edge position is marked as a slope region and expansion in that direction is stopped; otherwise, the next round of morphological expansion cycle begins.
[0041] Specifically, let the smoothed elevation raster matrix be S, and detect the four neighboring regions (up, down, left, and right). The height difference between the two sides is greater than the preset height difference threshold. The pixels are used to generate anomaly region mask matrix. The formula is: (15) in, The maximum elevation difference threshold is set to 10 meters.
[0042] The calculation method for the morphological expansion process is as follows: (16) in, For the set of highly dissimilar locations, i.e. The coordinates of the position where the median value is 1; A 3x3 structural element is used to determine the location of the expansion; for The reflection indicates that Reverse around the origin; After reversal Location is .
[0043] After each expansion, the position of the expanded edge... Calculate the nearest surrounding grid cell within a preset spatial distance. The slope is calculated using the following formula: (17) in, For position any of the 24 most recent positions The distance between them; This is a smoothed elevation grid.
[0044] If calculated If all conditions are met, the iteration stops.
[0045] Based on the known elevation values of the plateau region in the smoothed elevation raster data, elevation interpolation calculations are performed on the raster cells in the slope region to output three-dimensional elevation raster data containing the smoothed plateau and the connected slope, which is used to guide the site leveling construction of the mountain town.
[0046] In a preferred embodiment, before performing elevation interpolation calculations on the grid cells within the slope area in step S6, the method further includes a slope area refinement step: The resolution of the current elevation raster data and slope area is improved by using linear interpolation according to a preset magnification factor. In the elevation raster data after resolution enhancement, morphological shrinkage operation is used to perform boundary restoration on the initially screened slope areas. The slope of the contracted edge is recalculated until the slope of the contracted edge is less than or equal to the preset slope ratio threshold, in order to determine the final slope area with high accuracy.
[0047] Specifically, because the initial raster resolution is often large (e.g., 10 meters), the directly generated slope boundaries may appear coarse and jagged, resulting in insufficient slope precision. Therefore, bilinear interpolation is used to enlarge the raster data, for example, by a factor of 4: Let... (18) (19) Then, morphological shrinkage was applied at high resolution: (20) The boundary is gradually reverted and the slope is re-detected. At this point, due to the increased resolution (e.g., reduced to 2.5 meters), the slope calculated after shrinking can approach the preset slope ratio threshold with extremely high accuracy. Finally, the cubic spline interpolation method is used again to fill the elevation values within the refined slope area, resulting in a high-precision 3D site leveling design model. Compared to traditional manual experience methods, this not only reduces redundant earthwork but also significantly improves design efficiency and accuracy.
[0048] The above steps detail the calculation logic of the automatic design method of the present invention. To further demonstrate the feasibility and significant progress of the present invention, specific operating data from this embodiment are used as an example to objectively evaluate the beneficial technical effects of the present invention: (1) The design accuracy has been significantly improved and the earthwork volume has been optimized to the extreme. like Figure 6The comparison diagram of the original terrain, the results of manual methods, and the results calculated by this method shows that traditional manual methods rely on a small number of elevation levels for stratification, and a single elevation is usually used within the terrace. In contrast, this method can generate a denser network of elevation points within the terrace, providing a more accurate depiction of the micro-topographic features. Calculations show that, compared to manual design schemes, this method reduces excavation by 9.5%, fill by 17.1%, and the total construction volume by 12.2%, achieving a near-perfect balance in earthwork costs and significantly improving the economic efficiency and ecological safety of the project.
[0049] (2) Visualization of intermediate processes and final 3D model at each stage of the embodiment To more intuitively illustrate the data evolution process of this method, Figures 7 to 12b The calculation results for each key step in this embodiment are shown. Among them: Figure 7 This is the original elevation raster data map generated after preprocessing in step S1; Figure 8 The labeled raster data map after connectivity optimization in step S3; Figure 9a and Figure 9b The images show a 3D comparison of elevation raster data before and after partitioning smoothing in step S4. Figure 10a and Figure 10b These are three-dimensional comparison images of the slope area identification results and the elevation raster data after slope generation in steps S5 and S6, respectively. Figure 11 This is a diagram illustrating the slope excavation and filling of the final 3D model. Figure 12a This is a schematic diagram showing the location of the AA section line. Figure 12b This is a comparison of the AA local profiles of the original elevation raster and the elevation raster generated from the slope. The above visualization results fully demonstrate that the algorithm has extremely high engineering feasibility and accuracy.
[0050] (3) Design efficiency increases exponentially. Compared to the traditional manual "design-verification-adjustment" multi-round repetitive cycle workflow (which takes about 10-14 days), this method directly generates 3D models through automated algorithms in the "design" and "adjustment" stages, reducing the overall workflow time to 5-7 days and improving design efficiency by about 300%.
[0051] (4) The algorithm has significantly reduced usage costs and strong physical interpretability. Compared to multi-objective optimization algorithms (such as genetic algorithms) and deep learning models (such as GANs), this method avoids the high requirements for training data and reliance on GPU computing power. The calculation process is strictly based on terrain geometry features and the physical meaning of Gaussian filtering, avoiding the "black box" characteristics of deep learning. At the same time, it does not require long-term multi-generational evolution, and has extremely high response speed and physical interpretability.
[0052] Based on the same inventive concept, this invention also provides an automatic site leveling design system for mountainous towns, which corresponds to the method embodiment described above. Specifically, the system includes: An automated site leveling design system for mountainous towns includes: The data acquisition and preprocessing module is used to acquire the original elevation point data and design range of the mountain town site, and to perform coordinate system projection transformation on the original elevation point data. Using the design range as the calculation boundary, the original elevation point data after coordinate system projection transformation is rasterized to fill the holes generated after processing, and the preprocessed elevation raster data is obtained. The GMM clustering module is used to construct a dataset of multidimensional feature vectors based on the row and column spatial features and elevation features of each grid cell in the elevation raster data. The dataset of multidimensional feature vectors is clustered using the Gaussian Mixture Model (GMM) to identify the spatial range of different plateaus and generate preliminary cluster label raster. The connectivity optimization module is used to optimize the connectivity of the preliminary clustered label grid, eliminate isolated noise points, and obtain an optimized label grid, wherein the same label in the optimized label grid represents the same plateau region. The partition smoothing module is used to generate a mask matrix representing the coverage of each independent label in the optimized label raster, and to limit the calculation range based on the mask matrix. Gaussian filtering is applied independently to the elevation raster data within the plateau region to perform partition smoothing processing, thereby reducing the slope inside the plateau while maintaining the plateau boundary, and obtaining smoothed elevation raster data. The slope generation module is used to detect abnormal areas where the elevation difference between adjacent grid cells is greater than a preset elevation difference threshold based on the smoothed elevation grid data. By performing morphological expansion on the abnormal areas and calculating the slope of the expanded edge position and the surrounding area, it determines whether the slope meets the preset slope ratio threshold, so as to iteratively expand and finally determine the slope area. The 3D model output module is used to perform elevation interpolation calculations on the grid cells in the slope area based on the known elevation values of the plateau area in the smoothed elevation grid data, and output 3D elevation grid data containing the smoothed plateau and the connected slope, which is used to guide the site leveling construction of the mountain town.
[0053] Furthermore, based on the same inventive concept, embodiments of the present invention also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the various steps of the automatic site leveling design method for mountainous towns as described above.
[0054] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for automatic design of site grading for mountainous towns, characterized in that, Specifically, it includes: The original elevation point data and design range of the mountain town site are obtained, and the original elevation point data is transformed by coordinate system projection. The original elevation point data after coordinate system projection transformation is rasterized with the design range as the calculation boundary to fill the holes generated after processing, so as to obtain the preprocessed elevation raster data. A dataset of multidimensional feature vectors is constructed based on the row and column spatial features and elevation features of each grid cell in the elevation raster data. The dataset of multidimensional feature vectors is then clustered using a Gaussian mixture model (GMM) to identify the spatial range of different plateaus and generate preliminary cluster label rasters. The connectivity of the preliminary clustered label grid is optimized to eliminate isolated noise points, resulting in an optimized label grid. The same label in the optimized label grid represents the same plateau region. For each independent label in the optimized label raster, a mask matrix representing the coverage area of the label is generated, and the calculation range is limited based on the mask matrix. Gaussian filtering is applied independently to the elevation raster data within the plateau region to perform partition smoothing, thereby reducing the slope inside the plateau while maintaining the plateau boundary, and obtaining smoothed elevation raster data. Based on the smoothed elevation raster data, abnormal regions where the elevation difference between adjacent raster cells is greater than a preset elevation difference threshold are detected. Morphological dilation is performed on the abnormal regions, and the slope of the edge position and the surrounding area after dilation is calculated. It is determined whether the slope meets a preset slope ratio threshold, so as to iteratively expand and finally determine the slope region. Based on the known elevation values of the plateau region in the smoothed elevation raster data, elevation interpolation calculations are performed on the raster cells in the slope region to output three-dimensional elevation raster data containing the smoothed plateau and the connected slope, which is used to guide the site leveling construction of the mountain town.
2. The method for automatic design of site grading for mountain town according to claim 1, characterized in that, The step of performing coordinate system projection transformation on the original elevation point data, and then rasterizing the transformed original elevation point data using the design range as the calculation boundary to fill the holes generated after processing includes: The original elevation point data is dynamically projected from the geographic coordinate system to the target projection coordinate system. Using the design range as a mask, calculate the arithmetic mean of the elevation values of all elevation points within the coverage area of each grid cell at a preset resolution to generate initial elevation grid data; The locations of holes in the initial elevation raster data are identified, and the holes are calculated and filled using cubic spline interpolation based on the known elevation values of the surrounding non-hole locations, thus obtaining the preprocessed elevation raster data.
3. The method for automatic design of site preparation for mountain town according to claim 1, characterized in that, The process of clustering the dataset using a Gaussian Mixture Model (GMM) to generate a preliminary cluster label raster includes: The row coordinates, column coordinates, and elevation values of each grid cell in the elevation raster data are extracted as the two-dimensional coordinate features and elevation features, and then normalized to their maximum and minimum values. The number of clusters is preset according to the terrain complexity of the design scope, and a Gaussian mixture model containing multiple Gaussian components is constructed. Using the Expectation-Maximization (EM) algorithm, the posterior probability of each grid cell belonging to each Gaussian component is calculated by iteratively updating the mixture weights, mean vectors, and covariance matrices of each Gaussian component. Each grid cell is assigned to the cluster corresponding to the Gaussian component with the highest posterior probability to generate the preliminary clustering label grid.
4. The method for automatic design of site preparation for mountain town of claim 1, wherein, The connectivity optimization of the preliminary clustered label grid includes: The regions with the same label in the preliminary clustering label grid are labeled as four connected regions. If there are isolated regions with the same label but not belonging to the same connected region in space, a new label is assigned to them based on the connected region label. For the tag grid after the new labels are assigned, each grid cell is traversed and its label is replaced with the most frequent modal label in its eight neighborhoods to smooth the plateau boundary and eliminate isolated noise points, and the optimized tag grid is output.
5. The method for automatic design of site preparation for mountain town of claim 1, wherein, The step of independently applying Gaussian filtering to smooth the elevation raster data within the plateau region includes: Determine whether the average initial terrain slope of all grid cells within each plateau region is greater than a preset slope threshold. For the gentle terrace area where the average value is not greater than the preset slope threshold, a first Gaussian standard deviation and a first cutoff parameter are set to construct a first two-dimensional Gaussian kernel matrix. For steep plateau regions where the average value is greater than the preset slope threshold, a second Gaussian standard deviation and a second truncation parameter are set to values that are greater than the first Gaussian standard deviation and the first truncation parameter, respectively, to construct a second two-dimensional Gaussian kernel matrix. Based on the calculation range defined by the mask matrix, the elevation raster data is subjected to weighted average filtering calculation with the corresponding matching first two-dimensional Gaussian kernel matrix or second two-dimensional Gaussian kernel matrix to update the elevation value within the plateau area.
6. The automatic design method for site preparation of mountain town according to claim 1, wherein, The step of performing morphological dilation on the abnormal region and calculating the slope of the edge position and surrounding area after dilation includes: Using the identified abnormal regions as the initial set, morphological expansion is performed using structuring elements of a preset size to extend the boundaries; The surrounding area is defined as a preset spatial distance, and the spatial slope between the newly added edge position after each expansion and multiple surrounding grid units within the preset spatial distance is calculated. If the calculated slope extending to the multiple surrounding grid cells is less than the preset slope ratio threshold, then the edge position is marked as a slope region and expansion in that direction is stopped; otherwise, the next round of morphological expansion cycle begins.
7. The automatic site leveling design method for mountainous towns according to claim 6, characterized in that, Before performing elevation interpolation calculations on the grid cells within the slope area during execution, the method further includes a slope area refinement step: The resolution of the current elevation raster data and slope area is improved by using linear interpolation according to a preset magnification factor. In the elevation raster data after resolution enhancement, morphological shrinkage operation is used to perform boundary restoration on the initially screened slope areas. The slope of the contracted edge is recalculated until the slope of the contracted edge is less than or equal to the preset slope ratio threshold, in order to determine the final slope area with high accuracy.
8. A site grading automatic design system for mountainous towns, characterized by, include: The data acquisition and preprocessing module is used to acquire the original elevation point data and design range of the mountain town site, and to perform coordinate system projection transformation on the original elevation point data. Using the design range as the calculation boundary, the original elevation point data after coordinate system projection transformation is rasterized to fill the holes generated after processing, and the preprocessed elevation raster data is obtained. The GMM clustering module is used to construct a dataset of multidimensional feature vectors based on the row and column spatial features and elevation features of each grid cell in the elevation raster data. The dataset of multidimensional feature vectors is clustered using the Gaussian Mixture Model (GMM) to identify the spatial range of different plateaus and generate preliminary cluster label raster. The connectivity optimization module is used to optimize the connectivity of the preliminary clustered label grid, eliminate isolated noise points, and obtain an optimized label grid, wherein the same label in the optimized label grid represents the same plateau region. The partition smoothing module is used to generate a mask matrix representing the coverage of each independent label in the optimized label raster, and to limit the calculation range based on the mask matrix. Gaussian filtering is applied independently to the elevation raster data within the plateau region to perform partition smoothing processing, thereby reducing the slope inside the plateau while maintaining the plateau boundary, and obtaining smoothed elevation raster data. The slope generation module is used to detect abnormal areas where the elevation difference between adjacent grid cells is greater than a preset elevation difference threshold based on the smoothed elevation grid data. By performing morphological expansion on the abnormal areas and calculating the slope of the expanded edge position and the surrounding area, it determines whether the slope meets the preset slope ratio threshold, so as to iteratively expand and finally determine the slope area. The 3D model output module is used to perform elevation interpolation calculations on the grid cells in the slope area based on the known elevation values of the plateau area in the smoothed elevation grid data, and output 3D elevation grid data containing the smoothed plateau and the connected slope, which is used to guide the site leveling construction of the mountain town. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8. When the processor executes the computer program, it implements the steps of the automatic site leveling design method for mountainous towns as described in any one of claims 1 to 7.